1 /*---------------------------------------------------------------------------*
2   Project:  OS System Health
3   File:     OSSysHealth.h
4 
5   Copyright (C) 2010-2011 Nintendo.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13  *---------------------------------------------------------------------------*/
14 
15 #ifndef __OSSYSHEALTH_H__
16 #define __OSSYSHEALTH_H__
17 
18 #include <cafe/os.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 
25 #define SH_ALARM           (1 << 0)
26 #define SH_THREAD          (1 << 1)
27 #define SH_MEMORY          (1 << 2)
28 #define SH_SYSLOG          (1 << 3)
29 #define SH_FGBGTRANSITION  (1 << 4)
30 #define SH_NETWORK         (1 << 5)
31 #define SH_FILESYSTEM      (1 << 6)
32 #define SH_GRAPHIC         (1 << 7)
33 
34 #define SH_ALL             (SH_ALARM|SH_THREAD|SH_MEMORY|SH_SYSLOG|SH_FGBGTRANSITION|SH_NETWORK|SH_FILESYSTEM|SH_GHAPHIC)
35 
36 typedef struct SHAlarm
37 {
38 	u32 todo;
39 } SHAlarm;
40 
41 typedef struct SHThread
42 {
43 	u32 todo;
44 } SHThread;
45 
46 typedef struct SHMemory
47 {
48 	u32 todo;
49 } SHMemory;
50 
51 typedef struct SHSyslog
52 {   char current[8*1024*1024];
53     char previous[1];
54 } SHSyslog;
55 
56 typedef struct SHFGBGTransition
57 {
58 	u32 todo;
59 } SHFGBGTransition;
60 
61 typedef struct SHNetwork
62 {
63 	u32 todo;
64 } SHNetwork;
65 
66 typedef struct SHFileSystem
67 {
68 	u32 todo;
69 } SHFileSystem;
70 
71 typedef struct SHGraphic
72 {
73 	u32 todo;
74 } SHGraphic;
75 
76 typedef struct OSSysHealth
77 {
78    u32 allocsize;
79    u32 component_mask;
80    SHAlarm          *alarm;
81    SHThread         *thread;
82    SHMemory         *memory;
83    SHSyslog         *syslog;
84    SHFGBGTransition *fgbgtransition;
85    SHNetwork        *network;
86    SHFileSystem     *filesystem;
87    SHGraphic        *graphic;
88 } OSSysHealth;
89 
90 OSSysHealth* OSAllocSysHealth(u32 component_mask);
91 
92 void OSFreeSysHealth(OSSysHealth *sh);
93 
94 BOOL OSGetSysHealth(OSSysHealth *sh);
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif  // __OSSYSHEALTH_H__
101