GeMRTOS
Related Functions
Semaphore Class Reference

Related Functions

(Note that these are not member functions.)

Friends And Related Function Documentation

◆ gk_SEM_granted_kill()

INT32 gk_SEM_granted_kill ( GS_ECB pevent1)
related

Removes the ECBs from a the granted list of a semaphore resource.

gk_SEM_granted_kill

Parameters
[in]pevent1Task ECB associated to the semaphore resource
Returns
G_TRUE when successful, G_FALSE otherwise

The ECBs has to be type G_ECBType_SEM_GRANTED or G_ECBType_TIMEOUT_SEM_GRANTED. This function is called from gk_TCB_List_Unlink

Definition at line 573 of file sem.c.

◆ gk_SEM_waiting_kill()

INT32 gk_SEM_waiting_kill ( GS_ECB pevent1)
related

Removes the ECBs from a the waiting list of a semaphore resource.

gk_SEM_waiting_kill

Parameters
[in]pevent1Task ECB associated to the semaphore resource
Returns
G_TRUE when successful, G_FALSE otherwise

The ECBs has to be type G_ECBType_SEM_WAITING or G_ECBType_TIMEOUT_SEM_WAITING This function is called from gk_TCB_List_Unlink

Definition at line 590 of file sem.c.

◆ gk_TASK_RESOURCE_CREATE()

GS_ECB* gk_TASK_RESOURCE_CREATE ( G_RCB presource,
GS_TCB ptcb,
INT64  waiting_priority,
INT64  RCBGrantedPriority,
INT64  RCBWaitingTimeout,
INT64  RCBGrantedTimeout 
)
related

Creates the structure to sopport a resource from a task.

gk_TASK_RESOURCE_CREATE

Parameters
[in]presourcePointer to the RCB of the semaphore
[in]ptcbPointer to the TCB of the task
[in]waiting_priorityDefault waiting priority
[in]RCBGrantedPriorityDefault granted priority
[in]RCBWaitingTimeoutDefault waiting timeout
[in]RCBGrantedTimeoutDefault granted timeout
Returns
Pointer to the ECB of the event of the resource
Todo:
Eliminate the code replacing where it is used

Definition at line 437 of file sem.c.

◆ gk_TASK_RESOURCE_DESTROY()

INT32 gk_TASK_RESOURCE_DESTROY ( GS_ECB pevent)
related

Destroy the events associated to a task and semaphore and returns them to the free lists.

gk_TASK_RESOURCE_DESTROY

Parameters
[in]presourcePointer to the RCB of the resource
[in]peventPointer to the ECB of the resource
Returns
G_TRUE when successful, G_FALSE otherwise
Todo:
Eliminate replacing the code where it is used

Definition at line 486 of file sem.c.

◆ gk_TASK_RESOURCE_GRANT()

INT32 gk_TASK_RESOURCE_GRANT ( G_RCB presource,
GS_ECB pevent 
)
related

Sets the granted and timed events when a semaphore is granted to a TCB.

gk_TASK_RESOURCE_GRANT

Parameters
[in]presourcePointer to the RCB of the semaphore
[in]peventPointer to the ECB of the event
Returns
G_TRUE when successful, G_FALSE otherwise
Todo:
Eliminate the function replacing the code

Definition at line 328 of file sem.c.

◆ gk_TASK_RESOURCE_UNGRANT()

INT32 gk_TASK_RESOURCE_UNGRANT ( G_RCB presource,
GS_ECB pevent 
)
related

Unlinks the granted and timed events of a granted task.

gk_TASK_RESOURCE_UNGRANT

Parameters
[in]presourcePointer to the RCB of the semaphore
[in]peventPointer to the ECB of the event
Returns
G_TRUE when successful, G_FALSE otherwise
Todo:
Eliminate replacing the code

Definition at line 371 of file sem.c.

◆ gk_TASK_RESOURCE_UNWAIT()

INT32 gk_TASK_RESOURCE_UNWAIT ( G_RCB presource,
GS_ECB pevent 
)
related

Unlinks the ECB waiting and timed set for waiting a semaphore.

gk_TASK_RESOURCE_UNWAIT

Parameters
[in]presourcePointer to the RCB of the semaphore
[in]peventPointer to de ECB of the event
Returns
G_TRUE when successful, G_FALSE otherwise
Todo:
Eliminate the code replacing it where it is called from

Definition at line 304 of file sem.c.

◆ gk_TASK_RESOURCE_WAIT()

INT32 gk_TASK_RESOURCE_WAIT ( G_RCB presource,
GS_ECB pevent 
)
related

Sets the waiting and timed event for waiting the semaphore.

gk_TASK_RESOURCE_WAIT

Parameters
[in]presourcePointer to the RCB of the semaphore
[in]peventPointer to de ECB of the event
Returns
G_TRUE when successful, G_FALSE otherwise
Todo:
Eliminate this function replacing the code where it is called from

Definition at line 262 of file sem.c.

◆ gk_timeout_ECB_SEM_post()

INT32 gk_timeout_ECB_SEM_post ( GS_ECB peventime)
related

Time routine for event G_ECBType_TIMEOUT_SEM_GRANTED. It is called from the time interrupt ISR.

gk_timeout_ECB_SEM_post

Parameters
[in]peventimePointer to the timed event
Returns
G_TRUE when successful, G_FALSE otherwise
Todo:
Eliminate the TASK_RESOURCE routines

Definition at line 533 of file sem.c.

◆ gk_timeout_ECB_SEM_wait()

INT32 gk_timeout_ECB_SEM_wait ( GS_ECB peventime)
related

Time routine for event G_ECBType_TIMEOUT_SEM_WAITING. It is called from the time interrupt ISR.

gk_timeout_ECB_SEM_wait

Parameters
[in]peventimePointer to the timed event
Returns
G_TRUE when successful, G_FALSE otherwise
Todo:
Replace gk_TASK_RESOURCE_UNWAIT

Definition at line 512 of file sem.c.

◆ gu_sem_destroy()

INT32 gu_sem_destroy ( t_semaphore_resource presource)
related

Links the RCB of a semaphore to the free list if there is no event granted or waiting.

gu_sem_destroy

Parameters
[in]presourcePointer to the RCB of the semaphore
Returns
G_TRUE when successful, G_FALSE otherwise
Todo:
Analyse to remove all list and trigger signal to tasks

Definition at line 86 of file sem.c.

◆ gu_sem_getvalue()

INT32 gu_sem_getvalue ( t_semaphore_resource presource)
related

Return the current value of the semaphore.

gu_sem_getvalue

Parameters
[in]presourcePointer to the RCB of the semaphore
Returns
Current value of the semaphore
Todo:
Check if this function is necessary

Definition at line 247 of file sem.c.

◆ gu_sem_post()

INT32 gu_sem_post ( t_semaphore_resource presource)
related

Unlocks the semaphore (release the semaphore). Set ready the task waiting for semaphore.

gu_sem_post

Parameters
[in]presourcePointer to the RCB of the semaphore
Returns
G_TRUE when successful, G_FALSE otherwise
Todo:
Check if semaphore is granted to the task doing the post

Definition at line 211 of file sem.c.

◆ OPTIMEZE_CODE()

OPTIMEZE_CODE ( )
related

Definition at line 33 of file sem.c.


The documentation for this class was generated from the following files: