source: mainline/generic/include/sysinfo/sysinfo.h@ 35a96cf

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 35a96cf was 35a96cf, checked in by Jakub Vana <jakub.vana@…>, 19 years ago

Sysinfo userspace interface

  • Property mode set to 100644
File size: 1.2 KB
Line 
1#include <arch/types.h>
2
3typedef union sysinfo_item_val
4{
5 __native val;
6 void *fn;
7}sysinfo_item_val_t;
8
9typedef struct sysinfo_item
10{
11 char *name;
12 union
13 {
14 __native val;
15 void *fn;
16 }val;
17
18 union
19 {
20 struct sysinfo_item *table;
21 void *fn;
22 }subinfo;
23
24 struct sysinfo_item *next;
25 int val_type;
26 int subinfo_type;
27}sysinfo_item_t;
28
29#define SYSINFO_VAL_VAL 0
30#define SYSINFO_VAL_FUNCTION 1
31#define SYSINFO_VAL_UNDEFINED '?'
32
33#define SYSINFO_SUBINFO_NONE 0
34#define SYSINFO_SUBINFO_TABLE 1
35#define SYSINFO_SUBINFO_FUNCTION 2
36
37
38typedef __native (*sysinfo_val_fn_t)(sysinfo_item_t *root);
39typedef __native (*sysinfo_subinfo_fn_t)(const char *subname);
40
41typedef struct sysinfo_rettype
42{
43 __native val;
44 __native valid;
45}sysinfo_rettype_t;
46
47void sysinfo_set_item_val(const char *name,sysinfo_item_t **root,__native val);
48void sysinfo_dump(sysinfo_item_t **root,int depth);
49void sysinfo_set_item_function(const char *name,sysinfo_item_t **root,sysinfo_val_fn_t fn);
50void sysinfo_set_item_undefined(const char *name,sysinfo_item_t **root);
51
52sysinfo_rettype_t sysinfo_get_val(const char *name,sysinfo_item_t **root);
53
54__native sys_sysinfo_valid(__native ptr,__native len);
55__native sys_sysinfo_value(__native ptr,__native len);
56
57
Note: See TracBrowser for help on using the repository browser.