GeMRTOS
gemrtos_core.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 // Check https://stackoverflow.com/questions/1154709/how-can-i-hide-the-declaration-of-a-struct-in-c
30 
31 #ifndef GEMRTOS_CORE_H_
32 #define GEMRTOS_CORE_H_
33 
34 #include <grtosdefinitions.h>
35 
36 /************************************************************************************
37  * System constants definitions
38  ************************************************************************************/
39 #define G_FALSE 0u
40 #define G_TRUE 1u
41 
42 
43 /************************************************************************************
44  * GRTOS TYPE DEFINITIONS
45  ************************************************************************************/
46 
47 typedef struct gs_kcb GS_KCB;
48 typedef struct gs_pcb GS_PCB;
49 typedef struct gs_lcb GS_LCB;
50 typedef struct gs_tcb GS_TCB;
51 typedef struct gs_ecb GS_ECB;
52 typedef struct gs_scb GS_SCB;
53 typedef struct gs_rrds GS_RRDS;
54 typedef struct g_rgb G_RCB;
55 typedef struct gs_mcb GS_MCB;
56 typedef struct g_rgb t_message_resource;
57 typedef struct g_rgb t_semaphore_resource;
58 
59 
60 /* This is the definition for Nios32. */
61 typedef unsigned long long INT64;
62 typedef unsigned INT32; /* Unsigned 32 bit quantity */
63 typedef unsigned int GS_STK; /* Type to Stack Pointers */
64 
65 typedef unsigned long long gt_time;
66 typedef unsigned long long gt_priority;
67 
68 
69 typedef union timepriority {
70  INT64 i64 __attribute__((aligned(4)));
71  INT32 i32[2];
72 } TIMEPRIORITY;
73 
74 
75 typedef struct gs_tm {
76  int tm_msec; /* Seconds: 0-59 (K&R says 0-61?) */
77  int tm_sec; /* Seconds: 0-59 (K&R says 0-61?) */
78  int tm_min; /* Minutes: 0-59 */
79  int tm_hour; /* Hours since midnight: 0-23 */
80  int tm_day; /* Day of the month: 1-31 */
81  int tm_year; /* Years since 1900 */
82 } gt_tm;
83 
87 struct gs_ext_isr {
88  struct gs_tcb *G_TCB_ISR;
91 };
92 
93 /************************************************************************************
94  * GeMRTOS DATA STRUCTURES
95  ************************************************************************************/
96 
97 //*************************************************************************************************
100 
102 
107 struct gs_ecb {
108  unsigned int BLOCK_HASH;
113  struct gs_ecb *ECB_NextECB;
114  struct gs_ecb *ECB_PrevECB;
116  struct g_rcb *ECB_AssocRCB;
121  struct gs_rrds *ECB_RRDS;
122 
126 };
127 
129 #define GS_ECBState_GRANTED_RESOURCE 1u
130 #define GS_ECBState_WAITING_RESOURCE 2u
131 #define GS_ECBState_FREE 3u
132 #define GS_ECBState_WAITING_TIME 4u
133 #define GS_ECBState_UNLINKED 5u
134 
135 #define G_ECBType_OSTimeDly 21u
137 #define G_ECBType_PERIODIC 22u
138 #define G_ECBType_LASTEST_TIME 23u
139 #define G_ECBType_TIMEOUT_SEM_GRANTED 24u
140 #define G_ECBType_TIMEOUT_SEM_WAITING 25u
141 #define G_ECBType_SEM_GRANTED 28u
142 #define G_ECBType_SEM_WAITING 29u
143 #define G_ECBType_NOT_SPECIFIED 30u
144 #define G_ECBType_QUEUE_CONSUME 31u
145 #define G_ECBType_MESSAGE_CONSUME_WAIT 33u
146 #define G_ECBType_MESSAGE_CONSUME_EXPIRED 34u
147 #define G_ECBType_MESSAGE_SEND_EXPIRED 35u
148 #define G_ECBType_MESSAGE_SEND_WAIT 36u
149 
150 
151 //*************************************************************************************************
153 
157 struct gs_kcb {
162  struct gs_ext_isr KCB_ExtISR[ALT_NIRQ] __attribute__((aligned(4)));
163 
164  // int *GRTOS_PROCESSOR_BASE[G_NUMBER_OF_PCB+1] __attribute__((aligned(4))); /// \brief Processor specific addresses to go to idle state
165 
166  GS_PCB *G_PCBTbl __attribute__((aligned(4)));
167 
175 
177  // volatile INT32 G_ISR_STACK[ALT_NIRQ][G_ISR_STACKSIZE] __attribute__((aligned(4))); ///< \brief Array of STACKS for ISR tasks
178  // volatile GS_STK G_IDLE_STACK[G_NUMBER_OF_PCB][G_IDLE_STACKSIZE] __attribute__((aligned(4))); ///< \brief Array of STACKS for IDLE tasks
179  volatile INT32 *G_ISR_STACK;
180  volatile GS_STK *G_IDLE_STACK;
181 
185  struct g_rcb *KCB_ROOT_RCBs;
189 };
190 
191 //*************************************************************************************************
194 
196 
203 struct gs_lcb {
204  unsigned int BLOCK_HASH;
216 
220 };
221 
223 #define GS_LCBState_LINKED 1u
224 #define GS_LCBState_UNLINKED 2u
225 
226 #define GS_LCBType_UNSPECIFIED 2u
227 //*************************************************************************************************
228 
232 
238 struct gs_pcb {
239  int PCBID;
240  int PCBState;
241  int PCBType;
242  int *GRTOS_PROCESSOR_BASE __attribute__((aligned(4)));
243  struct gs_lcb *PCB_RDY_LCBL[G_NUMBER_OF_LCBs_FOR_PCB] __attribute__((aligned(4)));
244  struct gs_tcb *PCB_IDLETCB;
245  struct gs_tcb *PCB_EXECTCB;
246  struct gs_pcb *PCB_NextPCB;
247  struct gs_pcb *PCB_PrevPCB;
248 };
249 
251 #define GS_PCBState_NOTRUNNING 1u
252 #define GS_PCBState_RUNNING 2u
253 #define GS_PCBState_FREE 3u
254 
255 #define GS_PCBType_UNSPECIFIED 1u
256 
257 #include <mq.h>
258 #include <sem.h>
259 
268  struct gs_mcb *MES_LastMCB;
270 };
271 
276 struct gs_mcb {
279  struct gs_mcb *MCB_NextMCB;
280  struct gs_mcb *MCB_PrevMCB;
285 };
286 
288 #define GK_MCBState_UNLINKED 2u
289 #define GK_MCBState_FREE 3u
290 #define GK_MCBState_LINKED 4u
291 
292 
293 extern struct T_QUEUE_RESOURCE queue;
294 
295 //*************************************************************************************************
298 
300 
306 struct g_rgb{
307  struct {
308  unsigned int BLOCK_HASH;
319  struct g_rcb *RCB_NextRCB;
321 
325  };
326  union {
330  };
331 };
332 
334 #define GK_RCBState_SEM 3u
335 #define GK_RCBState_MQ 4u
336 #define GK_RCBState_UNDEFINED 5u
337 #define GK_RCBState_QUEUE 6u
338 
339 #define GK_RCBType_UNUSED 1u
341 #define GK_RCBType_FREE 2u
342 #define GK_RCBType_SEM 3u
343 #define GK_RCBType_MQ 4u
344 #define GK_RCBType_QUEUE 5u
345 
346 
347 //*************************************************************************************************
350 
352 
357 struct gs_rrds {
358  struct {
359  unsigned int BLOCK_HASH;
366 
370  };
371  union {
372  struct {
377  };
379  };
380 };
381 
382 
383 //*************************************************************************************************
386 
388 
393 struct gs_scb {
394  unsigned int BLOCK_HASH;
399  void *SCB_TaskCode;
400  void *SCB_TaskArg;
401  struct gs_scb *SCB_NextSCB;
403  void *SCB_AssocXCB;
404 
408 };
409 
410 // SCBState gruop
412 #define G_SCBState_FREE 1u
413 #define G_SCBState_IN_KCB 2u
414 #define G_SCBState_IN_ECB 3u
415 #define G_SCBState_IN_TCB 4u
416 #define G_SCBState_IN_RCB 5u
417 #define G_SCBState_IN_PCB 6u
418 #define G_SCBState_IN_LCB 7u
419 #define G_SCBState_UNLINKED 8u
420 #define G_SCBState_PENDING 9u
421 #define G_SCBState_EXECUTING 10u
422 
423 // SCBType group
426 #define G_SCBType_TCB_ABORTED 1000u
427 
428 
429 //*************************************************************************************************
432 
439 struct gs_tcb
440 {
441  unsigned int BLOCK_HASH;
442  unsigned int TCBState;
443  unsigned int TCBType;
454  void *TCB_TaskCode;
455  void *TCB_TaskArg;
456  volatile struct gs_tcb *TCB_NextTCB;
457  struct gs_tcb *TCB_PrevTCB;
461  unsigned int TCB_AssocPCB;
467 
471 };
472 
473 // TCBState gruop
475 #define GRTOS_TASK_STATE_WAITING(ptcb) ((ptcb->TCBState >> 1) & 1)
476 
477 #define G_TCBState_WAITING_COMPLETED 2u
478 #define G_TCBState_WAITING 258u
479 #define G_TCBState_READY 4u
480 #define G_TCBState_RUNNING 8u
481 #define G_TCBState_FREE 16u
482 #define G_TCBState_UNLINKED 32u
483 
484 // TCBType group
486 #define G_TCBType_UCOS 1u
487 #define G_TCBType_PERIODIC 2u
488 #define G_TCBType_ISR 4u
489 #define G_TCBType_IDLE 5u
490 #define G_TCBType_UNDEFINED 7u
491 
492 /*
493 *********************************************************************************************************
494 * SYSTEM VARIABLES
495 *********************************************************************************************************
496 */
497 
498 
499 extern volatile int G_DEBUG_SAMPLE_BEGIN_ENABLE;
500 extern volatile int G_DEBUG_SAMPLE_END_ENABLE;
501 
502 extern volatile INT32 G_Running;
503 extern volatile INT32 gs_sizeof_G_PCBTbl;
504 extern volatile void *gs_addressof_G_PCBTbl;
505 extern volatile INT32 gs_offsetof_PCB_EXECTCB;
506 extern volatile INT32 gs_offsetof_TCB_StackPointer;
507 extern volatile INT32 gs_offsetof_PCB_IDLETCB;
508 
509 
510 extern GS_KCB g_kcb;
511 
512 //Variable to interface C and assembler
513 extern volatile GS_STK G_TCB_CURRENT;
514 extern volatile INT32 G_SCB_PENDING;
515 extern volatile INT32 G_SCB_CODE;
516 extern volatile INT32 G_SCB_ARG;
517 
518 // extern volatile int GRTOS_S_PROCESSOR1_IRQ_INTERRUPT_CONTROLLER_ID;
519 extern volatile int GRTOS_S_PROCESSOR1_IRQ;
520 
521 extern volatile int G_IRQ_ENABLED;
522 extern volatile int G_IRQ_PENDING;
523 
528 
529 extern FILE* fpuart[G_NUMBER_OF_PCB];
530 
531 extern volatile INT32 G_TASK_TYPE_DEFAULT;
532 extern volatile GS_LCB *G_TASK_LCB_DEFAULT;
533 extern volatile INT64 G_TASK_PRIORITY_DEFAULT;
534 extern volatile INT64 G_TASK_PERIOD_DEFAULT;
535 
536 
537 
538 
539 
540 
541 
542 
543 
544 
545 
546 
547 
548 
550 GS_ECB *gk_Get_ECB(void);
551 G_RCB *gk_Get_RCB(void);
552 GS_SCB *gk_Get_SCB(void);
553 GS_RRDS *gk_Get_RRDS(void);
554 GS_LCB *gk_Get_LCB(void);
555 INT32 gk_Create_PCBs(int Nmbr_PCB);
556 
557 
558 /***************************************************************/
559 /* INTERNAL SYSTEM FUNCTIONS */
560 /***************************************************************/
569 
570 /***************************************************************/
571 /* debug function */
572 /***************************************************************/
573 INT32 TCB_IsValid(GS_TCB *ptcb);
574 
575 INT32 LCB_IsValid(GS_LCB *plcb);
576 
577 INT32 PCB_IsValid(GS_PCB *ppcb);
578 INT32 ECB_IsValid(GS_ECB *pevent);
579 INT32 SCB_IsValid(GS_SCB *pscb);
580 INT32 RCB_IsValid(void *prcb);
581 INT32 RRDS_IsValid(GS_RRDS *prrds);
582 
583 INT32 TCBState_Valid(unsigned int tcbstate);
584 INT32 TCBType_Valid(unsigned int tcbtype);
585 INT32 ECBState_Valid(unsigned int ecbstate);
586 INT32 ECBType_Valid(unsigned int ecbtype);
587 
588 INT32 IsAListorNull(GS_LCB *plcb);
589 
590 
591 /***************************************************************/
592 /* LIST AND DATA STRUCTURES PROTOTYPES */
593 /***************************************************************/
594 
595 INT32 gk_ECBAEL_Link(GS_ECB *pevent1, GS_ECB *pevent2);
596 INT32 gk_ECBAEL_Remove(GS_ECB *pevent);
597 
598 void gk_ECBASL_Link(GS_ECB *pevent, GS_SCB *psignal);
599 INT32 gk_ECBASL_Unlink(GS_ECB *pevent, GS_SCB *psignal);
600 GS_SCB *gk_ECBASL_GetSCB(GS_ECB *pevent, INT32 SignalType);
601 
602 GS_ECB *gk_ECB_GetFree(void);
603 // INT32 gk_ECBFL_Link(GS_ECB *pevent);
604 
605 extern INT32 gk_ECBTL_Link (GS_ECB *pevent);
606 extern INT32 gk_ECBTL_Unlink(GS_ECB *pevent);
607 
608 INT32 gk_KCBASL_Link(GS_SCB *psignal);
609 INT32 gk_KCBASL_Unlink(GS_SCB *psignal);
610 INT32 gk_LCBL_Link(GS_LCB *plcb);
611 GS_SCB *gk_KCBASL_GetSCB(INT32 SignalType);
612 
613 INT32 gk_LCBFPL_Link(int processorID);
614 INT32 gk_LCBFPL_Unlink(int processorID);
615 
617 //void gk_LCB_Link_to_LCB_List(GS_LCB *plcb);
618 
619 // GS_MCB *gk_MCB_GetFree(void);
620 // void gk_MCBFL_Link(GS_MCB *pmcb);
621 
622 // int gk_MCBQL_Link(GS_MCB *pmcb, G_RCB * prcb);
623 // void gk_MCBQL_Unlink(GS_MCB *pmcb, G_RCB * prcb);
624 
625 void gk_PCBInit(void);
626 
627 G_RCB *gk_RCB_GetFree(void);
628 INT32 gk_RCBFL_Link(G_RCB *presource);
629 
631 INT32 gk_TASK_RESOURCE_WAIT(G_RCB *presource, GS_ECB *pevent);
632 INT32 gk_TASK_RESOURCE_UNWAIT(G_RCB *presource, GS_ECB *pevent);
633 INT32 gk_TASK_RESOURCE_GRANT(G_RCB *presource, GS_ECB *pevent);
634 INT32 gk_TASK_RESOURCE_UNGRANT(G_RCB *presource, GS_ECB *pevent) ;
636  GS_TCB *ptcb,
637  INT64 waiting_priority,
638  INT64 RCBGrantedPriority,
639  INT64 RCBWaitingTimeout,
640  INT64 RCBGrantedTimeout);
642 
643 GS_ECB *gk_RCBGEL_Link(G_RCB *presource, GS_ECB *pevent);
644 void gk_RCBGEL_Unlink(GS_ECB *pevent);
645 
646 INT32 gk_RCBASL_Link(G_RCB *presource, GS_SCB *psignal);
647 INT32 gk_RCBASL_Unlink(G_RCB *presource, GS_SCB *psignal);
648 GS_SCB *gk_RCBASL_GetSCB(G_RCB *presource, INT32 SignalType);
649 
650 GS_ECB *gk_RCBWEL_Link(G_RCB *presource, GS_ECB *pevent);
651 void gk_RCBWEL_Unlink(GS_ECB *pevent);
652 
653 INT32 gk_RRDSASL_Link(GS_RRDS *prrds, GS_SCB *psignal);
654 INT32 gk_RRDSASL_UnLink(GS_RRDS *prrds, GS_SCB *psignal);
655 GS_SCB *gk_RRDSASL_GetSCB(GS_RRDS *prrds, INT32 SignalType);
656 
657 GS_RRDS *gk_RRDS_GetFree(void);
659 
660 INT32 gk_SCBFL_Link(GS_SCB *psignal);
661 GS_SCB *gk_SCB_GetFree(void);
662 GS_SCB *gk_SCB_Copy(GS_SCB *psignal);
663 
664 void gk_SCBAPSL_Link(GS_SCB *pscb_root, GS_SCB *pscb_pending);
665 INT32 gk_SCBAPSL_UnLink(GS_SCB *pscb_root, GS_SCB *pscb_pending);
666 
667 GS_TCB *gk_TCB_GetFree(void);
668 INT32 gk_TCB_Unlink(GS_TCB *ptcb);
669 
670 void gk_TCBFL_Init(void);
671 INT32 gk_TCBFL_Link(GS_TCB *ptcb);
672 
673 INT32 gk_TCBAEL_Link(GS_ECB *pevent, GS_TCB *ptcb);
674 INT32 gk_TCBAEL_Unlink(GS_ECB *pevent);
675 
676 INT32 gk_TCBASL_Link(GS_TCB *ptcb, GS_SCB *psignal);
677 INT32 gk_TCBASL_Unlink(GS_TCB *ptcb, GS_SCB *psignal);
678 GS_SCB *gk_TCBASL_GetSCB(GS_TCB *ptcb, INT32 SignalType);
681 INT32 gk_ECBFL_Link(GS_ECB *pevent);
682 
683 INT32 gk_TCBPSL_Link(GS_TCB *ptcb, GS_SCB *psignal);
684 INT32 gk_TCBPSL_Unlink(GS_TCB *ptcb, GS_SCB *psignal);
685 GS_SCB *gk_TCBPSL_GetSCB(GS_TCB *ptcb, INT32 SignalType);
686 
689 
692 
693 INT32 gk_TCBWL_Link(GS_TCB *ptcb, unsigned int state);
695 
696 /***************************************************************/
697 /* TASK RELATED FUNCTIONS */
698 /***************************************************************/
699 // GS_TCB *gk_TASK_Create(void);
700 INT32 gk_TASK_Kill(GS_TCB *ptcb);
701 void gk_KERNEL_TASK_SUSPEND(GS_TCB *ptcb);
704 GS_ECB *gk_TCB_in_RCBGEL(G_RCB *presource, GS_TCB *ptcb);
705 INT32 gk_TASK_PRIORITY_SET(GS_TCB *ptcb, INT32 task_state);
708 
709 
710 /***************************************************************/
711 /* INTERNAL ROUTINES FOR TASK EXECUTION */
712 /***************************************************************/
713 // void gk_Start_Main(void);
714 void gk_KERNEL_TASK_START (void);
715 void gk_ENTRY_IRQ_HANDLER (void);
716 void GRTOS_Start_Task(void);
717 void grtos_irq_entry(void);
718 void GRTOS_Suspend_Task(void);
719 // void gk_INT_TASK_SWITCH(void);
720 GS_TCB *gk_CreateTask(void *TaskCode,
721  void *p_arg,
722  void *StkBotton,
723  unsigned int StkSize,
724  unsigned int TCBType,
728  INT64 TCBPeriod,
732 
734 // void gk_TASK_TCB_Init (GS_TCB *ptcb);
735 // void gk_INIT_IRQ(void);
736 // void gk_KERNEL_TIME_IRQ_HANDLER (void);
737 void gk_TIME_CALLBACK(GS_ECB *event);
739 void gk_FROZEN_CALLBACK(void);
740 void gk_INIT_KERNEL(void);
741 void gk_KERNEL_TASK_COMPLETE(void);
742 void GRTOS_Task_GetPendingSCB(void);
743 // void gk_KERNEL_FROZEN_IRQ_HANDLER(void);
744 void gk_RST_MONITOR_HANDLER (void);
745 
746 
747 /***************************************************************/
748 /* SYSTEM TASKS */
749 /***************************************************************/
750 void gk_ENTRY_SIGNAL_RETURN(void);
751 void gk_CODE_IDLE_TASK(void* pdata);
752 
753 
754 
755 INT32 gu_TASK_Sleep(INT32 hours, INT32 minutes, INT32 seconds, INT32 ms);
757 
761 int gu_Get_CPU_ID(void);
763 gt_tm gu_Clock(gt_time gtime);
764 
768 INT32 gu_Set_Default_Task_Type(unsigned int type);
772 void gu_Set_Default_Task_Priority(INT32 level, INT32 priority);
773 void gu_Set_Default_Task_Period(INT32 hours, INT32 minutes, INT32 seconds, INT32 ms);
774 INT32 gu_SetTaskType(struct gs_tcb *ptcb, unsigned int type);
775 INT32 gu_SetTaskList(struct gs_tcb *ptcb, struct gs_lcb *plcb);
776 INT32 gu_SetTaskReadyPriority(struct gs_tcb *ptcb, long long priority);
777 INT32 gu_SetTaskRunPriority(struct gs_tcb *ptcb, long long priority);
778 INT32 gu_SetTaskDeadline(struct gs_tcb *ptcb, unsigned int hours, unsigned int minutes, unsigned int seconds, unsigned int ms);
779 INT32 gu_SetTaskPeriod(struct gs_tcb *ptcb, unsigned int hours, unsigned int minutes, unsigned int seconds, unsigned int ms);
780 INT32 gu_SetTaskAbortwhenDeadline(struct gs_tcb *ptcb, unsigned int abort_when_deadline);
781 INT32 gu_StartTaskwithOffset(struct gs_tcb *ptcb,unsigned int hours, unsigned int minutes, unsigned int seconds, unsigned int ms);
782 
783 
788 void *gu_GetTask(void *TaskCode,
789  void *p_arg,
790  void *StkBotton,
791  unsigned int StkSize);
792 
793 
794 INT32 gu_TASK_Kill(GS_TCB *ptcb);
798 
799 
800 
801 
805 GS_SCB *gu_signal_create(INT32 Type, INT32 Priority, void *pxcb, void *Signal_Code, void *Signal_Arg);
807 
811 gt_time gu_Convert_Time(INT32 days, INT32 hours, INT32 minutes, INT32 seconds, INT32 ms);
814 gt_time gu_get_now(void);
816 
817 void gk_INIT_IRQ (void);
819 void gk_ISR_RELEASE (int irq_nbr);
820 INT32 gu_SetTaskISR(struct gs_tcb *ptcb, unsigned int irq_nbr);
821 INT32 gk_SetTaskISR(struct gs_tcb *ptcb, unsigned int irq_nbr);
822 
823 
824 // *************************************************** //
825 // *************************************************** //
827 //void gu_TASK_Sleep_Time(gt_time ticks)
828 //{
829 // G_DEBUG_VERBOSE
830 // GRTOS_USER_CRITICAL_SECTION_GET;
831 //
832 // <PREVIOUS SUSPEND PROCEDURE >
833 //
834 // gk_KERNEL_TASK_SUSPEND_CURRENT();
835 // GRTOS_USER_CRITICAL_SECTION_GET;
836 //
837 // <AFTER SUSPEND PROCEDURE >
838 //
839 // GRTOS_CMD_CRITICAL_SECTION_RELEASE;
840 //}
841 // *************************************************** //
842 // *************************************************** //
843 
844 // alt_exception_result handler (alt_exception_cause cause, alt_u32 addr, alt_u32 bad_addr );
845 
849 void gk_MONITOR_FIFO_SAMPLE(int data);
850 INT32 Check_list_TCBAEL_IsValid(int cycles);
851 
852 
853 
854 #endif /* GEMRTOS_CORE_H_ */
gs_pcb::PCB_PrevPCB
struct gs_pcb* PCB_PrevPCB
Pointer to the previous free processor.
Definition: gemrtos_core.h:247
gs_ecb::ECB_NextECBAEL
struct gs_ecb* ECB_NextECBAEL
Pointer to the event associated with this (ie timeout)
Definition: gemrtos_core.h:119
INT32
unsigned INT32
Definition: gemrtos_core.h:62
ECB_IsValid
INT32 ECB_IsValid(GS_ECB *pevent)
Returns G_TRUE is pointer points to ECB.
Definition: monitor.c:109
Task::gu_TASK_Sleep
INT32 gu_TASK_Sleep(INT32 hours, INT32 minutes, INT32 seconds, INT32 ms)
Sleeps the current task the interval specified.
Definition: grtosuserfunctions.c:430
Task::gk_CreateTask
GS_TCB* gk_CreateTask(void *TaskCode, void *p_arg, void *StkBotton, unsigned int StkSize, unsigned int TCBType, INT64 TCBReadyPriority, INT64 TCBRunPriority, INT64 TCBDeadline, INT64 TCBPeriod, GS_LCB *TCB_RDY_LCB_Index, int TCB_Abort_w_Deadline, INT64 TCBInherPriority, int TCB_INTNumber)
Kernel Function: creates a new task initializing TCB features.
Definition: gemrtos_core.c:334
timepriority::__attribute__
INT64 i64 __attribute__((aligned(4)))
gs_pcb::PCB_NextPCB
struct gs_pcb* PCB_NextPCB
Pointer to the next free processor.
Definition: gemrtos_core.h:246
gs_ecb::ECBState
INT32 ECBState
Granted, Waiting, Free.
Definition: gemrtos_core.h:109
gs_scb::SCB_TaskCode
void* SCB_TaskCode
Pointer to the code of the signal.
Definition: gemrtos_core.h:399
gs_rrds::RRDS_NextRRDS
struct gs_rrds* RRDS_NextRRDS
Pointer to the next RRDS structure
Definition: gemrtos_core.h:363
RRDS::gk_RRDS_GetFree
GS_RRDS* gk_RRDS_GetFree(void)
Gets the pointer of a free RRDS from the free list.
Definition: gemrtos_core.c:230
Semaphore::gk_TASK_RESOURCE_UNWAIT
INT32 gk_TASK_RESOURCE_UNWAIT(G_RCB *presource, GS_ECB *pevent)
Unlinks the ECB waiting and timed set for waiting a semaphore.
Definition: sem.c:304
Task::gu_TASK_SUSPEND
INT32 gu_TASK_SUSPEND(GS_TCB *ptcb)
Change to waiting the state of a task.
Definition: grtosuserfunctions.c:515
Task::gu_SetTaskType
INT32 gu_SetTaskType(struct gs_tcb *ptcb, unsigned int type)
Set the type of a task.
Definition: grtosuserfunctions.c:180
GRTOS_MutexReleaseRegisterAddress
volatile INT32 GRTOS_MutexReleaseRegisterAddress
G_SCB_ARG
volatile INT32 G_SCB_ARG
Processor::gk_LCB_CheckInvertion
INT32 gk_LCB_CheckInvertion(void)
Checks if there is a processor that has to be interrupted to switch task and interruupt it all.
Definition: listfunctions.c:2496
gs_lcb::LCB_PrevLCBL
struct gs_lcb* LCB_PrevLCBL
Pointer to the next list ordered by priority.
Definition: gemrtos_core.h:214
T_MESSAGE_RESOURCE::LAST_MCB_ID
INT32 LAST_MCB_ID
Definition: gemrtos_core.h:269
G_DEBUG_SAMPLE_END_ENABLE
volatile int G_DEBUG_SAMPLE_END_ENABLE
Core::gk_Create_PCBs
INT32 gk_Create_PCBs(int Nmbr_PCB)
Reservs system memory to store the Processor Control Blocks of the system (PCB)
Definition: gemrtos_core.c:302
Task::gk_TCBASL_Link
INT32 gk_TCBASL_Link(GS_TCB *ptcb, GS_SCB *psignal)
Links SCB to TCB Associated Signal List.
Definition: listfunctions.c:1346
Task::gk_TCBPSL_GetSCB
GS_SCB* gk_TCBPSL_GetSCB(GS_TCB *ptcb, INT32 SignalType)
Returns pointer to the SCB in te TCBPSL.
Definition: listfunctions.c:2615
gs_tcb::TCB_PrevTCB
struct gs_tcb* TCB_PrevTCB
Pointer to previous TCB in the TCB list.
Definition: gemrtos_core.h:457
gs_ext_isr
Definition: gemrtos_core.h:87
gk_KERNEL_TASK_SUSPEND
void gk_KERNEL_TASK_SUSPEND(GS_TCB *ptcb)
Suspends the execution of the task pointed by ptcb.
Definition: grtos_kernel.c:470
GS_TCB
struct gs_tcb GS_TCB
Definition: gemrtos_core.h:50
Task::gk_TCB_Unlink
INT32 gk_TCB_Unlink(GS_TCB *ptcb)
Unlinks the TCB according to the list it is linked.
Definition: listfunctions.c:2550
mq.h
GRTOS Message queue definitions.
G_TASK_PRIORITY_DEFAULT
volatile INT64 G_TASK_PRIORITY_DEFAULT
Miscellaneous::gu_get_irq_status
INT32 gu_get_irq_status(void)
Return the status of the system IRQs.
Definition: grtosuserfunctions.c:735
gs_scb::SCBState
INT32 SCBState
STATE of the signal.
Definition: gemrtos_core.h:395
G_DEBUG_SAMPLE_BEGIN_ENABLE
volatile int G_DEBUG_SAMPLE_BEGIN_ENABLE
gs_sizeof_G_PCBTbl
volatile INT32 gs_sizeof_G_PCBTbl
gs_ext_isr::G_TCB_ISR
struct gs_tcb* G_TCB_ISR
Definition: gemrtos_core.h:88
Task::gk_TCBAEL_Link
INT32 gk_TCBAEL_Link(GS_ECB *pevent, GS_TCB *ptcb)
Links an ECB to the associated ECB list of TCB.
Definition: listfunctions.c:1284
gs_pcb::PCB_EXECTCB
struct gs_tcb* PCB_EXECTCB
Current task assigned to processor.
Definition: gemrtos_core.h:245
g_rgb::RCBGrantedPriority
TIMEPRIORITY RCBGrantedPriority
Lowest Priority of Current Granted Task.
Definition: gemrtos_core.h:314
gs_lcb::LCB_NextLCBFPL
struct gs_pcb* LCB_NextLCBFPL
Next free processor for this list.
Definition: gemrtos_core.h:215
gs_tcb::BLOCK_HASH
unsigned int BLOCK_HASH
BLOCK_HASH of the TCB: (GS_TCB *) + 1.
Definition: gemrtos_core.h:441
gs_ecb::ECBType
INT32 ECBType
Type of event control block.
Definition: gemrtos_core.h:110
Task::gu_SetTaskAbortwhenDeadline
INT32 gu_SetTaskAbortwhenDeadline(struct gs_tcb *ptcb, unsigned int abort_when_deadline)
Set if task should be aborted when misses a deadline.
Definition: grtosuserfunctions.c:372
gs_kcb::KCB_ROOT_LCBs
struct gs_lcb* KCB_ROOT_LCBs
pointer to the first LCB structure. Used for debugging purposes.
Definition: gemrtos_core.h:186
IsAListorNull
INT32 IsAListorNull(GS_LCB *plcb)
Definition: monitor.c:174
Configuration::gu_Set_Default_Task_List
INT32 gu_Set_Default_Task_List(GS_LCB *list)
Set the default list number for task created afterwards.
Definition: grtosuserfunctions.c:106
Task::gu_TASK_Kill
INT32 gu_TASK_Kill(GS_TCB *ptcb)
The task is eliminated and all the structures involved are return to the free lists.
Definition: grtosuserfunctions.c:498
gs_tcb::TCB_RDY_LCB_Index
struct gs_lcb* TCB_RDY_LCB_Index
pointer to the ready list that should be inserted
Definition: gemrtos_core.h:463
gt_time
unsigned long long gt_time
Definition: gemrtos_core.h:65
Semaphore::gk_TASK_RESOURCE_GRANT
INT32 gk_TASK_RESOURCE_GRANT(G_RCB *presource, GS_ECB *pevent)
Sets the granted and timed events when a semaphore is granted to a TCB.
Definition: sem.c:328
Task::gu_TASK_IS_BLOCKED
INT32 gu_TASK_IS_BLOCKED(GS_TCB *ptcb)
Return G_TRUE if task is waiting for a resource, G_FALSE otherwise.
Definition: grtosuserfunctions.c:532
G_TASK_LCB_DEFAULT
volatile GS_LCB* G_TASK_LCB_DEFAULT
g_rgb::queue
struct T_QUEUE_RESOURCE queue
is the queue resource, defined in mq.h
Definition: gemrtos_core.h:329
Signal::gk_ECBASL_Link
void gk_ECBASL_Link(GS_ECB *pevent, GS_SCB *psignal)
Links a SCB to the ECB Associated Signal List.
Definition: listfunctions.c:139
Signal::gk_RCBASL_Link
INT32 gk_RCBASL_Link(G_RCB *presource, GS_SCB *psignal)
Links a signal SCB to the resource RCB Associated Signal List.
Definition: listfunctions.c:737
Resource::gk_RCB_GetFree
G_RCB* gk_RCB_GetFree(void)
Unlinks an RCB from the RCBFL list and returns its pointer or NULL if no free RCB is available.
Definition: gemrtos_core.c:155
gs_rrds::RRDS_NEXT_RRDSs
struct gs_rrds* RRDS_NEXT_RRDSs
Fields for debugging.
Definition: gemrtos_core.h:368
Configuration::gu_Set_Default_Task_Type
INT32 gu_Set_Default_Task_Type(unsigned int type)
gu_Set_Default_Task_Type(unsigned int type) Set the default type of the task created.
gu_get_reserved_mutex_processor
INT32 gu_get_reserved_mutex_processor(void)
Event::gk_TCBAEL_Unlink
INT32 gk_TCBAEL_Unlink(GS_ECB *pevent)
Unlinks the ECB from the associated TCB.
Definition: listfunctions.c:1310
timepriority::i32
INT32 i32[2]
Definition: gemrtos_core.h:71
gk_KERNEL_TASK_START
void gk_KERNEL_TASK_START(void)
Start the execution of the tasks of the system.
Definition: grtos_kernel.c:352
Task::gu_TASK_RESUME
INT32 gu_TASK_RESUME(GS_TCB *ptcb)
Resume a task that it is in waiting state.
Definition: grtosuserfunctions.c:550
Miscellaneous::gu_Convert_Time
gt_time gu_Convert_Time(INT32 days, INT32 hours, INT32 minutes, INT32 seconds, INT32 ms)
Convert days,hours, minutes, seconds and miliseconds to system time unit.
Definition: grtosuserfunctions.c:717
LCB_IsValid
INT32 LCB_IsValid(GS_LCB *plcb)
Definition: monitor.c:167
sem.h
GRTOS Semaphore definitions.
Signal::gk_KCBASL_Unlink
INT32 gk_KCBASL_Unlink(GS_SCB *psignal)
Unlinks a SCG from the Associated Signal list of KCB.
Definition: listfunctions.c:507
queue_buffer
BUFFER CONTROL BLOCK FOR UNION WITH RRDS STRUCT.
Definition: mq.h:58
gt_tm
struct gs_tm gt_tm
gt_priority
unsigned long long gt_priority
Definition: gemrtos_core.h:66
Signal::gk_SCB_GetFree
GS_SCB* gk_SCB_GetFree(void)
Unlinks a SCB from free list and return its pointer.
Definition: gemrtos_core.c:194
Task::gk_TCBLowerPriorityThanTCB
INT32 gk_TCBLowerPriorityThanTCB(GS_TCB *ptcb1, GS_TCB *ptcb2)
Return G_TRUE if current priority of ptct1 is greater than the current priority of ptcb2,...
Definition: listfunctions.c:2307
List::gk_LCBLowerPriorityThanLCB
INT32 gk_LCBLowerPriorityThanLCB(GS_LCB *plcb1, GS_LCB *plcb2)
Return G_TRUE if plct1 is greater than plcb2, otherwise returns G_FALSE.
Definition: listfunctions.c:2284
gs_scb::SCBPriority
INT32 SCBPriority
Priority of the SCB when it is linked.
Definition: gemrtos_core.h:398
gs_tcb::TCB_TaskCode
void* TCB_TaskCode
Pointer to the Task Code.
Definition: gemrtos_core.h:454
gs_lcb::LCBState
INT32 LCBState
State of the List Control Block.
Definition: gemrtos_core.h:205
gs_tcb::TCBInherPriority
INT64 TCBInherPriority
Priority Inhered by granted resource.
Definition: gemrtos_core.h:446
g_rgb::@0::RCBState
INT32 RCBState
State of the Resource.
Definition: gemrtos_core.h:309
gk_KERNEL_TASK_SUSPEND_CURRENT
void gk_KERNEL_TASK_SUSPEND_CURRENT(void)
Suspends the execution of the current task and switch to Highest Priority Task.
Definition: grtos_kernel.c:502
Signal::gk_RCBASL_GetSCB
GS_SCB* gk_RCBASL_GetSCB(G_RCB *prcb, INT32 SignalType)
Returns the pointer to the SCB of a resource or NULL otherwise.
Definition: listfunctions.c:2770
Processor::gk_LCBFPL_Unlink
INT32 gk_LCBFPL_Unlink(int processorID)
Unlinks a PCB from the LCB Free Processor List.
Definition: listfunctions.c:702
G_Running
volatile INT32 G_Running
gk_TCBFL_Init
void gk_TCBFL_Init(void)
Task::gk_TCB_in_RCBGEL
GS_ECB* gk_TCB_in_RCBGEL(G_RCB *presource, GS_TCB *ptcb)
Returns the event of the TCB that grants the resource.
Definition: listfunctions.c:2081
gs_kcb::KCB_NextECBTL
struct gs_ecb* KCB_NextECBTL
Pointer to EVENT LIST of the Next Absolute Time.
Definition: gemrtos_core.h:158
Miscellaneous::gu_get_mutex_time
gt_time gu_get_mutex_time(void)
Return the time the mutex is granted in system time units.
Definition: grtosuserfunctions.c:785
gs_tcb::TCB_StackTop
GS_STK* TCB_StackTop
Botton Stack of the Task.
Definition: gemrtos_core.h:453
gs_kcb::KCB_ROOT_RRDSs
struct gs_rrds* KCB_ROOT_RRDSs
pointer to the first RRDS structure. Used for debugging purposes.
Definition: gemrtos_core.h:188
gk_Get_SCB
GS_SCB* gk_Get_SCB(void)
gs_rrds::BLOCK_HASH
unsigned int BLOCK_HASH
BLOCK_HASH of the RRDS: (GS_RRDS *) + 5.
Definition: gemrtos_core.h:359
GRTOS_InterruptEnableRegisterAddress
volatile INT32 GRTOS_InterruptEnableRegisterAddress
gk_Get_ECB
GS_ECB* gk_Get_ECB(void)
Core functions definitions.
Event::gk_RCBWEL_Unlink
void gk_RCBWEL_Unlink(GS_ECB *pevent)
Unlinks ECB from RCB waiting list.
Definition: listfunctions.c:1135
gs_addressof_G_PCBTbl
volatile void* gs_addressof_G_PCBTbl
gs_scb::SCB_NextSCB
struct gs_scb* SCB_NextSCB
Pointer to the next SCB linked.
Definition: gemrtos_core.h:401
gs_scb::SCB_NEXT_SCBs
struct gs_scb* SCB_NEXT_SCBs
Fields for debugging.
Definition: gemrtos_core.h:406
gs_lcb::LCB_NextTCBRUNL
struct gs_tcb* LCB_NextTCBRUNL
Pointer to the TCB list of running tasks.
Definition: gemrtos_core.h:211
Task::gk_TASK_PRIORITY_SET
INT32 gk_TASK_PRIORITY_SET(GS_TCB *ptcb, INT32 task_state)
Computes the current priority of the task.
Definition: listfunctions.c:2474
List::gk_LCBL_Link
INT32 gk_LCBL_Link(GS_LCB *plcb)
Inserts a RunList in LCB Runining list ordered by background list and then priority.
Definition: listfunctions.c:553
gk_ECBAEL_Link
INT32 gk_ECBAEL_Link(GS_ECB *pevent1, GS_ECB *pevent2)
gs_lcb::LCB_NEXT_LCBs
struct gs_lcb* LCB_NEXT_LCBs
Fields for debugging.
Definition: gemrtos_core.h:218
Configuration::gu_Set_Default_Task_Period
void gu_Set_Default_Task_Period(INT32 hours, INT32 minutes, INT32 seconds, INT32 ms)
Set the default periodo for task created afterwards.
Definition: grtosuserfunctions.c:151
gs_kcb::KCB_ROOT_TCBs
struct gs_tcb* KCB_ROOT_TCBs
roots for linked list of data structures
Definition: gemrtos_core.h:183
gk_PCBInit
void gk_PCBInit(void)
gs_ecb
GS_ECB Event Control Block structure.
Definition: gemrtos_core.h:107
T_MESSAGE_RESOURCE::MESSize
INT32 MESSize
Definition: gemrtos_core.h:265
gs_kcb::KCB_NUMBER_OF_PCBs
INT32 KCB_NUMBER_OF_PCBs
Number of PCB in the system.
Definition: gemrtos_core.h:169
gs_kcb::KCB_NUMBER_OF_RCBs
INT32 KCB_NUMBER_OF_RCBs
Number of RCB in the system.
Definition: gemrtos_core.h:171
gs_kcb::KCB_NextKCBASL
struct gs_scb* KCB_NextKCBASL
Pointer to Signal Associated List for KCB.
Definition: gemrtos_core.h:161
gs_mcb::MCB_PrevMCB
struct gs_mcb* MCB_PrevMCB
Definition: gemrtos_core.h:280
gs_ecb::malloc_address
void* malloc_address
Pointer memory address of the malloc block
Definition: gemrtos_core.h:111
ECBState_Valid
INT32 ECBState_Valid(unsigned int ecbstate)
Definition: monitor.c:203
gk_RST_MONITOR_HANDLER
void gk_RST_MONITOR_HANDLER(void)
Definition: monitor.c:53
gs_lcb::LCB_PREV_LCBs
struct gs_lcb* LCB_PREV_LCBs
Pointer to previous LCB structure. Used for debugging purposes.
Definition: gemrtos_core.h:219
RRDS::RRDS_IsValid
INT32 RRDS_IsValid(GS_RRDS *prrds)
Returns G_TRUE is pointer points to GS_RRDS.
Definition: monitor.c:158
grtos_irq_entry
void grtos_irq_entry(void)
gs_mcb
Definition: gemrtos_core.h:276
Task::gu_StartTaskwithOffset
INT32 gu_StartTaskwithOffset(struct gs_tcb *ptcb, unsigned int hours, unsigned int minutes, unsigned int seconds, unsigned int ms)
Activates the execution of a task. An offset can be configured.
Definition: grtosuserfunctions.c:311
gs_lcb
GS_LCB List Control Block.
Definition: gemrtos_core.h:203
gs_kcb
GS_KCB Kernel Control Block structure.
Definition: gemrtos_core.h:157
gs_tcb::TCB_TaskArg
void* TCB_TaskArg
Pointer to the argument of the first call.
Definition: gemrtos_core.h:455
gs_kcb::G_ISR_STACK
volatile INT32* G_ISR_STACK
IDLE and ISR tasks.
Definition: gemrtos_core.h:179
Task::GRTOS_Task_GetPendingSCB
void GRTOS_Task_GetPendingSCB(void)
Configures system to execute next pending signal. Call from switch routine.
Definition: grtos_kernel.c:835
Processor::gu_Get_CPU_ID
int gu_Get_CPU_ID(void)
Returns the ID of the current processor.
Definition: listfunctions.c:2877
Task::gu_SetTaskReadyPriority
INT32 gu_SetTaskReadyPriority(struct gs_tcb *ptcb, long long priority)
Set the ready priority of a task.
Definition: grtosuserfunctions.c:216
Validation::SCB_IsValid
INT32 SCB_IsValid(GS_SCB *pscb)
Returns G_TRUE is pointer points to SCB.
Definition: monitor.c:126
Interrupt::gu_SetTaskISR
INT32 gu_SetTaskISR(struct gs_tcb *ptcb, unsigned int irq_nbr)
Convert a task to a ISR associated to a Interrupt Number.
Definition: gemrtos_core.c:504
t_message_resource
struct g_rgb t_message_resource
Definition: gemrtos_core.h:56
Task::gk_CODE_IDLE_TASK
void gk_CODE_IDLE_TASK(void* pdata)
IDLE task. This code is executed when no task is ready. The processor is halted.
Definition: grtos_kernel.c:880
Task::gk_TCBWL_Link
INT32 gk_TCBWL_Link(GS_TCB *ptcb, unsigned int state)
Links a TCB in the waiting list.
Definition: listfunctions.c:1990
Signal::gk_SCB_Copy
GS_SCB* gk_SCB_Copy(GS_SCB *psignal)
Returns a pointer to a SCB with same values that psignal. Used when an associated signal has to be co...
Definition: listfunctions.c:1201
gs_pcb::PCBType
int PCBType
Type of the processor.
Definition: gemrtos_core.h:241
gs_ecb::BLOCK_HASH
unsigned int BLOCK_HASH
BLOCK_HASH of the ECB: (GS_ECB *) + 2.
Definition: gemrtos_core.h:108
Processor::gk_PCB_GetNextTCB
GS_TCB* gk_PCB_GetNextTCB(void)
Returns the next TCB to be executed by the current processor. If no task is requesting for execution,...
Definition: listfunctions.c:2333
Task::gk_TCBFL_Link
INT32 gk_TCBFL_Link(GS_TCB *ptcb)
Links a TCB to the Free TCB List removing associated and pending SCBs and ECBs.
Definition: listfunctions.c:1504
gk_RRDSFL_Link
INT32 gk_RRDSFL_Link(GS_RRDS *prrds)
Links a RRDS to the Free List.
Definition: listfunctions.c:2105
gs_tcb
gs_tcb Task Control Block (TCB) structure
Definition: gemrtos_core.h:439
Task::gk_TCBRDYL_Unlink
INT32 gk_TCBRDYL_Unlink(GS_TCB *ptcb)
Unlinks the TCB from the Ready Task List.
Definition: listfunctions.c:1740
gs_scb
GS_SCB Signal Control Block structure.
Definition: gemrtos_core.h:393
gs_tcb::TCB_NextTCBAEL
struct gs_ecb* TCB_NextTCBAEL
Pointer to linked list of waiting events of this task.
Definition: gemrtos_core.h:458
GS_PCB
struct gs_pcb GS_PCB
Definition: gemrtos_core.h:48
gs_pcb
GS_PCB Processor Control Block.
Definition: gemrtos_core.h:238
gs_lcb::BLOCK_HASH
unsigned int BLOCK_HASH
BLOCK_HASH of the LCB: (GS_LCB *) + 6.
Definition: gemrtos_core.h:204
GS_SCB
struct gs_scb GS_SCB
Definition: gemrtos_core.h:52
Interrupt::gk_ISR_COMPLETE
INT32 gk_ISR_COMPLETE(GS_TCB *ptcb)
Executed when Task finishes as ISR. If remains ready, then it will be not released next Interrupt eve...
Definition: gemrtos_core.c:447
gs_ecb::ECBValue
TIMEPRIORITY ECBValue
Occurrence Time of the event or Priority
Definition: gemrtos_core.h:112
Event::gk_ECBASL_Unlink
INT32 gk_ECBASL_Unlink(GS_ECB *pevent, GS_SCB *psignal)
Unlinks a signal SCB from the ECB Associated Signal List of and event.
Definition: listfunctions.c:203
gs_ecb::ECB_NextECBASL
struct gs_scb* ECB_NextECBASL
Pointer to the Linked list of signals.
Definition: gemrtos_core.h:120
Interrupt::gk_SetTaskISR
INT32 gk_SetTaskISR(struct gs_tcb *ptcb, unsigned int irq_nbr)
Convert a task to a ISR associated to a Interrupt Number in Kernal mode.
Definition: gemrtos_core.c:522
Task::gk_TCBPSL_Unlink
INT32 gk_TCBPSL_Unlink(GS_TCB *ptcb, GS_SCB *psignal)
Unlinks SCB from TCB Pending Signal List.
Definition: listfunctions.c:1606
gs_pcb::PCBID
int PCBID
Processor ID.
Definition: gemrtos_core.h:239
gs_kcb::G_IDLE_STACK
volatile GS_STK* G_IDLE_STACK
Definition: gemrtos_core.h:180
Time::gk_TIME_CALLBACK
void gk_TIME_CALLBACK(GS_ECB *pevent)
This function is called when a time event happened. It has to resolve according the event type.
Definition: grtosuserfunctions.c:829
gs_tm::tm_min
int tm_min
Definition: gemrtos_core.h:78
gs_kcb::__attribute__
struct gs_ext_isr KCB_ExtISR [ALT_NIRQ] __attribute__((aligned(4)))
Pointers to ISR TCBs for each interrupt number.
gs_lcb::LCBRunPriority
INT64 LCBRunPriority
Current Priority (-1 PRIORITY THERE IS NO TASK RUNNING.
Definition: gemrtos_core.h:208
gs_pcb::__attribute__
int* GRTOS_PROCESSOR_BASE __attribute__((aligned(4)))
Signal::gk_RCBASL_Unlink
INT32 gk_RCBASL_Unlink(G_RCB *presource, GS_SCB *psignal)
Unlinks a SCB of a signal from the RCB Associated Signal List of a resource.
Definition: listfunctions.c:802
gs_tm::tm_day
int tm_day
Definition: gemrtos_core.h:80
GS_KCB
struct gs_kcb GS_KCB
Definition: gemrtos_core.h:47
gs_ecb::ECB_PrevECB
struct gs_ecb* ECB_PrevECB
Pointer to linked list of waiting events of this event.
Definition: gemrtos_core.h:114
gs_ecb::ECB_NextECB
struct gs_ecb* ECB_NextECB
Pointer to linked list of waiting events of this event.
Definition: gemrtos_core.h:113
TCBState_Valid
INT32 TCBState_Valid(unsigned int tcbstate)
Definition: monitor.c:182
gs_kcb::KCB_NUMBER_OF_RRDSs
INT32 KCB_NUMBER_OF_RRDSs
Number of RRDS in the system.
Definition: gemrtos_core.h:174
gs_ext_isr::G_EXT_ISR_Timeout
gt_priority G_EXT_ISR_Timeout
Definition: gemrtos_core.h:90
g_rgb::RCBWaitingTimeout
TIMEPRIORITY RCBWaitingTimeout
Default waiting timeout.
Definition: gemrtos_core.h:315
G_TCB_CURRENT
volatile GS_STK G_TCB_CURRENT
gs_kcb::KCB_NUMBER_OF_ECBs
INT32 KCB_NUMBER_OF_ECBs
Number of ECB in the system.
Definition: gemrtos_core.h:170
T_SEMAPHORE_RESOURCE
Semaphore Resource.
Definition: sem.h:60
Task::gk_TCBWL_Unlink
INT32 gk_TCBWL_Unlink(GS_TCB *ptcb)
Unlinks the TCB from the waiting list.
Definition: listfunctions.c:2020
gs_rrds::RRDSGrantedTimeout
TIMEPRIORITY RRDSGrantedTimeout
Timeout for granting the resource
Definition: gemrtos_core.h:374
g_rgb::RCB_NEXT_RCBs
struct g_rgb* RCB_NEXT_RCBs
Fields for debugging.
Definition: gemrtos_core.h:323
TCBType_Valid
INT32 TCBType_Valid(unsigned int tcbtype)
Definition: monitor.c:193
G_TASK_PERIOD_DEFAULT
volatile INT64 G_TASK_PERIOD_DEFAULT
GS_RRDS
struct gs_rrds GS_RRDS
Definition: gemrtos_core.h:53
gs_tcb::TCBState
unsigned int TCBState
STATE of the task.
Definition: gemrtos_core.h:442
Task::gu_SetTaskDeadline
INT32 gu_SetTaskDeadline(struct gs_tcb *ptcb, unsigned int hours, unsigned int minutes, unsigned int seconds, unsigned int ms)
Set the deadline of the task for the next invocation.
Definition: grtosuserfunctions.c:255
GRTOS_Suspend_Task
void GRTOS_Suspend_Task(void)
Task::gk_TCBPSL_Link
INT32 gk_TCBPSL_Link(GS_TCB *ptcb, GS_SCB *psignal)
Link a SCB to TCB Pending Signal List.
Definition: listfunctions.c:1543
gs_rrds::RRDSGrantedPriority
TIMEPRIORITY RRDSGrantedPriority
Priority for granting the resource
Definition: gemrtos_core.h:376
gs_tm::tm_hour
int tm_hour
Definition: gemrtos_core.h:79
gs_rrds::RRDS_NextSCB
struct gs_scb* RRDS_NextSCB
Pointer to the Linked list of signals.
Definition: gemrtos_core.h:364
Time::gu_Get_Next_Occurrence_Time
gt_time gu_Get_Next_Occurrence_Time(void)
Returns the Next Occurrence Time.
Definition: listfunctions.c:2892
gs_ecb::ECB_PrevTCBAEL
struct gs_ecb* ECB_PrevTCBAEL
Pointer to the previous event of the same task
Definition: gemrtos_core.h:118
gs_tcb::TCBDeadline
INT64 TCBDeadline
Deadline of the task.
Definition: gemrtos_core.h:450
Resource::gk_TASK_IS_BLOCKED
INT32 gk_TASK_IS_BLOCKED(GS_TCB *ptcb)
Returns G_TRUE when TCB is blocked waiting for a resource.
Definition: listfunctions.c:2046
gs_ecb::ECB_AssocRCB
struct g_rcb* ECB_AssocRCB
Pointer to the resource associated with the event
Definition: gemrtos_core.h:116
Signal::gk_SCBAPSL_UnLink
INT32 gk_SCBAPSL_UnLink(GS_SCB *pscb_root, GS_SCB *pscb_pending)
Unlinks a pending signal from the root signal.
Definition: listfunctions.c:1244
gk_TCB_GetFree
GS_TCB* gk_TCB_GetFree(void)
Resource::gk_RCBWEL_Link
GS_ECB* gk_RCBWEL_Link(G_RCB *presource, GS_ECB *pevent)
Links an event ECB to the resource waiting list of RCB. If no ECB is given then a new ECB is obtained...
Definition: listfunctions.c:1054
T_QUEUE_RESOURCE
Message Queue Resource.
Definition: mq.h:41
g_kcb
GS_KCB g_kcb
gs_tcb::TCB_AssocPCB
unsigned int TCB_AssocPCB
Processor assigned this task (0 is no assigned)
Definition: gemrtos_core.h:461
g_rgb::malloc_address
void* malloc_address
Pointer memory address of the malloc block
Definition: gemrtos_core.h:312
TIMEPRIORITY
union timepriority TIMEPRIORITY
g_rgb::RCB_PREV_RCBs
struct g_rgb* RCB_PREV_RCBs
Pointer to previous RCB structure. Used for debugging purposes.
Definition: gemrtos_core.h:324
gs_mcb::MCB_EndMessage
void* MCB_EndMessage
Definition: gemrtos_core.h:282
gs_tm::tm_msec
int tm_msec
Definition: gemrtos_core.h:76
gs_rrds::@4::RRDS_State
INT32 RRDS_State
STATE of the RRDS.
Definition: gemrtos_core.h:360
RRSD::gk_RRDSASL_UnLink
INT32 gk_RRDSASL_UnLink(GS_RRDS *prrds, GS_SCB *psignal)
Unlinks SCB from RRDS Associated Signal List.
Definition: listfunctions.c:2207
G_TASK_TYPE_DEFAULT
volatile INT32 G_TASK_TYPE_DEFAULT
G_IRQ_ENABLED
volatile int G_IRQ_ENABLED
Check_list_TCBAEL_IsValid
INT32 Check_list_TCBAEL_IsValid(int cycles)
Definition: monitor.c:258
gs_tcb::TCB_StackBottom
GS_STK* TCB_StackBottom
Botton Stack of the Task.
Definition: gemrtos_core.h:452
Interrupt::gk_ISR_RELEASE
void gk_ISR_RELEASE(int irq_nbr)
Executed when an interrupt is triggered. It is called from gk_ENTRY_IRQ_HANDLER()
Definition: gemrtos_core.c:470
gs_tcb::TCB_NEXT_TCBs
struct gs_tcb* TCB_NEXT_TCBs
Fields for debugging.
Definition: gemrtos_core.h:469
g_rgb::RCBGrantedTimeout
TIMEPRIORITY RCBGrantedTimeout
Default granted timeout.
Definition: gemrtos_core.h:316
Task::gk_TCBASL_Unlink
INT32 gk_TCBASL_Unlink(GS_TCB *ptcb, GS_SCB *psignal)
Unlinks SCB from a TCB Associated Signal List.
Definition: listfunctions.c:1411
gs_tcb::TCB_INTNumber
int TCB_INTNumber
IRQ number if it is a ISR TCB.
Definition: gemrtos_core.h:462
GS_LCB
struct gs_lcb GS_LCB
Definition: gemrtos_core.h:49
Event::gk_ECB_List_Unlink
INT32 gk_ECB_List_Unlink(GS_ECB *pevent)
Unlinks all the structures linked to a ECB.
Definition: listfunctions.c:248
gs_tcb::TCBCurrentPriority
INT64 TCBCurrentPriority
Current priority of the task according it is ready or running.
Definition: gemrtos_core.h:448
Interrupt::gk_INIT_IRQ
void gk_INIT_IRQ(void)
Initializes the ISRs according the ISRs set by Nios HAL. It creates a TCB for each ISR and link it to...
Definition: gemrtos_core.c:399
gs_tcb::TCB_PrevISRTCB
struct gs_tcb* TCB_PrevISRTCB
Pointer to the previous TCB for the same ISR (when task is a ISR)
Definition: gemrtos_core.h:466
Task::gu_SetTaskRunPriority
INT32 gu_SetTaskRunPriority(struct gs_tcb *ptcb, long long priority)
Set the run priority of a task.
Definition: grtosuserfunctions.c:234
t_semaphore_resource
struct g_rgb t_semaphore_resource
Definition: gemrtos_core.h:57
Signal::gk_RRDSASL_GetSCB
GS_SCB* gk_RRDSASL_GetSCB(GS_RRDS *prrds, INT32 SignalType)
Returns pointer to the SCB linked in the RRDSASL list.
Definition: listfunctions.c:2647
GRTOS_InterruptDisableRegisterAddress
volatile INT32 GRTOS_InterruptDisableRegisterAddress
Miscellaneous::gu_Clock
gt_tm gu_Clock(gt_time ticks)
Convert to gt_tm structure a time in gt_time format (time in system time units)
Definition: grtosuserfunctions.c:803
Event::gk_ECBTL_Link
INT32 gk_ECBTL_Link(GS_ECB *pevent)
Links the ECB from the Time Event List.
Definition: listfunctions.c:355
gs_mcb::MCB_NextMCB
struct gs_mcb* MCB_NextMCB
Definition: gemrtos_core.h:279
gs_rrds::RRDSWaitingTimeout
TIMEPRIORITY RRDSWaitingTimeout
Timeout for waiting the resource
Definition: gemrtos_core.h:373
Task::gu_SetTaskPeriod
INT32 gu_SetTaskPeriod(struct gs_tcb *ptcb, unsigned int hours, unsigned int minutes, unsigned int seconds, unsigned int ms)
Set the task period for the next invocation.
Definition: grtosuserfunctions.c:283
Task::gu_TASK_Sleep_Time
INT32 gu_TASK_Sleep_Time(gt_time ticks)
Set event to sleep the current task for a certain number of clock ticks.
Definition: grtosuserfunctions.c:457
Semaphore::gk_TASK_RESOURCE_UNGRANT
INT32 gk_TASK_RESOURCE_UNGRANT(G_RCB *presource, GS_ECB *pevent)
Unlinks the granted and timed events of a granted task.
Definition: sem.c:371
INT64
unsigned long long INT64
Definition: gemrtos_core.h:61
Configuration::gu_Get_Default_Task_List
INT32 gu_Get_Default_Task_List(void)
Return the current default list number.
Definition: grtosuserfunctions.c:120
gs_scb::SCBType
INT32 SCBType
TYPE of the signal.
Definition: gemrtos_core.h:396
gs_rrds::malloc_address
void* malloc_address
Pointer memory address of the malloc block
Definition: gemrtos_core.h:362
gs_tcb::TCB_PREV_TCBs
struct gs_tcb* TCB_PREV_TCBs
Pointer to previous TCB structure. Used for debugging purposes.
Definition: gemrtos_core.h:470
gs_kcb::KCB_ROOT_ECBs
struct gs_ecb* KCB_ROOT_ECBs
pointer to the first ECB structure. Used for debugging purposes.
Definition: gemrtos_core.h:184
gk_ENTRY_IRQ_HANDLER
void gk_ENTRY_IRQ_HANDLER(void)
Executes the ISR of GRTOS.
Definition: grtos_kernel.c:186
queue
struct T_QUEUE_RESOURCE queue
T_MESSAGE_RESOURCE::MES_FirstMCB
struct gs_mcb* MES_FirstMCB
Definition: gemrtos_core.h:267
Processor::gk_LCBFPL_Link
INT32 gk_LCBFPL_Link(int processorID)
Links a PCB to the LCB Free Processor List of foreground list of the processor.
Definition: listfunctions.c:659
Task::gk_PCB_GetCurrentTCB
GS_TCB* gk_PCB_GetCurrentTCB(void)
Returns the task that the current processor was executing.
Definition: listfunctions.c:2262
g_rgb::message
struct T_MESSAGE_RESOURCE message
is the message resource structure
Definition: gemrtos_core.h:328
Kernel::gk_KCBASL_GetSCB
GS_SCB* gk_KCBASL_GetSCB(INT32 SignalType)
Returns a pointer to the SCB linked to the KCBASL with the same SignalType.
Definition: listfunctions.c:2678
gs_kcb::KCB_ROOT_RCBs
struct g_rcb* KCB_ROOT_RCBs
pointer to the first RCB structure. Used for debugging purposes.
Definition: gemrtos_core.h:185
gs_offsetof_PCB_IDLETCB
volatile INT32 gs_offsetof_PCB_IDLETCB
Core::gk_Get_LCB
GS_LCB* gk_Get_LCB(void)
Creates a LCB and returns its pointer.
Definition: gemrtos_core.c:264
Task::gu_SetTaskList
INT32 gu_SetTaskList(struct gs_tcb *ptcb, struct gs_lcb *plcb)
Set the list of a task.
Definition: grtosuserfunctions.c:198
gs_rrds::RRDSWaitingPriority
TIMEPRIORITY RRDSWaitingPriority
Priority for waiting the resource
Definition: gemrtos_core.h:375
gs_lcb::LCB_NextTCBRDYL
struct gs_tcb* LCB_NextTCBRDYL
Pointer to the TCB of the Highest Priority Task.
Definition: gemrtos_core.h:212
gs_offsetof_PCB_EXECTCB
volatile INT32 gs_offsetof_PCB_EXECTCB
gs_kcb::KCB_NUMBER_OF_TCBs
INT32 KCB_NUMBER_OF_TCBs
Pointer to PCBs dynamic array.
Definition: gemrtos_core.h:168
gs_tcb::malloc_address
void* malloc_address
Pointer memory address of the malloc block
Definition: gemrtos_core.h:444
T_MESSAGE_RESOURCE
Definition: gemrtos_core.h:264
gs_tcb::TCBReadyPriority
INT64 TCBReadyPriority
Priority of the Task when Ready.
Definition: gemrtos_core.h:445
Processor::gk_SetLowestProcessor
INT32 gk_SetLowestProcessor(void)
Sets the Lowest Processor register in GRTOS Controller.
Definition: listfunctions.c:2386
g_rgb::RCB_NextRCB
struct g_rcb* RCB_NextRCB
Pointer to link resources in free list.
Definition: gemrtos_core.h:319
GS_ECB
struct gs_ecb GS_ECB
Definition: gemrtos_core.h:51
gs_ecb::ECB_AssocTCB
struct gs_tcb* ECB_AssocTCB
Pointer to the task associated with the event
Definition: gemrtos_core.h:115
Task::gk_TCBRUNL_Unlink
INT32 gk_TCBRUNL_Unlink(GS_TCB *ptcb)
Unlinks TCB from Running List.
Definition: listfunctions.c:1915
Configuration::gu_Set_Default_Task_Priority
void gu_Set_Default_Task_Priority(INT32 level, INT32 priority)
Set the default priority for task created afterwards. Priority is assigned with an INT32 level and an...
Definition: grtosuserfunctions.c:133
Semaphore::gk_TASK_RESOURCE_WAIT
INT32 gk_TASK_RESOURCE_WAIT(G_RCB *presource, GS_ECB *pevent)
Sets the waiting and timed event for waiting the semaphore.
Definition: sem.c:262
g_rgb::RCBPriority
TIMEPRIORITY RCBPriority
Priority of the resource.
Definition: gemrtos_core.h:313
Task::gk_TCBRDYL_Link
INT32 gk_TCBRDYL_Link(GS_TCB *ptcb)
Links the TCB in the Ready Task List sorted by its priority.
Definition: listfunctions.c:1653
Time::gk_FROZEN_CALLBACK
void gk_FROZEN_CALLBACK(void)
This function is called when a frozzen event happened.
Definition: grtosuserfunctions.c:924
gs_kcb::KCB_NextTCBWL
struct gs_tcb* KCB_NextTCBWL
Pointer to the linked list of the TCB of Waiting Tasks.
Definition: gemrtos_core.h:159
gs_pcb::PCBState
int PCBState
State of the PCB : GS_FREE_PROCESSOR, GS_RUNNING_PROCESSOR.
Definition: gemrtos_core.h:240
Processor::gk_SetNextTimeProcessor
INT32 gk_SetNextTimeProcessor(void)
Sets the Next Time Processor register in GRTOS Controller.
Definition: listfunctions.c:2408
gs_scb::SCB_TaskArg
void* SCB_TaskArg
Pointer to the argument of the signal.
Definition: gemrtos_core.h:400
gs_lcb::malloc_address
void* malloc_address
Pointer memory address of the malloc block
Definition: gemrtos_core.h:207
g_rgb
G_RCB Resource Request Data Structure.
Definition: gemrtos_core.h:306
gs_ecb::ECB_NEXT_ECBs
struct gs_ecb* ECB_NEXT_ECBs
Fields for debugging.
Definition: gemrtos_core.h:124
gs_tcb::TCB_Abort_w_Deadline
int TCB_Abort_w_Deadline
True if task should be aborted when deadline, false otherwise.
Definition: gemrtos_core.h:464
Signal::gk_KCBASL_Link
INT32 gk_KCBASL_Link(GS_SCB *psignal)
Links a SCG to the Associated Signal list of KCB.
Definition: listfunctions.c:443
gs_tcb::TCB_NextISRTCB
struct gs_tcb* TCB_NextISRTCB
Pointer to the next TCB for the same ISR (when task is a ISR)
Definition: gemrtos_core.h:465
gs_rrds
GS_RRDS Resource Request Data Structure.
Definition: gemrtos_core.h:357
gs_ecb::ECB_NextTCBAEL
struct gs_ecb* ECB_NextTCBAEL
Pointer to the next event of the same task
Definition: gemrtos_core.h:117
g_rgb::RCB_NextRCBWEL
struct gs_ecb* RCB_NextRCBWEL
Pointer to linked list of waiting events of this event.
Definition: gemrtos_core.h:317
Task::gk_TASK_Kill
INT32 gk_TASK_Kill(GS_TCB *ptcb)
Destroys a task and return the data structure to the TCB free list.
Definition: listfunctions.c:2855
gk_KERNEL_TASK_COMPLETE
void gk_KERNEL_TASK_COMPLETE(void)
This function is executed when a task finishes its execution.
Definition: grtos_kernel.c:411
Time::gu_get_frozen_threshold
gt_time gu_get_frozen_threshold(void)
Returns the value in the frozen threshold register (R_FRZ_TM_THR)
Definition: grtosuserfunctions.c:770
gs_kcb::KCB_NextLCBL
struct gs_lcb* KCB_NextLCBL
Pointer to the lowest priority run list.
Definition: gemrtos_core.h:160
T_MESSAGE_RESOURCE::MES_LastMCB
struct gs_mcb* MES_LastMCB
Definition: gemrtos_core.h:268
Task::gk_TCB_List_Unlink
INT32 gk_TCB_List_Unlink(GS_TCB *ptcb)
Unlinks the TCB from events and signals and links them to the free lists respectively.
Definition: listfunctions.c:1460
PCB_IsValid
INT32 PCB_IsValid(GS_PCB *ppcb)
Definition: monitor.c:83
GS_STK
unsigned int GS_STK
Definition: gemrtos_core.h:63
gk_INIT_KERNEL
void gk_INIT_KERNEL(void)
Routine execute BEFORE the main() function, ONLY by PROCESSOR 1.
Definition: grtos_kernel.c:552
timepriority
Definition: gemrtos_core.h:69
G_SCB_PENDING
volatile INT32 G_SCB_PENDING
gs_mcb::MCB_RlsCount
INT32 MCB_RlsCount
Definition: gemrtos_core.h:284
ECBType_Valid
INT32 ECBType_Valid(unsigned int ecbtype)
Definition: monitor.c:213
Configuration::gu_Get_Default_Task_Type
INT32 gu_Get_Default_Task_Type(void)
Return the default type assigned to new tasks.
Definition: grtosuserfunctions.c:91
Task::gk_TCBASL_GetSCB
GS_SCB* gk_TCBASL_GetSCB(GS_TCB *ptcb, INT32 SignalType)
Returns the pointer to the SCB associated to a task, NULL otherwise.
Definition: listfunctions.c:2709
Task::gk_TASK_GRANTED_PRIORITY_GET
INT64 gk_TASK_GRANTED_PRIORITY_GET(GS_TCB *ptcb)
Determine the priority of a taks according to the resources granted.
Definition: listfunctions.c:2912
gs_kcb::KCB_NUMBER_OF_LCBs
INT32 KCB_NUMBER_OF_LCBs
Number of LCB in the system.
Definition: gemrtos_core.h:172
gs_tcb::TCB_NextTCB
volatile struct gs_tcb* TCB_NextTCB
Pointer to next TCB in the TCB list.
Definition: gemrtos_core.h:456
T_MESSAGE_RESOURCE::MESEntries
INT32 MESEntries
Definition: gemrtos_core.h:266
gs_mcb::MCBState
INT32 MCBState
Definition: gemrtos_core.h:277
g_rgb::RCBCount
INT32 RCBCount
Counter for RCB.
Definition: gemrtos_core.h:311
Event::gk_RCBGEL_Unlink
void gk_RCBGEL_Unlink(GS_ECB *pevent)
Unlinks ECB from RCB granted list.
Definition: listfunctions.c:1012
Task::gk_TASK_STK_Init
INT32 gk_TASK_STK_Init(GS_TCB *ptcb)
Initializes the Task Stack acording to the TCB parameters.
Definition: listfunctions.c:2805
G_SCB_CODE
volatile INT32 G_SCB_CODE
g_rgb::RCB_NextRCBGEL
struct gs_ecb* RCB_NextRCBGEL
Pointer to the linked highest priority event.
Definition: gemrtos_core.h:318
Semaphore::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)
Creates the structure to sopport a resource from a task.
Definition: sem.c:437
GRTOS_MutexRequestRegisterAddress
volatile INT32 GRTOS_MutexRequestRegisterAddress
Resource::gk_RCBFL_Link
INT32 gk_RCBFL_Link(G_RCB *presource)
Links the RCB of a resource to Free List.
Definition: listfunctions.c:851
gs_tcb::TCBType
unsigned int TCBType
TYPE of the task.
Definition: gemrtos_core.h:443
gs_lcb::LCB_NextLCBL
struct gs_lcb* LCB_NextLCBL
Pointer to the next list ordered by priority.
Definition: gemrtos_core.h:213
gs_ecb::ECB_PREV_ECBs
struct gs_ecb* ECB_PREV_ECBs
Pointer to previous TCB structure. Used for debugging purposes.
Definition: gemrtos_core.h:125
gs_tcb::TCB_NextTCBPSL
struct gs_scb* TCB_NextTCBPSL
Pointer to signals waiting to execute.
Definition: gemrtos_core.h:460
Event::gk_ECBFL_Link
INT32 gk_ECBFL_Link(GS_ECB *pevent)
Link ECB to Free List. Removes the signals from ECB.
Definition: listfunctions.c:324
gs_tcb::TCB_StackPointer
GS_STK* TCB_StackPointer
Pointer to current top of stack.
Definition: gemrtos_core.h:451
GS_MCB
struct gs_mcb GS_MCB
Definition: gemrtos_core.h:55
gs_ecb::ECB_RRDS
struct gs_rrds* ECB_RRDS
Pointer to the resource request structure or MCB.
Definition: gemrtos_core.h:121
Task::gu_GetTask
void* gu_GetTask(void *TaskCode, void *p_arg, void *StkBotton, unsigned int StkSize)
Return a pointer to a TCB for a new task.
Definition: grtosuserfunctions.c:393
Signal::gu_signal_create
GS_SCB* gu_signal_create(INT32 Type, INT32 Priority, void *pxcb, void *Signal_Code, void *Signal_Arg)
Creates an associated SCB to a structure according to the Type.
Definition: grtosuserfunctions.c:583
gs_kcb::KCB_NUMBER_OF_SCBs
INT32 KCB_NUMBER_OF_SCBs
Number of SCB in the system.
Definition: gemrtos_core.h:173
gk_Get_RRDS
GS_RRDS* gk_Get_RRDS(void)
Resource::gk_RCBGEL_Link
GS_ECB* gk_RCBGEL_Link(G_RCB *presource, GS_ECB *pevent)
Links ECB to RCB granted list and return pointer to the ECB linked.
Definition: listfunctions.c:935
gs_scb::SCB_NextSCBAPSL
struct gs_scb* SCB_NextSCBAPSL
Pointer to the next pending SCB lined.
Definition: gemrtos_core.h:402
gs_tm
Definition: gemrtos_core.h:75
gs_mcb::MCB_ID
INT32 MCB_ID
Definition: gemrtos_core.h:283
Task::gk_TASK_INHERENCE_PRIORITY_SET
INT32 gk_TASK_INHERENCE_PRIORITY_SET(GS_TCB *ptcb)
Sets the inherence priority of TCB according the priority of granted resources.
Definition: listfunctions.c:2435
g_rgb::BLOCK_HASH
unsigned int BLOCK_HASH
BLOCK_HASH of the RCB: (GS_RCB *) + 3.
Definition: gemrtos_core.h:308
gs_tcb::TCBPeriod
INT64 TCBPeriod
Period of the task.
Definition: gemrtos_core.h:449
Event::gk_ECB_GetFree
GS_ECB* gk_ECB_GetFree(void)
Returns a pointer to a Free ECB, NULL if there is not ECB available.
Definition: gemrtos_core.c:107
gk_ENTRY_SIGNAL_RETURN
void gk_ENTRY_SIGNAL_RETURN(void)
Return from Signal:
Definition: grtos_kernel.c:308
gs_tcb::TCBRunPriority
INT64 TCBRunPriority
Priority when it is executed.
Definition: gemrtos_core.h:447
gs_scb::malloc_address
void* malloc_address
Pointer memory address of the malloc block
Definition: gemrtos_core.h:397
GRTOS_S_PROCESSOR1_IRQ
volatile int GRTOS_S_PROCESSOR1_IRQ
TCB_IsValid
INT32 TCB_IsValid(GS_TCB *ptcb)
Definition: monitor.c:76
Miscellaneous::gu_get_now
gt_time gu_get_now(void)
Return the system time in system time units.
Definition: grtosuserfunctions.c:751
g_rgb::RCB_NextRCBASL
struct gs_scb* RCB_NextRCBASL
Pointer to the Linked list of signals.
Definition: gemrtos_core.h:320
G_RCB
struct g_rgb G_RCB
Definition: gemrtos_core.h:54
Task::gk_TASK_RELEASE
INT32 gk_TASK_RELEASE(GS_TCB *ptcb)
Release a new invocation of the task. Preserves the Associated signal list. If task is not completed,...
Definition: listfunctions.c:897
gs_mcb::MCB_StartMessage
void* MCB_StartMessage
Definition: gemrtos_core.h:281
gs_tcb::TCB_NextTCBASL
struct gs_scb* TCB_NextTCBASL
Pointer to the Linked list of signals.
Definition: gemrtos_core.h:459
Resource::RCB_IsValid
INT32 RCB_IsValid(void *prcb)
Returns G_TRUE is pointer points to RCB.
Definition: monitor.c:142
gs_mcb::MCBCount
INT32 MCBCount
Definition: gemrtos_core.h:278
Semaphore::gk_TASK_RESOURCE_DESTROY
INT32 gk_TASK_RESOURCE_DESTROY(GS_ECB *pevent)
Destroy the events associated to a task and semaphore and returns them to the free lists.
Definition: sem.c:486
gs_ext_isr::G_EXT_INT_Count
INT32 G_EXT_INT_Count
Definition: gemrtos_core.h:89
gs_tm::tm_year
int tm_year
Definition: gemrtos_core.h:81
GRTOS_Start_Task
void GRTOS_Start_Task(void)
gs_scb::BLOCK_HASH
unsigned int BLOCK_HASH
BLOCK_HASH of the SCB: (GS_SCB *) + 4.
Definition: gemrtos_core.h:394
fpuart
FILE* fpuart[G_NUMBER_OF_PCB]
gs_rrds::@4::RRDS_Type
INT32 RRDS_Type
TYPE of the RRDS.
Definition: gemrtos_core.h:361
g_rgb::semaphore
struct T_SEMAPHORE_RESOURCE semaphore
is the semaphore resource structure
Definition: gemrtos_core.h:327
gk_Get_RCB
G_RCB* gk_Get_RCB(void)
Signal::gk_RRDSASL_Link
INT32 gk_RRDSASL_Link(GS_RRDS *prrds, GS_SCB *psignal)
Links SCB to RRDS Associated Signal List.
Definition: listfunctions.c:2143
Signal::gk_SCBFL_Link
INT32 gk_SCBFL_Link(GS_SCB *psignal)
Links a SCB to the Free List.
Definition: listfunctions.c:1173
gs_scb::SCB_PREV_SCBs
struct gs_scb* SCB_PREV_SCBs
Pointer to previous SCB structure. Used for debugging purposes.
Definition: gemrtos_core.h:407
gs_lcb::LCBType
INT32 LCBType
Type of the List Control Block.
Definition: gemrtos_core.h:206
Task::gk_TCBRUNL_Link
INT32 gk_TCBRUNL_Link(GS_TCB *ptcb)
Links the TCB to the Run Task List.
Definition: listfunctions.c:1786
G_IRQ_PENDING
volatile int G_IRQ_PENDING
Event::gk_ECBAEL_Remove
INT32 gk_ECBAEL_Remove(GS_ECB *pevent)
Unlinks the pevent from the associated ECB list.
Definition: listfunctions.c:102
Event::gk_ECBTL_Unlink
INT32 gk_ECBTL_Unlink(GS_ECB *pevent)
Unlinks the ECB from the Time Event List.
Definition: listfunctions.c:405
List::gk_LCBL_UnLink
INT32 gk_LCBL_UnLink(GS_LCB *plcb)
Unlinks the LCB from the LCB List.
Definition: listfunctions.c:623
gs_scb::SCB_AssocXCB
void* SCB_AssocXCB
Pointer to the data structure root of the SCBASL.
Definition: gemrtos_core.h:403
Event::gk_ECBASL_GetSCB
GS_SCB* gk_ECBASL_GetSCB(GS_ECB *pecb, INT32 SignalType)
Returns a pointer to the GS_SCB in the associated GS_SCBs of an event or NULL if any.
Definition: listfunctions.c:2740
gs_rrds::RRDS_AsocECB
struct gs_ecb* RRDS_AsocECB
Pointer to ECB the RRDS is linked to.
Definition: gemrtos_core.h:365
gs_tm::tm_sec
int tm_sec
Definition: gemrtos_core.h:77
grtosdefinitions.h
GRTOS general definition.
gs_pcb::PCB_IDLETCB
struct gs_tcb* PCB_IDLETCB
Pointer to the TCB of the IDLE Task.
Definition: gemrtos_core.h:244
Resource::gk_RESOURCE_ECB_KILL_CALLBACK
void gk_RESOURCE_ECB_KILL_CALLBACK(GS_ECB *pevent)
This function is called when a resource event is kill. It has to resolve according the event type.
Definition: grtosuserfunctions.c:896
gs_rrds::RRDS_PREV_RRDSs
struct gs_rrds* RRDS_PREV_RRDSs
Pointer to previous RRDS structure. Used for debugging purposes.
Definition: gemrtos_core.h:369
Signal::gk_SCBAPSL_Link
void gk_SCBAPSL_Link(GS_SCB *pscb_root, GS_SCB *pscb_pending)
Links a pending signal to the root signal to create a signal list.
Definition: listfunctions.c:1228
gs_offsetof_TCB_StackPointer
volatile INT32 gs_offsetof_TCB_StackPointer
g_rgb::@0::RCBType
INT32 RCBType
Type of resource control block.
Definition: gemrtos_core.h:310
Signal::gu_signal_destroy
INT32 gu_signal_destroy(GS_SCB *pscb)
Unlink the signal associated to a control block.
Definition: grtosuserfunctions.c:642
gs_lcb::LCBExclusion
INT32 LCBExclusion
Maximum number of running task (0 for no limit)
Definition: gemrtos_core.h:210
gs_kcb::KCB_ROOT_SCBs
struct gs_scb* KCB_ROOT_SCBs
pointer to the first SCB structure. Used for debugging purposes.
Definition: gemrtos_core.h:187
gs_lcb::LCBCurrentRunning
INT32 LCBCurrentRunning
Current number of running tasks.
Definition: gemrtos_core.h:209
gk_MONITOR_FIFO_SAMPLE
void gk_MONITOR_FIFO_SAMPLE(int data)