main.c 972 Bytes
#include <os.h>
#include <rmon.h>
#include "perf.h"

char	bootStack[STACKSIZE];

static void	idle(void *);
static void	main(void *);

static OSThread	idleThread;
static char	idleThreadStack[STACKSIZE];

static OSThread	mainThread;
static char	mainThreadStack[STACKSIZE];

static OSThread	rmonThread;
static char	rmonThreadStack[RMON_STACKSIZE];

boot(void)
{

    osInitialize();
    osCreateThread(&mainThread, 1, main, (void *)0, mainThreadStack+STACKSIZE,
		  (OSPri)10);
    osStartThread(&mainThread);
}

static void
main(void *arg)
{

    /*
     * Create idle thread
     */
    osCreateThread(&idleThread, 2, idle, (void *)0, idleThreadStack+STACKSIZE,
		  (OSPri)0);
    osStartThread(&idleThread);

    /*
     * Create rmon thread
     */
    osCreateThread(&rmonThread, 0, rmonMain, (void *)0,
		rmonThreadStack+RMON_STACKSIZE, (OSPri)OS_PRIORITY_RMON);
    osStartThread(&rmonThread);

    int0();

    osExit();
}

static void
idle(void *arg)
{
	for (;;);
}