Rev 1317 | Rev 1321 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1317 | Rev 1318 | ||
---|---|---|---|
1 | #include <arch/types.h> |
1 | #include <arch/types.h> |
2 | 2 | ||
3 | typedef union sysinfo_item_val |
3 | typedef union sysinfo_item_val |
4 | { |
4 | { |
5 | __native val; |
5 | __native val; |
6 | void *fn; |
6 | void *fn; |
7 | }sysinfo_item_val_t; |
7 | }sysinfo_item_val_t; |
8 | 8 | ||
9 | typedef struct sysinfo_item |
9 | typedef struct sysinfo_item |
10 | { |
10 | { |
11 | char *name; |
11 | char *name; |
12 | union |
12 | union |
13 | { |
13 | { |
14 | __native val; |
14 | __native val; |
15 | void *fn; |
15 | void *fn; |
16 | }val; |
16 | }val; |
17 | 17 | ||
18 | union |
18 | union |
19 | { |
19 | { |
20 | struct sysinfo_item *table; |
20 | struct sysinfo_item *table; |
21 | void *fn; |
21 | void *fn; |
22 | }subinfo; |
22 | }subinfo; |
23 | 23 | ||
24 | struct sysinfo_item *next; |
24 | struct sysinfo_item *next; |
25 | int val_type; |
25 | int val_type; |
26 | int subinfo_type; |
26 | int subinfo_type; |
27 | }sysinfo_item_t; |
27 | }sysinfo_item_t; |
28 | 28 | ||
29 | #define SYSINFO_VAL_VAL 0 |
29 | #define SYSINFO_VAL_VAL 0 |
30 | #define SYSINFO_VAL_FUNCTION 1 |
30 | #define SYSINFO_VAL_FUNCTION 1 |
31 | #define SYSINFO_VAL_UNDEFINED '?' |
31 | #define SYSINFO_VAL_UNDEFINED '?' |
32 | 32 | ||
33 | #define SYSINFO_SUBINFO_NONE 0 |
33 | #define SYSINFO_SUBINFO_NONE 0 |
34 | #define SYSINFO_SUBINFO_TABLE 1 |
34 | #define SYSINFO_SUBINFO_TABLE 1 |
35 | #define SYSINFO_SUBINFO_FUNCTION 2 |
35 | #define SYSINFO_SUBINFO_FUNCTION 2 |
36 | 36 | ||
37 | 37 | ||
38 | typedef __native (*sysinfo_val_fn_t)(sysinfo_item_t *root); |
38 | typedef __native (*sysinfo_val_fn_t)(sysinfo_item_t *root); |
39 | typedef __native (*sysinfo_subinfo_fn_t)(const char *subname); |
39 | typedef __native (*sysinfo_subinfo_fn_t)(const char *subname); |
40 | 40 | ||
41 | typedef struct sysinfo_rettype |
41 | typedef struct sysinfo_rettype |
42 | { |
42 | { |
43 | __native val; |
43 | __native val; |
44 | __native valid; |
44 | __native valid; |
45 | }sysinfo_rettype_t; |
45 | }sysinfo_rettype_t; |
46 | 46 | ||
47 | void sysinfo_set_item_val(const char *name,sysinfo_item_t **root,__native val); |
47 | void sysinfo_set_item_val(const char *name,sysinfo_item_t **root,__native val); |
48 | void sysinfo_dump(sysinfo_item_t **root,int depth); |
48 | void sysinfo_dump(sysinfo_item_t **root,int depth); |
49 | void sysinfo_set_item_function(const char *name,sysinfo_item_t **root,sysinfo_val_fn_t fn); |
49 | void sysinfo_set_item_function(const char *name,sysinfo_item_t **root,sysinfo_val_fn_t fn); |
50 | void sysinfo_set_item_undefined(const char *name,sysinfo_item_t **root); |
50 | void sysinfo_set_item_undefined(const char *name,sysinfo_item_t **root); |
51 | 51 | ||
52 | sysinfo_rettype_t sysinfo_get_val(const char *name,sysinfo_item_t **root); |
52 | sysinfo_rettype_t sysinfo_get_val(const char *name,sysinfo_item_t **root); |
53 | 53 | ||
- | 54 | __native sys_sysinfo_valid(__native ptr,__native len); |
|
- | 55 | __native sys_sysinfo_value(__native ptr,__native len); |
|
- | 56 | ||
- | 57 | ||
54 | 58 |