dmonMain.c
965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <os.h>
double mainThreadStack[0x200], rmonThreadStack[0x200];
OSMesgQueue mq1, mq2;
OSMesg msgs1[1], msgs2[1];
/*
* The sole purpose of this is to kick off an rmon thread, which can service
* debugger read/write requests on the diagnostic's behalf.
*/
void mainproc( void * dummy )
{
OSMesg m;
OSThread rmonThread;
extern void rmonMain( void * );
printf( "Mainproc\n" );
osCreateThread( &rmonThread, rmonMain, (void *)0,
&rmonThreadStack[0x200],
OS_IM_CART, (OSPri) 250 );
osStartThread( &rmonThread );
printf( "diagnostic server entering idle thread...\n" );
/* become the idle thread */
osSetIntMask( OS_IM_CART );
osSetThreadPri( 0, 0 );
for ( ; ; )
;
}
void bootproc( void )
{
OSThread mainThread;
osInitialize();
printf( "Bootproc\n" );
osCreateThread( &mainThread, mainproc, (void *)0,
&mainThreadStack[0x200], OS_IM_NONE, (OSPri) 127 );
osStartThread( &mainThread );
}