os_core/os_core.c File Reference

Go to the source code of this file.

Functions

void OsInit (void)
void OsStart (void)
void OsYield (void)
void OsSleep (void)
void OsFinish (void)
void OsCoreInit (void)

Variables

INT32U OSTaskSwitch
INT32U OSTCBCur
INT32U OSTCBHighRdy
INT32U OSPrioCur
INT32U OSPrioHighRdy
INT32U OSTaskSwHook
INT32U OSIntNesting
INT32U OSRunning


Function Documentation

void OsCoreInit ( void   ) 

Definition at line 29 of file os_core.c.

00029                      {
00030     OSIntNesting=0;
00031     OSTaskSwitch=0;
00032     OSRunning=0;
00033 }

void OsFinish ( void   ) 

Definition at line 70 of file os_core.c.

00070                    {    // Task killed
00071     OS_TCB *pOsTcb;
00072 
00073     OS_ENTER_CRITICAL();
00074     pOsTcb=(OS_TCB *)OSTCBCur;
00075     pOsTcb->Status=OS_TASK_FREE;
00076     pOsTcb->Id=0;
00077     pOsTcb->Priority=0;
00078     pOsTcb->Prev=(OS_TCB *)0;
00079     pOsTcb->Next=(OS_TCB *)0;
00080     OsTaskFreeTaskPut(pOsTcb); // put task tcb back to free list
00081     OsSchedulerRunNext();
00082     OS_EXIT_CRITICAL();
00083 }

void OsInit ( void   ) 

Definition at line 34 of file os_core.c.

00034                  {
00035     OsCoreInit();
00036     OsTaskInit();
00037     OsSchedulerInit();
00038     OsTimeInit();
00039     OsEventInit();
00040     OsSemaphoreInit();
00041     OsFlagInit();
00042     OsMboxInit();
00043     OsMutexInit();
00044 }

void OsSleep ( void   ) 

Definition at line 58 of file os_core.c.

00058                   {      // Task suspend
00059     OS_TCB *pOsTcb;
00060 
00061     OS_ENTER_CRITICAL();
00062     pOsTcb=(OS_TCB *)OSTCBCur;
00063     pOsTcb->Status=OS_TASK_SUSPEND;
00064     pOsTcb->PendingType=OS_PENDING_NONE;
00065     pOsTcb->TimeDelay=0;
00066     OsTaskSuspendTaskPut(pOsTcb); // put task into suspend list
00067     OsSchedulerRunNext();
00068     OS_EXIT_CRITICAL();
00069 }

void OsStart ( void   ) 

Definition at line 45 of file os_core.c.

00045                   {       // Os gets first task to run
00046     if(OSRunning==FALSE){
00047         if(OsSchedulerStartHigh()==TRUE){
00048             OSStartHighRdy();
00049         }
00050     }
00051     while(1);            // If no task, halt os here.
00052 }

void OsYield ( void   ) 

Definition at line 53 of file os_core.c.

00053                   {      // Task switchs out
00054     OS_ENTER_CRITICAL();
00055     OsSchedulerRunNext();
00056     OS_EXIT_CRITICAL();
00057 }


Variable Documentation

INT32U OSIntNesting

Definition at line 19 of file os_core.c.

INT32U OSPrioCur

Definition at line 16 of file os_core.c.

INT32U OSPrioHighRdy

Definition at line 17 of file os_core.c.

INT32U OSRunning

Definition at line 20 of file os_core.c.

INT32U OSTaskSwHook

Definition at line 18 of file os_core.c.

INT32U OSTaskSwitch

Definition at line 13 of file os_core.c.

INT32U OSTCBCur

Definition at line 14 of file os_core.c.

INT32U OSTCBHighRdy

Definition at line 15 of file os_core.c.


Generated on Tue Sep 2 08:45:42 2008 for A Simple operation System using S3C2410 by  doxygen 1.5.6