WDOG_ID wdCreate (void) { WDOG_ID wdId; #ifdef WV_INSTRUMENTATION int level; #endif if ((!wdLibInstalled) && (wdLibInit () != OK)) return (NULL); /* package init problem */ wdId = (WDOG_ID) objAlloc (wdClassId); /* initialize allocated watchdog */ if ((wdId != NULL) && (wdInit (wdId) != OK)) { objFree (wdClassId, (char *) wdId); return (NULL); } #ifdef WV_INSTRUMENTATION /* windview - level 1 event logging */ level = intLock (); EVT_OBJ_1 (OBJ, wdId, wdClassId, EVENT_WDCREATE, wdId); intUnlock (level); #endif return (wdId); }
STATUS wdInit ( WDOG *pWdog /* pointer to watchdog to initialize */ ) { if ((!wdLibInstalled) && (wdLibInit () != OK)) return (ERROR); /* package init problem */ pWdog->status = WDOG_OUT_OF_Q; /* initially out of q */ pWdog->deferStartCnt = 0; /* no pending starts */ #ifdef WV_INSTRUMENTATION /* windview - connect instrumented class for level 1 event logging */ if (wvObjIsEnabled) objCoreInit (&pWdog->objCore, wdInstClassId); else #endif objCoreInit (&pWdog->objCore, wdClassId); /* initialize core */ return (OK); }
void usrKernelCoreInit (void) { eventLibInit (); /* VxWorks events */ semDeleteLibInit (); /* semaphore deletion routines */ /* binary semaphores */ /* counting semaphores */ /* reader/writer semaphores */ semOpenInit (); /* open/close/unlink semaphore modules */ msgQLibInit (); /* message queues */ msgQOpenInit (); /* open/close/unlink message queue modules */ wdLibInit (); /* watchdog timers */ taskOpenInit (); /* open/close/unlink task modules */ taskHookInit (); /* user callouts on task creation/deletion/context switch */ /* binary semaphore creation routine */ /* counting semaphore creation routine */ /* reader/writer semaphore creation routine */ taskCreateLibInit (); /* Capability to dynamically instantiate and delete tasks */ msgQCreateLibInit (); /* message queue creation and deletion library */ wdCreateLibInit (); /* watchdog timers creation and deletion library */ wdbTaskHookInit (); /* task hooks debug support */ }
int my_usrRoot(char* pMemPoolStart, unsigned int memPoolSize) { eventLibInit(); semBLibInit(); semMLibInit(); semCLibInit(); semQLibInit(); wdLibInit(); taskHookInit(); memInit(pMemPoolStart, memPoolSize); memPartLibInit(pMemPoolStart, memPoolSize); if (proc_sysMmuLibInit == 0) goto usrRoot_failed; int (*_sysMmuLibInit)() = (void*) proc_sysMmuLibInit; if (_sysMmuLibInit(0x1000) != 0) goto usrRoot_failed; if (vmMpuLibInit(0x1000) != 0) goto usrRoot_failed; if (vmBaseGlobalMapInit(&MemDescArray, MemDescArrayCount, 1) == 0) goto usrRoot_failed; sysClockConnect(usrClock, 0); sysClockRateSet(60); sysClockEnable(); selectInit(50); usrBootLineParse(0x1000); iosInit(20, 50, "/null"); ttyDrv(); usrSerialInit(); hashLibInit(); envLibInit(1); sigInit(); excInit(); logInit(fdConsole, 50); stdioInit(); fioLibInit(); selTaskDeleteHookAdd(); sub_FFB5F728(); my_taskcreate_Startup(); return 0; usrRoot_failed: printExc("usrRoot: MMU configuration failed, errno = %#x", *(long*) (GetErrorNumAddr()), 0, 0, 0, 0); reboot(1); return 0; }