HeMPS  8.0
Classes | Macros | Functions
local_scheduler.h File Reference

Defines Scheduling structure. This struct is used to manages the scheduling informations relative to each task. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Scheduling
 This structure stores variables useful to manage the task scheduling (for BE or RT) Some of the values are only used for RT tasks. More...
 

Macros

#define FREE   -1
 Scheduling position not have a valid task.
 
#define READY   0
 Task is in ready to execute.
 
#define WAITING   1
 Task is waiting for a message.
 
#define RUNNING   2
 Task is running in the CPU.
 
#define MIGRATING   3
 Task is being migrated.
 
#define BLOCKED   4
 Task is blocked waiting for the manager send a TASK_RELEASE packet.
 
#define SLEEPING   5
 Task already executed all its execution time and is sleeping until the end of period.
 
#define DEBUG   0
 When enabled shows the puts placed within local_scheduler.c.
 
#define NO_DEADLINE   -1
 A task that is best-effor have its deadline variable equal to -1.
 
#define MAX_TIME_SLICE   16318
 Standard time slice value for task execution.
 

Functions

void real_time_task (Scheduling *, unsigned int, int, unsigned int)
 
unsigned int get_time_slice ()
 
void init_scheduling_ptr (Scheduling **, int)
 
void clear_scheduling (Scheduling *)
 
SchedulingLST (unsigned int)
 

Detailed Description

Defines Scheduling structure. This struct is used to manages the scheduling informations relative to each task.

HEMPS VERSION - 8.0 - support for RT applications

Distribution: June 2016

Created by: Marcelo Ruaro - contact: marce.nosp@m.lo.r.nosp@m.uaro@.nosp@m.acad.nosp@m..pucr.nosp@m.s.br

Research group: GAPH-PUCRS - contact: ferna.nosp@m.ndo..nosp@m.morae.nosp@m.s@pu.nosp@m.crs.b.nosp@m.r

A given task can be BE (Best-Effort) or RT (Real-Time).

BE task have not timing constraints. RT have the timing constraints defined according the next diagram

Periodic task real-time parameters

|<---------— period --------------—> | | |

<---------—deadline---------—>
_______________________

|| execution time |<-slack->| | ||_______________________|_________|_____| ^ time -> | | ready time

Function Documentation

void clear_scheduling ( Scheduling scheduling_tcb)

Clear a scheduling instance, used when the task is removed from slave processor

Parameters
scheduling_tcbScheduling pointer to be cleared
unsigned int get_time_slice ( )

Get the time slice. Useful to provide the kernel slave time slice

Returns
Global variable time_slice
void init_scheduling_ptr ( Scheduling **  sched_ptr,
int  tcb_index 
)

Initializes the scheduling array with valid pointers

Parameters
sched_ptrPointer to pointer of the scheduler variable into TCB structure
tcb_indexTCB array index
Scheduling* LST ( unsigned int  current_time)

The LST algorithm called by kernel slave. It select the next RT task with the least slack time, or the next BE task following a round-robin order

Parameters
current_timeCurrent system time
Returns
The Scheduling pointer of the scheduled task
void real_time_task ( Scheduling real_time_task,
unsigned int  period,
int  deadline,
unsigned int  execution_time 
)

Funcion called by kernel slave when a task call the primitive RealTime. This function set the real-time paramenters for the task.

Parameters
real_time_taskTask pointer that change or is setting its RT parameters
periodTask period in clock cycles
deadlineTask deadline in clock cycles
execution_timeTask execution time in clock cycles