reset.c
1.08 KB
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
44
45
46
47
48
49
50
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo.
$RCSfile: reset.c,v $
$Revision: 1.1.1.1 $
$Date: 2002/05/02 03:27:33 $
*---------------------------------------------------------------------*/
/* pre-process */
#include "hglobals.h"
#include "hreset.h"
#include "hdd.h"
/* declarerations */
OSMesgQueue rstMessageQ;
OSMesg rstMessageBuf;
static OSThread rstThread;
static u64 rstThreadStack[STACKSIZE/sizeof(u64)];
static void coreObjectOfrst(void *);
s16 resetflag = 0;
/* implmentations */
void
rst_create(void)
{
osCreateMesgQueue(&rstMessageQ, &rstMessageBuf, 1);
osSetEventMesg(OS_EVENT_PRENMI, &rstMessageQ, NULL);
osCreateThread(&rstThread, ++g_thread_id,coreObjectOfrst, 0
,rstThreadStack + STACKSIZE/sizeof(u64), RESET_THREAD_PRIORITY);
osStartThread(&rstThread);
}
static void
coreObjectOfrst(void * arg)
{
arg = arg; /* no use */
osRecvMesg(&rstMessageQ, NULL, OS_MESG_BLOCK);
resetflag = 1;
dd_reset();
}