GeMRTOS
sem.h
Go to the documentation of this file.
1 
21 /******************************************************************************
22 * *
23 * License Agreement *
24 * Copyright (c) Ricardo L. Cayssials *
25 * All rights reserved. *
26 * *
27 ******************************************************************************/
28 
29 
30 // Check https://stackoverflow.com/questions/1154709/how-can-i-hide-the-declaration-of-a-struct-in-c
31 
32 #ifndef SEM_H_
33 #define SEM_H_
34 
35 
39 t_semaphore_resource *gu_sem_create(gt_time RCB_Priority, int initial_count, gt_time RCBWaitingTimeout, gt_time RCBGrantedTimeout);
42  gt_priority waiting_priority,
43  gt_priority RCBGrantedPriority,
44  gt_time RCBWaitingTimeout,
45  gt_time RCBGrantedTimeout,
46  int blocking);
53 
54 
62 };
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 #endif /* SEM_H */
INT32
unsigned INT32
Definition: gemrtos_core.h:62
Semaphore::gk_timeout_ECB_SEM_post
INT32 gk_timeout_ECB_SEM_post(GS_ECB *peventime)
Time routine for event G_ECBType_TIMEOUT_SEM_GRANTED. It is called from the time interrupt ISR.
Definition: sem.c:533
gt_time
unsigned long long gt_time
Definition: gemrtos_core.h:65
gt_priority
unsigned long long gt_priority
Definition: gemrtos_core.h:66
Semaphore::gu_sem_post
INT32 gu_sem_post(t_semaphore_resource *presource)
Unlocks the semaphore (release the semaphore). Set ready the task waiting for semaphore.
Definition: sem.c:211
T_SEMAPHORE_RESOURCE::SEMMaxCount
INT32 SEMMaxCount
Definition: sem.h:61
Semaphore::gu_sem_getvalue
INT32 gu_sem_getvalue(t_semaphore_resource *presource)
Return the current value of the semaphore.
Definition: sem.c:247
gu_sem_create
t_semaphore_resource* gu_sem_create(gt_time RCB_Priority, int initial_count, gt_time RCBWaitingTimeout, gt_time RCBGrantedTimeout)
Semaphore::gk_SEM_granted_kill
INT32 gk_SEM_granted_kill(GS_ECB *pevent1)
Removes the ECBs from a the granted list of a semaphore resource.
Definition: sem.c:573
T_SEMAPHORE_RESOURCE
Semaphore Resource.
Definition: sem.h:60
t_semaphore_resource
struct g_rgb t_semaphore_resource
Definition: gemrtos_core.h:57
Semaphore::gu_sem_destroy
INT32 gu_sem_destroy(t_semaphore_resource *presource)
Links the RCB of a semaphore to the free list if there is no event granted or waiting.
Definition: sem.c:86
Semaphore::gk_timeout_ECB_SEM_wait
INT32 gk_timeout_ECB_SEM_wait(GS_ECB *peventime)
Time routine for event G_ECBType_TIMEOUT_SEM_WAITING. It is called from the time interrupt ISR.
Definition: sem.c:512
GS_ECB
struct gs_ecb GS_ECB
Definition: gemrtos_core.h:51
Semaphore::gk_SEM_waiting_kill
INT32 gk_SEM_waiting_kill(GS_ECB *pevent1)
Removes the ECBs from a the waiting list of a semaphore resource.
Definition: sem.c:590
Resource::gu_sem_wait
INT32 gu_sem_wait(t_semaphore_resource *presource, gt_priority waiting_priority, gt_priority RCBGrantedPriority, gt_time RCBWaitingTimeout, gt_time RCBGrantedTimeout, int blocking)
Lock the semaphore (get the semaphore) if it is avaible, otherwise waits for grant it.
Definition: sem.c:109