Exemplo n.º 1
0
Arquivo: init.c Projeto: AEUG/400plus
int my_usrInit(int startType) {
	sysHwInit0();

	bzero(&bss_begin, (&bss_begin - &bss_end));

	sysStartType = startType;
	intVecBaseSet(0);
	cacheLibInit(1, 2);
	excVecInit();
	sysHwInit();
	cacheEnable(0);
	cacheEnable(1);
	classLibInit();
	taskLibInit();

	qInit(&readyQHead,  qPriBMapClassId, &readyQBMap, 0x100);
	qInit(&activeQHead, qFifoClassId);
	qInit(&tickQHead,   qPriListClassId);

	workQInit();

	/* sysMemTop() - returns the LogBuffer address, the buffer is 1.5mb */
	kernelInit(my_usrRoot, 0x4000, &bss_end, sysMemTop(), 0xC00, 0);

	return 0;
}
Exemplo n.º 2
0
void taskShowInit (void)

    {
    if (taskLibInit () == OK)
	{ classShowConnect (taskClassId, (FUNCPTR)taskShow);
#ifdef WV_INSTRUMENTATION
	classShowConnect (taskInstClassId, (FUNCPTR)taskShow);
#endif
	}
    }
Exemplo n.º 3
0
/*
 * Return the id of current task
 */
long
taskIdSelf(void)
{
    OS_TCB *tcb;

    if (taskList == NULL) {
	/* TaskLib was not initialized - do it now */
	if (taskLibInit() == ERROR) {
	    return 0;
	}
    }
    tcb = (OS_TCB *)pthread_getspecific(taskControlBlock);
    if (tcb == NULL)
	    return 0;			/* XXX correct ? */
    if (tcb->magic != TASK_MAGIC) {
	fprintf(stderr, "taskIdSelf: bad task specific data: %lx %lx\n",
		(unsigned long)tcb, (unsigned long)pthread_self());
	abort();
    }
    return (long)tcb;
}