/************************************************************************** Description : Erzeugt fuer die Angegebene DeviceList die entsprechenden Protokoll-Objekte und vermekt diese in der Zusweisungstabelle Parameter : Pointer to Frame Return-Value : --- Changes : Author, Date, Version, Reason ******************************************************** PRUESSING, 23.04.2001, 1.0, Created **************************************************************************/ void TProtLayer_Constructor(TMinList * DeviceList) { TDevice * CurDev; //Reinit list INITLIST(&FrameListener); INITLIST(&ProtocolMap); foreach_f(DeviceList, CurDev ) { TProtLayer_CreateProtocol( CurDev ); }
void TMemPool_Init(TMemPool * me, int mincount, int maxcount, int elementsize, BOOL threading) { int i; //all elements must be aligned to 4 bytes boundary to be save... //the smalest size is now 4 bytes... if ((elementsize & 0x3)) { elementsize = (elementsize & 0x03)+4; } me->mincount = mincount; me->maxcount = maxcount; me->elementsize = elementsize; me->threading = threading; me->currcount = 0; INITLIST(&me->poolList); //allocate the minimum selements whiche were only freed when destructing //...as one block.... me->preAllocElems = NULL; if (mincount) { me->preAllocElems = os_malloc(mincount * elementsize); assert(me->preAllocElems); //add it as some small pieces to the list of unused elements... for(i=0;i < mincount; i++) { ADDHEAD(&me->poolList, (TMinNode*)(me->preAllocElems + (i * elementsize) )); } } }
void TMasterCmdFactory_Init( void ) { INITLIST(&unusedMasterCmdList); os_thread_MutexInit(&unusedMasterCmdList.Mutex); }
SHARED_FUNCTION void TQueue_Init(TQueue * queue) { INITLIST( &queue->messageQueue ); queue->waitingTask = NULL; }