femtoos_source/femtoos_shared.c File Reference

#include "femtoos_shared.h"

Include dependency graph for femtoos_shared.c:

Go to the source code of this file.

Defines

#define REGPARAMS(NR)
#define STATUSPARAMS(NR)
#define STACKSIZEPARAMS(NR)   (StackSize(TN_ ## NR)),
#define STACKOFFSETPARAMS(NR)   (Stack ## NR)
#define STACKOFFSETPARAMSSHARED   (StackSHR)
#define TIMESLICEPARAMS(NR)
#define SLOTDEPTHPARAMS(NR)
#define TASKNAMEPARAMS(NR)   ,(TaskNameStr ## NR)
#define TDB_DEF(NR, SOP)   { REGPARAMS(NR) STATUSPARAMS(NR) STACKSIZEPARAMS(NR) SOP TIMESLICEPARAMS(NR) SLOTDEPTHPARAMS(NR) TASKNAMEPARAMS(NR) };
#define SLOTDEPTHTCBEXTENSION(NR)   (SlotDepth(TN_ ## NR))
#define QEUETCBEXTENSION(NR)   (((SlotSize(TN_ ## NR)) == 0) ? 0 : 2)
#define TASK_DEF(NR)
#define TASK_DEF_SHARED(NR)
#define QUEU_DEF(NR)   const Tbyte Queu ## NR[QueuSize(LN_ ## NR)];

Functions

TosData xOS __attribute__ ((nocommon))
 This union, TosDate is the dark art.

Variables

Ttickcount uxTickCount
 Declaration of the tick counter.
Tuint08 uiOsStatus
Tuint08 uiFsStatus
 Declaration of the FS status byte.
Tuint08 uiOsTimeAverage
 If we check the timing of the OS an continuous average is taken over the last for Os Time values.
Tuint16 uiOsLoadCollect
 These variables hold the statistics of the OS and the ISR's.
Tuint16 uiOsLoadTotal
Tuint16 uiIdleLoadCollect
Tuint16 uiIdleLoadTotal
Tuint08 uiIsrLoadTemp
Tuint16 uiIsrLoadCollect
Tuint16 uiIsrLoadTotal
Tuint08 uiLastOsStatus
Tuint08 uiOsStackMax
 The 'StackMax' variables hold the highest use of the Stack for the OS and the ISR.
Tuint08 uiIsrStackMax
const Tbyte *pxTCBlist[0] PROGMEM = { }
const TtaskDefinitionBlock
*pxTDBlist[0] 
PROGMEM = { }
const fpInitTask pxInitlist[0] PROGMEM = { }
const fpLoopTask pxLooplist[0] PROGMEM = { }
const fpBarkTask pxBarklist[0] PROGMEM = { }
const Tuint08 uiFileSpace[0] PROGMEM = { }
const Tuint08 uiCapabilities[0] PROGMEM = { }


Define Documentation

#define QEUETCBEXTENSION ( NR   )     (((SlotSize(TN_ ## NR)) == 0) ? 0 : 2)

Definition at line 199 of file femtoos_shared.c.

#define QUEU_DEF ( NR   )     const Tbyte Queu ## NR[QueuSize(LN_ ## NR)];

Definition at line 233 of file femtoos_shared.c.

#define REGPARAMS ( NR   ) 

Definition at line 137 of file femtoos_shared.c.

#define SLOTDEPTHPARAMS ( NR   ) 

Definition at line 177 of file femtoos_shared.c.

#define SLOTDEPTHTCBEXTENSION ( NR   )     (SlotDepth(TN_ ## NR))

Definition at line 191 of file femtoos_shared.c.

#define STACKOFFSETPARAMS ( NR   )     (Stack ## NR)

Definition at line 161 of file femtoos_shared.c.

#define STACKOFFSETPARAMSSHARED   (StackSHR)

Definition at line 162 of file femtoos_shared.c.

#define STACKSIZEPARAMS ( NR   )     (StackSize(TN_ ## NR)),

Definition at line 155 of file femtoos_shared.c.

#define STATUSPARAMS ( NR   ) 

Definition at line 149 of file femtoos_shared.c.

#define TASK_DEF ( NR   ) 

Value:

const Tbyte tcb ## NR[(sizeof(TtaskControlBlock) + SLOTDEPTHTCBEXTENSION(NR) + QEUETCBEXTENSION(NR)) ];    \
  const Tchar Stack ## NR[StackSizeReal(TN_  ## NR)] __attribute__ ((nocommon));                             \
  extern void AppInit(TN_ ## NR) (void);                                                                     \
  extern void AppLoop(TN_ ## NR) (void);                                                                     \
  extern void AppBark(TN_ ## NR) (void);                                                                     \
  const TtaskDefinitionBlock PROGMEM tdb ## NR =  TDB_DEF(NR,STACKOFFSETPARAMS(NR))

Definition at line 218 of file femtoos_shared.c.

#define TASK_DEF_SHARED ( NR   ) 

Value:

const Tbyte tcb ## NR[(sizeof(TtaskControlBlock) + SLOTDEPTHTCBEXTENSION(NR) + QEUETCBEXTENSION(NR)) ];    \
  extern void AppInit(TN_ ## NR) (void);                                                                     \
  extern void AppLoop(TN_ ## NR) (void);                                                                     \
  extern void AppBark(TN_ ## NR) (void);                                                                     \
  const TtaskDefinitionBlock PROGMEM tdb ## NR =  TDB_DEF(NR,STACKOFFSETPARAMSSHARED)

Definition at line 226 of file femtoos_shared.c.

#define TASKNAMEPARAMS ( NR   )     ,(TaskNameStr ## NR)

Definition at line 181 of file femtoos_shared.c.

#define TDB_DEF ( NR,
SOP   )     { REGPARAMS(NR) STATUSPARAMS(NR) STACKSIZEPARAMS(NR) SOP TIMESLICEPARAMS(NR) SLOTDEPTHPARAMS(NR) TASKNAMEPARAMS(NR) };

Definition at line 187 of file femtoos_shared.c.

#define TIMESLICEPARAMS ( NR   ) 

Definition at line 169 of file femtoos_shared.c.


Function Documentation

TosData xOS __attribute__ ( (nocommon)   ) 

This union, TosDate is the dark art.

We use it so pass and keep the background variables AND to hold the OS stack. However some of the background variables are retrieved after this has become stack space again. This should be save if the parameters are directly copied form their location and if they are not located at stack-pointer border. Make sure the OSstack is at least as big as this structure. We tested it, and indeed it can be as small as that. In case of cfgSysStackGrowthUp == cfgTrue and there are problems if can be necessary to place the pxSave to the bottom of the structure, (the compiler normally places it top-aligned, although it has freedom to choose something else. Discussion about the nocommon attribute, see below.


Variable Documentation

const Tuint08 uiCapabilities [0] PROGMEM = { }

Definition at line 788 of file femtoos_shared.c.

const Tuint08 uiFileSpace [0] PROGMEM = { }

Definition at line 747 of file femtoos_shared.c.

const fpBarkTask pxBarklist [0] PROGMEM = { }

Definition at line 633 of file femtoos_shared.c.

const fpLoopTask pxLooplist [0] PROGMEM = { }

Definition at line 594 of file femtoos_shared.c.

const fpInitTask pxInitlist [0] PROGMEM = { }

Definition at line 555 of file femtoos_shared.c.

const TtaskDefinitionBlock* pxTDBlist [0] PROGMEM = { }

Definition at line 516 of file femtoos_shared.c.

const Tbyte* pxTCBlist [0] PROGMEM = { }

Definition at line 479 of file femtoos_shared.c.

Tuint08 uiFsStatus

Declaration of the FS status byte.

The whole state of the Femto File System is kept in one byte. 8 bit structure: rwqbtttt r: read mode, reading is possible, all blocking FS tasks are write request. w: write mode, one task has access, further tasks are blocked. q: request bit, if set, write is requested, no further reads are allowed. b: burn block. As long as this bit is set, writing is prohibited. tttt: number of the task currently writing the FS in case of writemode tttt: number of tasks holding a readlock in case of readmode

Definition at line 71 of file femtoos_shared.c.

Referenced by genLogOs(), privEnterSleep(), privFileOpenBody(), privPrepareFileClose(), privPutAllTasksToSleep(), privReleaseFileBlocks(), privSleepAllBody(), privSwitchContext(), and privWaitForFsAccessBody().

Tuint16 uiIdleLoadCollect

Definition at line 92 of file femtoos_shared.c.

Referenced by privCopyLoad().

Tuint16 uiIdleLoadTotal

Definition at line 93 of file femtoos_shared.c.

Referenced by genLogOs(), and privCopyLoad().

Tuint16 uiIsrLoadCollect

Definition at line 96 of file femtoos_shared.c.

Referenced by privCopyLoad().

Tuint08 uiIsrLoadTemp

Definition at line 95 of file femtoos_shared.c.

Referenced by isrStartLoad(), and isrStopLoad().

Tuint16 uiIsrLoadTotal

Definition at line 97 of file femtoos_shared.c.

Referenced by genLogOs(), and privCopyLoad().

Tuint08 uiIsrStackMax

Definition at line 116 of file femtoos_shared.c.

Referenced by genLogOs(), isrStackCheck(), and privTraceWatermarks().

Tuint08 uiLastOsStatus

Definition at line 99 of file femtoos_shared.c.

Referenced by privInitOs(), and privIsrExit().

Tuint16 uiOsLoadCollect

These variables hold the statistics of the OS and the ISR's.

The 'collect' variables collect the subticks and these subticks are periodically and simultaneously copied to the 'total' variables.

Definition at line 90 of file femtoos_shared.c.

Referenced by privCopyLoad().

Tuint16 uiOsLoadTotal

Definition at line 91 of file femtoos_shared.c.

Referenced by genLogOs(), and privCopyLoad().

Tuint08 uiOsStackMax

The 'StackMax' variables hold the highest use of the Stack for the OS and the ISR.

These are determined on the bases of the highest stack level as well as on inspection of the content of these arrays.

Definition at line 111 of file femtoos_shared.c.

Referenced by genLogOs(), privCheckOsStackLevel(), privCheckOsStackRegion(), and privTraceWatermarks().

Tuint08 uiOsStatus

Definition at line 43 of file femtoos_shared.c.

Referenced by genAddtoTickCount(), genGetLastWakeTime(), genGetPriority(), genGetTaskname(), genGetTickCount(), genLogOs(), genLogTask(), genResume(), genSetPriority(), genSuspend(), portBeginISR(), portEnterISR(), portReturnISR(), portSaveContext(), portYieldISR(), privCheckCapabilities(), privDelayCalc(), privEnterIdle(), privEnterOS(), privEnterSleep(), privIncrementTick(), privInitOs(), privSwitchContext(), privTaskInit(), privTaskNumber(), and privTickYield().

Tuint08 uiOsTimeAverage

If we check the timing of the OS an continuous average is taken over the last for Os Time values.

This is stored in uiOsTimeAverage.

Definition at line 80 of file femtoos_shared.c.

Ttickcount uxTickCount

Declaration of the tick counter.

Definition at line 33 of file femtoos_shared.c.

Referenced by genAddtoTickCount(), genGetTickCount(), genResume(), privDelayCalc(), privIncrementTick(), privSwitchContext(), privUnblockTask(), and privWakeupFromLowPower().


Generated on Fri Oct 16 00:05:35 2009 for FemtoOS by  doxygen 1.5.2