Changeset 80bfb601 in mainline for kernel/generic/include
- Timestamp:
- 2010-04-18T09:57:19Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d869398
- Parents:
- fce3536
- Location:
- kernel/generic/include/sysinfo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/sysinfo/abi.h
rfce3536 r80bfb601 31 31 */ 32 32 /** @file 33 * Data structures passed between kernel sysinfo and user space. 33 34 */ 34 35 … … 36 37 #define KERN_ABI_H_ 37 38 39 /** Number of load components */ 38 40 #define LOAD_STEPS 3 41 42 /** Maximum task name size */ 39 43 #define TASK_NAME_BUFLEN 20 40 44 45 /** Statistics about a single CPU 46 * 47 */ 41 48 typedef struct { 42 unsigned int id; 43 uint16_t frequency_mhz; 44 uint64_t idle_ticks; 45 uint64_t busy_ticks; 49 unsigned int id; /**< CPU ID as stored by kernel */ 50 uint16_t frequency_mhz; /**< Frequency in MHz */ 51 uint64_t idle_ticks; /**< Number of idle kernel quanta */ 52 uint64_t busy_ticks; /**< Number of busy kernel quanta */ 46 53 } stats_cpu_t; 47 54 55 /** Physical memory statistics 56 * 57 */ 48 58 typedef struct { 49 uint64_t total; 50 uint64_t unavail; 51 uint64_t used; 52 uint64_t free; 59 uint64_t total; /**< Total physical memory (bytes) */ 60 uint64_t unavail; /**< Unavailable (reserved, firmware) bytes */ 61 uint64_t used; /**< Allocated physical memory (bytes) */ 62 uint64_t free; /**< Free physical memory (bytes) */ 53 63 } stats_physmem_t; 54 64 65 /** IPC statistics 66 * 67 * Associated with a task. 68 * 69 */ 55 70 typedef struct { 56 uint64_t call_sent; 57 uint64_t call_recieved; 58 uint64_t answer_sent; 59 uint64_t answer_recieved; 60 uint64_t irq_notif_recieved; 61 uint64_t forwarded; 71 uint64_t call_sent; /**< IPC calls sent */ 72 uint64_t call_recieved; /**< IPC calls received */ 73 uint64_t answer_sent; /**< IPC answers sent */ 74 uint64_t answer_recieved; /**< IPC answers received */ 75 uint64_t irq_notif_recieved; /**< IPC IRQ notifications */ 76 uint64_t forwarded; /**< IPC messages forwarded */ 62 77 } stats_ipc_t; 63 78 79 /** Statistics about a single task 80 * 81 */ 64 82 typedef struct { 65 char name[TASK_NAME_BUFLEN]; 66 size_t virtmem; 67 size_t threads; 68 uint64_t ucycles; 69 uint64_t kcycles; 70 stats_ipc_t ipc_info; 83 char name[TASK_NAME_BUFLEN]; /**< Task name (in kernel) */ 84 size_t virtmem; /**< Size of VAS (bytes) */ 85 size_t threads; /**< Number of threads */ 86 uint64_t ucycles; /**< Number of CPU cycles in user space */ 87 uint64_t kcycles; /**< Number of CPU cycles in kernel */ 88 stats_ipc_t ipc_info; /**< IPC statistics */ 71 89 } stats_task_t; 72 90 91 /** Load fixed-point value */ 73 92 typedef uint32_t load_t; 74 93 -
kernel/generic/include/sysinfo/sysinfo.h
rfce3536 r80bfb601 39 39 #include <str.h> 40 40 41 /** Framebuffer info exported flags */ 41 42 extern bool fb_exported; 42 43 44 /** Item value type 45 * 46 */ 43 47 typedef enum { 44 SYSINFO_VAL_UNDEFINED = 0, 45 SYSINFO_VAL_VAL = 1, 46 SYSINFO_VAL_DATA = 2, 47 SYSINFO_VAL_FUNCTION_VAL = 3, 48 SYSINFO_VAL_FUNCTION_DATA = 4 48 SYSINFO_VAL_UNDEFINED = 0, /**< Undefined value */ 49 SYSINFO_VAL_VAL = 1, /**< Constant numeric value */ 50 SYSINFO_VAL_DATA = 2, /**< Constant binary data */ 51 SYSINFO_VAL_FUNCTION_VAL = 3, /**< Generated numeric value */ 52 SYSINFO_VAL_FUNCTION_DATA = 4 /**< Generated binary data */ 49 53 } sysinfo_item_val_type_t; 50 54 55 /** Subtree type 56 * 57 */ 51 58 typedef enum { 52 SYSINFO_SUBTREE_NONE = 0, 53 SYSINFO_SUBTREE_TABLE = 1, 54 SYSINFO_SUBTREE_FUNCTION = 2 59 SYSINFO_SUBTREE_NONE = 0, /**< No subtree (leaf item) */ 60 SYSINFO_SUBTREE_TABLE = 1, /**< Fixed subtree */ 61 SYSINFO_SUBTREE_FUNCTION = 2 /**< Generated subtree */ 55 62 } sysinfo_subtree_type_t; 56 63 57 64 struct sysinfo_item; 58 65 66 /** Gerated numeric value function */ 59 67 typedef unative_t (*sysinfo_fn_val_t)(struct sysinfo_item *); 68 69 /** Generated binary data function */ 60 70 typedef void *(*sysinfo_fn_data_t)(struct sysinfo_item *, size_t *); 61 71 72 /** Sysinfo item binary data 73 * 74 */ 62 75 typedef struct { 63 void *data; 64 size_t size; 76 void *data; /**< Data */ 77 size_t size; /**< Size (bytes) */ 65 78 } sysinfo_data_t; 66 79 80 /** Sysinfo item value (union) 81 * 82 */ 67 83 typedef union { 68 unative_t val; 69 sysinfo_fn_val_t fn_val; 70 sysinfo_fn_data_t fn_data; 71 sysinfo_data_t data; 84 unative_t val; /**< Constant numberic value */ 85 sysinfo_fn_val_t fn_val; /**< Generated numeric value function */ 86 sysinfo_fn_data_t fn_data; /**< Generated binary data function */ 87 sysinfo_data_t data; /**< Constant binary data */ 72 88 } sysinfo_item_val_t; 73 89 90 /** Sysinfo return holder 91 * 92 * This structure is generated from the constant 93 * items or by the generating functions. Note that 94 * the validity of the data is limited by the scope 95 * of single sysinfo invocation guarded by sysinfo_lock. 96 * 97 */ 74 98 typedef struct { 75 sysinfo_item_val_type_t tag; 99 sysinfo_item_val_type_t tag; /**< Return value type */ 76 100 union { 77 unative_t val; 78 sysinfo_data_t data; 101 unative_t val; /**< Numberic value */ 102 sysinfo_data_t data; /**< Binary data */ 79 103 }; 80 104 } sysinfo_return_t; 81 105 106 /** Generated subtree function */ 82 107 typedef sysinfo_return_t (*sysinfo_fn_subtree_t)(const char *); 83 108 109 /** Sysinfo subtree (union) 110 * 111 */ 84 112 typedef union { 85 struct sysinfo_item *table; 86 sysinfo_fn_subtree_t get_data; 113 struct sysinfo_item *table; /**< Fixed subtree (list of subitems) */ 114 sysinfo_fn_subtree_t get_data; /**< Generated subtree function */ 87 115 } sysinfo_subtree_t; 88 116 117 /** Sysinfo item 118 * 119 */ 89 120 typedef struct sysinfo_item { 90 char *name; 121 char *name; /**< Item name */ 91 122 92 sysinfo_item_val_type_t val_type; 93 sysinfo_item_val_t val; 123 sysinfo_item_val_type_t val_type; /**< Item value type */ 124 sysinfo_item_val_t val; /**< Item value */ 94 125 95 sysinfo_subtree_type_t subtree_type; 96 sysinfo_subtree_t subtree; 126 sysinfo_subtree_type_t subtree_type; /**< Subtree type */ 127 sysinfo_subtree_t subtree; /**< Subtree */ 97 128 98 struct sysinfo_item *next; 129 struct sysinfo_item *next; /**< Sibling item */ 99 130 } sysinfo_item_t; 100 131 … … 114 145 extern void sysinfo_dump(sysinfo_item_t *); 115 146 116 unative_t sys_sysinfo_get_tag(void *, size_t);117 unative_t sys_sysinfo_get_value(void *, size_t, void *);118 unative_t sys_sysinfo_get_data_size(void *, size_t, void *);119 unative_t sys_sysinfo_get_data(void *, size_t, void *, size_t);147 extern unative_t sys_sysinfo_get_tag(void *, size_t); 148 extern unative_t sys_sysinfo_get_value(void *, size_t, void *); 149 extern unative_t sys_sysinfo_get_data_size(void *, size_t, void *); 150 extern unative_t sys_sysinfo_get_data(void *, size_t, void *, size_t); 120 151 121 152 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
