INOS
inoskernel.h
Go to the documentation of this file.
1//******************************************************************************
26//******************************************************************************
27
28#if !defined( INC_INOSKERNEL_H )
29#define INC_INOSKERNEL_H
30
31//------------------------------------------------------------------------------
32// includes
33//------------------------------------------------------------------------------
34
35#include <atomic>
36#include <inoslib.h>
37#include <inos_ccl.h>
38
39//------------------------------------------------------------------------------
41//------------------------------------------------------------------------------
42
43//------------------------------------------------------------------------------
44// forward declarations
45//------------------------------------------------------------------------------
46
47class CINOSSync;
48
49//------------------------------------------------------------------------------
50// functions
51//------------------------------------------------------------------------------
52
53#ifdef INOS_TIMINIG_CHECKS
55 const char* apFailureText, uint32 auDiff, uint32 auMaxAllowed);
56#endif
57void PriorityInversionDetected(const char* apMsg, CINOSTask* apTask, const char* apSyncObjName, uint32 auType);
58
59//--------------------------------------------------------------------------
60// global variables
61//--------------------------------------------------------------------------
62
63#ifdef INOS_TIMINIG_CHECKS_DISABLEINTERRUPTS
64extern uint32 g_uMaxIrqDisabledTicks;
65#endif
66
67void INOSEnableInterrupts(uint32 aMask);
70
71#ifdef INOS_MULTICORE
72uint32 INOSCoreLock();
74#else
75inline uint32 INOSCoreLock()
76{
77 return INOSDisableInterrupts();
78}
79inline uint32 INOSCoreLock(SINOSCoreLock& aLock)
80{
81 return INOSDisableInterrupts();
82}
83#endif
84
85#ifdef INOS_MULTICORE
86void INOSCoreUnlock(uint32 auMsr);
88#else
89inline void INOSCoreUnlock(uint32 auMsr)
90{
92}
93inline void INOSCoreUnlock(SINOSCoreLock& aLock, uint32 auMsr)
94{
96}
97#endif
98uint32 INOSSpinLock(uint32* apLock);
99void INOSSpinUnlock(uint32* apLock);
100
101//-----------------------------------------------------------------------------
102//
103#ifndef _MSC_VER
104 #define INOSOptimizationBarrier() \
105 asm volatile ("" ::: "memory");
106#else
107 #define INOSOptimizationBarrier()
108#endif
109
110void INOSMemoryBarrier();
111
114void INOSInvalidateCaches(void* aAddress, uint32 aNumber);
115
119void INOSFlushDCache(void* aAddress, uint32 aNumber);
123void INOSInvalidateDCache(void* aAddress, uint32 aNumber);
124
125//------------------------------------------------------------------------------
126//--- class CSafeTaskList -----------------------------------------------------
127//------------------------------------------------------------------------------
128
132class CTaskListLocker
133{
134 public:
137};
138
139
143class CSafeTaskList
144{
148 public:
157 long GetItemsInContainer();
158};
159
160//------------------------------------------------------------------------------
161//--- class CINOSIrqLock ------------------------------------------------------
162//------------------------------------------------------------------------------
163
165class CINOSIrqLock
166{
167 //--- user interface ---------------------------------------------------
168
169 // constructor / destructor
170 public :
171 // disable interrupts
172 CINOSIrqLock() {
174 m_bLocked = true;
175 }
176 // enable interrupts
177 ~CINOSIrqLock() {
178 if (m_bLocked) {
180 }
181 }
182 // enable interrupts early (before destructor is called)
183 void EarlyUnlock() {
184 if (m_bLocked) {
186 m_bLocked = false;
187 }
188 }
189
190 //--- internals --------------------------------------------------------
191
192 // protected members
193 protected :
194 uint32 m_uMsr;
195 bool m_bLocked;
196};
197
198//------------------------------------------------------------------------------
199//--- class CINOSCoreLock ------------------------------------------------------
200//------------------------------------------------------------------------------
201
203class CINOSCoreLock
204{
205 public :
206 // lock core
209 {
211 }
212 // release core lock
214 if( m_pCoreLock ) {
216 }
217 }
218 void EarlyUnlock() {
219 if( m_pCoreLock ) {
221 m_pCoreLock = nullptr;
222 }
223 }
224
225 private :
227 uint32 m_uMsr;
228};
229
230//------------------------------------------------------------------------------
232//------------------------------------------------------------------------------
233
234//------------------------------------------------------------------------------
235// class definition
236//------------------------------------------------------------------------------
237//
239{
240 //--- user interface -------------------------------------------------------
241
242 // public member functions
243 public :
244
245 //----------------------------------------------------------------------
247 //----------------------------------------------------------------------
248
252 enum {
257 eCnsTimeSliceNone = 0xffffffff,
259 eCnsLogEntriesMin = 2048,
260 eCnsLogEntriesMax = 16*1024*1024,
261 eCnsLogEntriesSmall = 2048,
262 eCnsLogEntriesMedium = 65536, // requires 500 KByte
263 eCnsLogEntriesLarge = 131072 // requires 1 MByte
264 };
265
269 enum {
271 eLogTypeSuspend = 1,
272 eLogTypeResume = 2,
278 eLogTypeEnd = 15,
279 };
280
298 static constexpr uint32 AsciiToUint32(const char (&s)[5]) {
299 #ifdef INOS_BIG_ENDIAN
300 return (uint32(s[0]) << 24) | (uint32(s[1]) << 16) | (uint32(s[2]) << 8) | uint32(s[3]);
301 #else
302 return (uint32(s[3]) << 24) | (uint32(s[2]) << 16) | (uint32(s[1]) << 8) | uint32(s[0]);
303 #endif
304 }
305 #if defined(INOS_TASK_LOGGER_EXTENDED)
306 static constexpr uint64 AsciiToUint64(const char (&s)[9]) {
307 return *((uint64*) s);
308 }
309 #endif
310
314 enum {
315 eTskStateReady = 0,
317 };
318
322 enum {
323 eFlgCommandNone = 0x00000000,
324 eFlgCommandForeign = 0x00000001,
325 eFlgCommandShutdown = 0x00000002,
326 };
327
328 //----------------------------------------------------------------------
330 //----------------------------------------------------------------------
331
343
363
367 friend void Goodbye();
368
374 friend void Resume(class CINOSTask* apTask, uint32 auFlags);
375
382
389 friend void Ready(class CINOSTask* apTask, uint32 auFlags);
390
398
404
412 friend void Schedule();
413
423
428 friend void Relinquish();
429
433 friend void Exit(uint32 auExitCode);
434
441
445 friend class CINOSTask* ActualTask();
446
456 virtual void AddIdle(void* apFunction, void* apObject);
457
461 void AddFinalyse(void* apFunction, void* apObject);
462
469
496 { return m_iKernelState; };
497
498 //----------------------------------------------------------------------
500 //----------------------------------------------------------------------
501
505 friend void Preemption();
506
507 //--- internals --------------------------------------------------------
508
509 friend class CINOSHwTarget;
510 friend class CINOSTask;
511 friend class CSafeTaskList;
512 friend void _suspend();
513
514 // protected methods
515 public :
518 CINOSKernel ();
519
521 virtual ~CINOSKernel () {}
522
524 void ReadConfigSettings();
525
528 void Idle () INOS_COMPILE_NONOPTIMIZED;
529
532 void DoIdle ();
533
536 void Main ();
537
540 static void Create ();
541
544 static void Startup ();
545
548 void Shutdown();
549
552 void Cleanup();
553
554 #if defined(INOS_TASK_LOGGER_EXTENDED)
555
562 uint64 DoLogging(uint8 aeLogType, uint8 aeSubType, uint64 auData) INOS_OCRAM;
563
569 inline uint64 DoLogging(uint8 aeLogType, class CINOSTask* apTask) INOS_OCRAM
570 {
571 return DoLogging(aeLogType, 0, uintptr(apTask));
572 }
573 inline uint64 DoLogging(uint8 aeLogType, uint8 aeSubType, class CINOSTask* apTask) INOS_OCRAM
574 {
576 }
577
578 #else
579
585 uint64 DoLogging(uint8 aeLogType, uint32 auData);
586
592 inline uint64 DoLogging(uint8 aeLogType, class CINOSTask* apTask)
593 {
595 }
596
597 #endif
598
602 inline CINOSTask* ActualLoggedTask() INOS_OCRAM
603 {
604 return (CINOSTask*) m_uLogActualTask;
605 }
606
609 void Register ();
610
615 void AddTask(CINOSTask* apTask, uint32 auParentId = 0);
616
621 {
622 // any task ready ?
623 if (0 == m_uReady)
624 // no -> return idle
625 return m_pTskIdle;
626 else
627 // yes -> get highest prio
629 }
630
635 virtual uint32 CreateTask(CINOSTask* apTask)
636 { return 0; };
637
641
645
650 void AttachTask(CINOSTask* apTask, uint32 auParentId = 0);
651
655
659 virtual void DestroyTask(CINOSTask* apTask)
660 { };
661
665 virtual void SetTaskName(CINOSTask* apTask)
666 { };
667
672
675 void ShutdownChildren();
676
679 {
680 return apTask == m_pTskMain;
681 }
684 {
685 return &m_sSyncStartup;
686 }
688 void SetStartupCallResult(class CMcResult* apResult);
690 class CMcResult* GetStartupCallResult();
691
693 CINOSTask* FindTask(uintid aTaskId);
695 CINOSTask* FindTask(const char* aTaskname);
696
703
705 { return CSafeTaskList(m_pTaskList); };
706 uint32 GetUpdateId()
707 { return mUpdateId; };
708
709 virtual CINOSTask* Setup();
710
711 // to be called every 1ms
712 void DoTimingMeasurement();
713
714 virtual void PrepareTaskStack(CINOSTask* apTask)=0;
715
716 virtual uint32 SingleStep(CINOSTask* apTask)=0;
717 virtual uint32 RangeStep(CINOSTask* apTask, uintptr auFrom, uintptr auTo)=0;
718 virtual uint32 Halt(CINOSTask* apTask)=0;
719 virtual uint32 Run(CINOSTask* apTask)=0;
720
721 virtual uint32 GetPC(CINOSTask* apTask, uintnbr* aValue)=0;
722 virtual uint32 PutPC(CINOSTask* apTask, uintnbr aValue)=0;
723 virtual uint32 GetLR(CINOSTask* apTask, uintnbr* aValue)=0;
724 virtual uint32 GetSPR(CINOSTask* apTask, uint32 aNumber, uint32* aValue)=0;
725 virtual uint32 PutSPR(CINOSTask* apTask, uint32 aNumber, uint32 aValue)=0;
726 virtual uint32 GetSPRs(CINOSTask* apTask, uint32* aResult)=0;
727 virtual uint32 GetSPRsGdb(CINOSTask* apTask, uint32* aResult)=0;
728
729 virtual uint32 GetGPR(CINOSTask* apTask, uint32 aNumber, uint32* aValue)=0;
730 virtual uint32 PutGPR(CINOSTask* apTask, uint32 aNumber, uint32 aValue)=0;
732 virtual uint32 GetGPRs(CINOSTask* apTask, uint32* aResult, bool abNative)=0;
733
734 virtual uint32 GetFPR(CINOSTask* apTask, uint32 aNumber, double* aValue)=0;
735 virtual uint32 PutFPR(CINOSTask* apTask, uint32 aNumber, double aValue)=0;
736 virtual uint32 GetFPRs(CINOSTask* apTask, double* aResult)=0;
737
738 virtual uint32 GetTaskData(CINOSTask* apTask, uint32 aDataDef, uintnbr* aResult, uint32& aLength)=0;
739 virtual uint32 PutTaskData(CINOSTask* apTask, uint32 aDataDef, uint32* aData, uint32 aLength)=0;
740
743 virtual const char* GetTargetDescription() = 0;
744
747 virtual uint32 GetGdbRegsSize(CINOSTask* apTask, uint32& auSize) = 0;
748
751 virtual uint32 GetGdbRegs(CINOSTask* apTask, void* apData)=0;
752
755 virtual uint32 PutGdbReg(CINOSTask* apTask, const uint32 auRegister, const void* apData, uint32 auDataLength)=0;
756
757 // private members
758 private :
761 static void Finalyse();
762
765 void MaskInterrupts()
766 {
767 #if defined(INOS_ARCH_ARM)
768 m_uIrqMask = 0x000000c0;
769 #else
770 m_uIrqMask = 0xffff7fff;
771 #endif
772 }
773
774 // public members
775 public :
777 enum {
778 eStaPreboot = -1,
795 eStaSyncTimebase = 64,
796 eStaFinalyse = 65,
797 eStaRunning = 66,
798 };
799 static int32 m_iKernelState;
801 static CINOSKernel* m_pInstance[DF_INOS_MAX_CORES];
802
804 uint32 m_uReady;
809
814
816 uint8 m_uCoreId = 0;
818 static uint8 m_uCoreShift;
820 static uint32 m_uCoreMask;
822 std::atomic<uint32> m_uTskIdCnt = {1};
827
830 static CINOSTask* GetTask(uint32 auTaskId);
831
834 static bool IsTaskValid(CINOSTask* apTask);
835
836 //--- compatibility ---------------------------------------------------
837
839 CINCOObject* m_pRegister;
841 CINCOObject* m_pTask;
847 uint32 mCount_1sec;
849 uint32 mUpdateId;
850 // count of current CINOSTask-list users (users are for example: INCO-
851 // dbg functions)
855
856 //--- logger ----------------------------------------------------------
857
858 // kernel logger members are private
859 friend class CINOSBus;
860 friend class CINOSTestpoint;
861 friend class CINCODataLogger;
862 friend class CINOSMcTargetKernelLogger;
863 friend class CINOSKernelLoggerTest;
864 private :
865 // create logger buffer
866 uint32 LoggerCreate(uint32 auEntries);
867 // destroy logger buffer
868 uint32 LoggerDestroy();
869 // start logger
870 uint32 LoggerStart(uint8 auType);
871 // start logger
872 uint32 LoggerStart(uint8 auType, uint64 auTicks);
873 // stop logger
874 uint32 LoggerStop();
875 uint32 iLoggerStop();
876 // cancel logger
877 uint32 LoggerCancel();
878 uint32 iLoggerCancel();
879 // get logger state
880 uint32 LoggerGetState();
881 // trigger occured
882 void TriggerOccured(uint8 auType, uint8 auPercent);
883 void TriggerOccured(uint8 auType, uint8 auPercent, uint64 auTimeStamp);
884 void iTriggerOccured(uint8 auType, uint8 auPercent, uint64 auTimeStamp);
885
886 #if defined(INOS_TASK_LOGGER_EXTENDED)
888 {
889 uint16 m_uNext; // offset of next entry, usually sizeof(SINOSKernelLoggerEntry)
890 uint8 m_uType; // entry type
891 uint8 m_uSubType; // entry subtype
892 uint32 m_uTime; // lowest 32 bit of time base at log
893 uint64 m_uData; // log data
894 };
895 #else
897 {
898 uint8 m_uType; // entry type
899 uint8 m_uReserved;// reserved for future use
900 uint16 m_uTime; // lowest 16 bit of time base at log
901 uint32 m_uData; // log data
902 };
903 #endif
904
906 enum ELogVersion {
907 eLogStandard = 0, // 0 - original
908 eLogExtended = 1, // 1 - extended
909 #if defined(INOS_TASK_LOGGER_EXTENDED)
911 #else
913 #endif
915 enum ELogState {
916 eLogStaIdle = 0, // 0 - idle
917 eLogStaWaiting = 1, // 1 - waiting for trigger
918 eLogStaRunning = 2, // 2 - running
921 uint32 m_uLogEntries{};
923 uint32 m_uLogSize{};
925 uint64 m_uLogIndexWrt{};
927 uint64 m_uLogIndexStp{};
929 uint32 m_uLogIndexWrtMask{};
931 uint64 m_uLogTriggerTicks{};
935 uint8 m_uLogTriggerPercent = 50;
937 uint8 m_uLogTriggerType{DF_INOS_LOG_TRIGGER_TYPE_UNKNOWN};
941 char m_cLogTriggerTask[64]{};
944 #ifdef INOS_DESKTOP
946 uint64 m_uLogTicks{};
947 #endif
948
952 static struct SINOSKernelCallback* m_pFinalyseFst;
954 static struct SINOSKernelCallback* m_pFinalyseLst;
957
958 //----------------------------------------------------------------------
960 //----------------------------------------------------------------------
961};
962
963//----------------------------------------------------------------------
965//----------------------------------------------------------------------
966
967/* gcc 10.x does not allow friends with default parameters */
968void Suspend(uint32 auTaskState=1, uint32 auFlags=0);
969void SuspendEx(uint32 auTaskState, SINOSCoreLock* apLock, CINOSTask* apTask = nullptr);
970void Resume(class CINOSTask* apTask, uint32 auFlags=0);
971void Resume(tTaskId aidTask, uint32 auFlags=0);
972void Ready(class CINOSTask* apTask, uint32 auFlags=0);
973void Ready(tTaskId aidTask, uint32 auFlags=0);
974
975extern void Suspend(uint32 auTaskState, uint32 auFlags);
976extern void SuspendEx(uint32 auTaskState, SINOSCoreLock* apLock, CINOSTask* apTask);
977extern void Goodbye();
978extern void Resume(class CINOSTask* apTask, uint32 auFlags);
979extern void Resume(tTaskId aidTask, uint32 auFlags);
980extern void Ready(class CINOSTask* apTask, uint32 auFlags);
981extern void Ready(tTaskId aidTask, uint32 auFlags);
982extern uint32 SwitchCore(uint32 auCoreId);
983extern void Schedule();
984extern void Schedule(uint32 auCoreId);
985extern void Exit(uint32 auExitCode);
986extern void Relinquish();
987extern void Preemption();
988extern void ChangePriority(uint32 auPriority);
989#if defined(INOS_WINDOWS)
990extern long _Sleep(long aTime);
991#define Sleep(aTime) _Sleep(aTime)
992#else
993extern long Sleep(long aTime);
994#endif
995extern CINOSTask* ActualTask();
996
997//------------------------------------------------------------------------------
998// target related includes
999//------------------------------------------------------------------------------
1000
1001INOS_INLINE uint8 GetCoreId(bool abReal = false);
1002
1003#if defined(INOS_CPU_CORTEXA9)
1004 #include <cinostask.h>
1005 #include <inoskernel_cortexa9.h>
1006#elif defined(INOS_CPU_CORTEXA72)
1007 #include <cinostask.h>
1008 #include <inoskernel_cortexa72.h>
1009#elif defined(INOS_CPU_P50XX)
1010 #include <cinostask.h>
1011 #include <inoskernel_p50xx.h>
1012#elif defined(INOS_CPU_P2020)
1013 #include <cinostask.h>
1014 #include <inoskernel_p2020.h>
1015#elif defined(INOS_CPU_PPC750)
1016 #include <cinostask.h>
1017 #include <inoskernel_ppc750.h>
1018#elif defined(INOS_DESKTOP)
1019 #include <cinostask.h>
1020 #include <inoskernel_desktop.h>
1021#endif
1022
1023//------------------------------------------------------------------------------
1024// cores
1025//------------------------------------------------------------------------------
1026
1027INOS_INLINE uint8 GetCores(bool abReal = false)
1028{
1029 if (abReal) {
1030 extern uint8 __cpu_cores_real;
1031 return __cpu_cores_real;
1032 }
1033 else {
1034 extern uint8 __cpu_cores_virtual;
1035 return __cpu_cores_virtual;
1036 }
1037}
1038INOS_INLINE bool IsCore0()
1039{
1040 return GetCoreId() == 0;
1041}
1042
1044{
1045 extern uint32 __cpu_coreid_primary;
1046 return __cpu_coreid_primary;
1047}
1048
1050{
1051 extern uint32 __cpu_coreid_primary;
1052 return GetCoreId(true) == __cpu_coreid_primary;
1053}
1054
1056{
1057 return tTaskId(ActualTask(), GetCoreId());
1058}
1059
1060//------------------------------------------------------------------------------
1061// core synchronisation
1062//------------------------------------------------------------------------------
1063
1064struct SINOSCoreSync
1065{
1066 enum {
1067 ePointFirst = 0,
1068 ePointLast = 13,
1069 // os specific points
1070 ePointInternal0 = 0,
1071 ePointInternal1 = 1,
1072 ePointInternal2 = 2,
1073 ePointInternal3 = 3,
1074 ePointInternal4 = 4,
1075 ePointInternal5 = 5,
1076 ePointInternal6 = 6,
1077 ePointInternal7 = 7,
1078 ePointInternal8 = 8,
1079 ePointDataLogger = 9,
1080 // user specific points
1081 ePointUser0 = 10,
1082 ePointUser1 = 11,
1083 ePointUser2 = 12,
1084 ePointUser3 = 13,
1085 };
1086
1087 enum {
1088 eIsFirst,
1089 eIsLast,
1090 };
1098
1100 INOS_INLINE void Lock()
1101 {
1102 #if defined(INOS_DESKTOP)
1103 // TODO
1104 #else
1105 // wait for lock
1106 while (__sync_lock_test_and_set(m_CoreLock.GetAddr(), 1));
1107 #endif
1108 }
1110 INOS_INLINE void Unlock()
1111 {
1112 #if defined(INOS_DESKTOP)
1113 // TODO
1114 #else
1115 // free lock
1117 #endif
1118 }
1120 INOS_INLINE void Reset()
1121 {
1122 // IMPORTANT: We do NOT enter critical section here, as this leads to
1123 // deadlocks if a higher prio task/interrupt tries to get the
1124 // lock the core already owns ...
1125
1126 // reset done values
1127 for (uint32 i=0; i<ePointLast+1; i++) {
1128 // reset value
1129 __sync_fetch_and_or(m_CoreDone[i].GetAddr(), m_CoreMask.GetValue());
1130 } // end for
1131 }
1132
1133 INOS_INLINE void CoreAdd()
1134 {
1135 __sync_fetch_and_or(m_CoreMask.GetAddr(), (1<<GetCoreId()));
1136 }
1137
1138 INOS_INLINE void CoreRemove()
1139 {
1140 __sync_fetch_and_and(m_CoreMask.GetAddr(), ~(1<<GetCoreId()));
1141 }
1142
1143 INOS_INLINE uint32 CoreGetMask()
1144 {
1145 // IMPORTANT: We do NOT enter critical section here, as this leads to
1146 // deadlocks if a higher prio task/interrupt tries to get the
1147 // lock the core already owns ...
1148
1149 // add core to mask
1150 return __atomic_load_n(m_CoreMask.GetAddr(), __ATOMIC_SEQ_CST);
1151 }
1152
1155 INOS_INLINE bool IsFirst(uint32 auPointIndex)
1156 {
1157 // enter critical section
1158 Lock();
1159
1160 // done
1161 uint32 uCoreDone = __sync_fetch_and_and(m_CoreDone[auPointIndex].GetAddr(), ~(1<<GetCoreId()));
1162 // lets check
1163 bool bIsFirst = (uCoreDone == m_CoreMask.GetValue());
1164
1165 // only unlock if I'm not the first
1166 if (!bIsFirst) {
1167 // exit critical section
1168 Unlock();
1169 }
1170
1171 // return result
1172 return bIsFirst;
1173 }
1174
1177 INOS_INLINE bool IsLast(uint32 auPointIndex)
1178 {
1179 // done
1180 uint32 uCoreDone = __sync_fetch_and_and(m_CoreDone[auPointIndex].GetAddr(), ~(1<<GetCoreId()));
1181 // lets check
1182 return (uCoreDone == (uint32) (1<<GetCoreId()));
1183 }
1184
1187 INOS_INLINE bool IsCore(uint32 auPointIndex, uint32 auCoreId)
1188 {
1189 // ok ?
1190 if (GetCoreId() == auCoreId) {
1191 // yes
1192 return true;
1193 }
1194
1195 // locals
1196 volatile uint32* p = m_CoreDone[auPointIndex].GetAddr();
1197 // wait till the requested core did his job
1198 while (*p & (1<<auCoreId));
1199
1200 // done
1201 __sync_fetch_and_and(m_CoreDone[auPointIndex].GetAddr(), ~(1<<GetCoreId()));
1202
1203 // return result
1204 return false;
1205 }
1206
1208 INOS_INLINE void Done(uint32 auPointIndex)
1209 {
1210 // done
1211 __sync_fetch_and_and(m_CoreDone[auPointIndex].GetAddr(), ~(1<<GetCoreId()));
1212 }
1213
1214};
1215
1216//----------------------------------------------------------------------
1218//----------------------------------------------------------------------
1219//------------------------------------------------------------------------------
1220// end of file
1221//------------------------------------------------------------------------------
1222
1223#endif // INC_INOSKERNEL_h
The task module.
Definition cinosbus.h:600
Definition inoskernel.h:239
friend void Ready(tTaskId aidTask, uint32 auFlags)
Put given task into ready list but do not schedule. This method is normally used in conjunction with ...
friend void Schedule(uint32 auCoreId)
Do an explicite schedule or given core. This method is normally used in in conjunction with Ready In ...
friend void SuspendEx(uint32 auTaskState, SINOSCoreLock *apLock, CINOSTask *apTask)
Suspend current task from execution and release the given lock. The lock will be released completely,...
friend void ChangePriority(uint32 auPriority)
Change priority of current task and do a reschedule if necessary. For more info see section Priority.
friend void Exit(uint32 auExitCode)
Terminate actual task.
friend void Ready(class CINOSTask *apTask, uint32 auFlags)
Put given task into ready list but do not schedule. This method is normally used in conjunction with ...
friend void Resume(tTaskId aidTask, uint32 auFlags)
Resume given task and put it into ready list.
static int32 GetKernelState()
Get kernel state. Valid values are.
Definition inoskernel.h:495
friend void Relinquish()
Give other tasks with the same priority a chance to run. For more info see section Relinquish.
friend void Resume(class CINOSTask *apTask, uint32 auFlags)
Resume given task and put it into ready list.
friend uint32 SwitchCore(uint32 auCoreId)
Switch current task to the given core.
virtual void AddIdle(void *apFunction, void *apObject)
Add idle handler. The given function is called whenever the CPU goes into idle state IMPORTANT things...
end of doxygen exclude friend void Suspend(uint32 auTaskState, uint32 auFlags)
Suspend current task from execution. Note that upon Resume, the interrupt state will be restored to t...
friend void Schedule()
Do an explicite schedule. This method is normally used in in conjunction with Ready In case of using ...
void AddBootedCallback(void *apFunction, void *apObject)
Add kernel booted callback, it is called after the kernel has entered the running state....
void AddFinalyse(void *apFunction, void *apObject)
Add kernel finalyse callback, it is called after the kernel has booted all cores and just before it g...
friend void Goodbye()
Suspend current task from execution without saving its context.
friend class CINOSTask * ActualTask()
Return pointer to actual running task.
Definition cinosmcmodule.h:1900
Definition cinosmutex.h:36
Definition inos_syn.h:67
Definition cinostask.h:52
CINOSTask * ActualTask()
#define DF_INOS_MAX_TASKS
Definition inosdefault.h:435
#define DF_INOS_TASK_PRIO_HIGHEST
Definition inosdefine.h:182
#define INOS_INLINE
Definition inosdefine.h:60
#define DF_INOS_MAX_CORES
Definition inosdefine.h:164
Definition inostype.h:258
Definition inostype.h:192