Changeset f4f866c in mainline for kernel/generic/include
- Timestamp:
- 2010-04-23T21:42:26Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6c39a907
- Parents:
- 38aaacc2 (diff), 80badbe (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- kernel/generic/include
- Files:
-
- 1 added
- 12 edited
- 1 moved
-
cpu.h (modified) (2 diffs)
-
func.h (modified) (1 diff)
-
ipc/sysipc.h (modified) (1 diff)
-
mm/frame.h (modified) (1 diff)
-
print.h (modified) (1 diff)
-
printf/printf_core.h (modified) (1 diff)
-
proc/task.h (modified) (5 diffs)
-
proc/thread.h (modified) (4 diffs)
-
str.h (modified) (2 diffs)
-
syscall/syscall.h (modified) (2 diffs)
-
sysinfo/abi.h (added)
-
sysinfo/stats.h (moved) (moved from kernel/test/sysinfo/sysinfo1.c ) (2 diffs)
-
sysinfo/sysinfo.h (modified) (1 diff)
-
time/clock.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/cpu.h
r38aaacc2 rf4f866c 68 68 are disabled. */ 69 69 70 bool idle; 71 uint64_t idle_ticks; 72 uint64_t busy_ticks; 73 70 74 /** 71 75 * Processor ID assigned by kernel. … … 73 77 unsigned int id; 74 78 75 intactive;79 bool active; 76 80 int tlb_active; 77 81 -
kernel/generic/include/func.h
r38aaacc2 rf4f866c 43 43 extern void halt(void) __attribute__((noreturn)); 44 44 extern unative_t atoi(const char *text); 45 extern void order(const uint64_t val, uint64_t *rv, char *suffix);46 45 47 46 #endif -
kernel/generic/include/ipc/sysipc.h
r38aaacc2 rf4f866c 57 57 unative_t sys_ipc_forward_slow(unative_t callid, unative_t phoneid, 58 58 ipc_data_t *data, int mode); 59 unative_t sys_ipc_hangup( int phoneid);59 unative_t sys_ipc_hangup(unative_t phoneid); 60 60 unative_t sys_ipc_register_irq(inr_t inr, devno_t devno, unative_t method, 61 61 irq_code_t *ucode); -
kernel/generic/include/mm/frame.h
r38aaacc2 rf4f866c 169 169 extern bool zone_merge(size_t, size_t); 170 170 extern void zone_merge_all(void); 171 extern uint64_t zone_total_size(void); 171 extern uint64_t zones_total_size(void); 172 extern void zones_stats(uint64_t *, uint64_t *, uint64_t *, uint64_t *); 172 173 173 174 /* 174 175 * Console functions 175 176 */ 176 extern void zone _print_list(void);177 extern void zones_print_list(void); 177 178 extern void zone_print_one(size_t); 178 179 -
kernel/generic/include/print.h
r38aaacc2 rf4f866c 39 39 #include <stdarg.h> 40 40 41 #define EOF (-1)41 #define EOF (-1) 42 42 43 43 extern int puts(const char *s); -
kernel/generic/include/printf/printf_core.h
r38aaacc2 rf4f866c 51 51 } printf_spec_t; 52 52 53 int printf_core(const char *fmt, printf_spec_t *ps, va_list ap);53 extern int printf_core(const char *fmt, printf_spec_t *ps, va_list ap); 54 54 55 55 #endif -
kernel/generic/include/proc/task.h
r38aaacc2 rf4f866c 56 56 #include <ipc/kbox.h> 57 57 #include <mm/as.h> 58 59 #define TASK_NAME_BUFLEN 20 58 #include <sysinfo/abi.h> 60 59 61 60 struct thread; … … 81 80 task_id_t taskid; 82 81 /** Task security context. */ 83 context_id_t context; 82 context_id_t context; 84 83 85 84 /** Number of references (i.e. threads). */ … … 89 88 90 89 /** Task capabilities. */ 91 cap_t capabilities; 90 cap_t capabilities; 92 91 93 92 /* IPC stuff */ 94 93 answerbox_t answerbox; /**< Communication endpoint */ 95 94 phone_t phones[IPC_MAX_PHONES]; 95 stats_ipc_t ipc_info; /**< IPC statistics */ 96 96 /** 97 97 * Active asynchronous messages. It is used for limiting uspace to … … 119 119 mutex_t futexes_lock; 120 120 /** B+tree of futexes referenced by this task. */ 121 btree_t futexes; 121 btree_t futexes; 122 122 123 123 /** Accumulated accounting. */ 124 uint64_t cycles; 124 uint64_t ucycles; 125 uint64_t kcycles; 125 126 } task_t; 126 127 … … 134 135 extern task_t *task_find_by_id(task_id_t id); 135 136 extern int task_kill(task_id_t id); 136 extern uint64_t task_get_accounting(task_t *t);137 extern void task_get_accounting(task_t *t, uint64_t *ucycles, uint64_t *kcycles); 137 138 extern void task_print_list(void); 138 139 -
kernel/generic/include/proc/thread.h
r38aaacc2 rf4f866c 48 48 #include <proc/uarg.h> 49 49 #include <udebug/udebug.h> 50 #include <sysinfo/abi.h> 50 51 51 52 #define THREAD_STACK_SIZE STACK_SIZE … … 69 70 #define THREAD_FLAG_NOATTACH (1 << 3) 70 71 71 /** Thread states. */72 typedef enum {73 /** It is an error, if thread is found in this state. */74 Invalid,75 /** State of a thread that is currently executing on some CPU. */76 Running,77 /** Thread in this state is waiting for an event. */78 Sleeping,79 /** State of threads in a run queue. */80 Ready,81 /** Threads are in this state before they are first readied. */82 Entering,83 /** After a thread calls thread_exit(), it is put into Exiting state. */84 Exiting,85 /** Threads that were not detached but exited are Lingering. */86 Lingering87 } state_t;88 89 72 /** Thread structure. There is one per thread. */ 90 73 typedef struct thread { … … 189 172 190 173 /** Thread accounting. */ 191 uint64_t cycles; 174 uint64_t ucycles; 175 uint64_t kcycles; 192 176 /** Last sampled cycle. */ 193 177 uint64_t last_cycle; … … 252 236 extern void thread_print_list(void); 253 237 extern void thread_destroy(thread_t *); 254 extern void thread_update_accounting(void); 238 extern thread_t *thread_find_by_id(thread_id_t); 239 extern void thread_update_accounting(bool); 255 240 extern bool thread_exists(thread_t *); 256 241 -
kernel/generic/include/str.h
r38aaacc2 rf4f866c 89 89 extern void wstr_to_str(char *dest, size_t size, const wchar_t *src); 90 90 91 extern char *str_dup(const char *src); 92 extern char *str_ndup(const char *src, size_t n); 93 91 94 extern char *str_chr(const char *str, wchar_t ch); 92 95 … … 94 97 extern bool wstr_remove(wchar_t *str, size_t pos); 95 98 99 extern int str_uint64(const char *, char **, unsigned int, bool, uint64_t *); 100 101 extern void order_suffix(const uint64_t val, uint64_t *rv, char *suffix); 102 96 103 #endif 97 104 -
kernel/generic/include/syscall/syscall.h
r38aaacc2 rf4f866c 71 71 SYS_IPC_REGISTER_IRQ, 72 72 SYS_IPC_UNREGISTER_IRQ, 73 73 74 74 SYS_EVENT_SUBSCRIBE, 75 75 … … 82 82 SYS_PREEMPT_CONTROL, 83 83 84 SYS_SYSINFO_VALID, 85 SYS_SYSINFO_VALUE, 84 SYS_SYSINFO_GET_TAG, 85 SYS_SYSINFO_GET_VALUE, 86 SYS_SYSINFO_GET_DATA_SIZE, 87 SYS_SYSINFO_GET_DATA, 86 88 87 89 SYS_DEBUG_ENABLE_CONSOLE, 88 90 SYS_DEBUG_DISABLE_CONSOLE, 91 89 92 SYS_IPC_CONNECT_KBOX, 90 93 SYSCALL_END -
kernel/generic/include/sysinfo/stats.h
r38aaacc2 rf4f866c 1 1 /* 2 * Copyright (c) 20 05 Jakub Vana2 * Copyright (c) 2010 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 #include <print.h> 30 #include <debug.h> 29 /** @addtogroup generic 30 * @{ 31 */ 32 /** @file 33 */ 31 34 32 #i nclude <test.h>33 # include <sysinfo/sysinfo.h>35 #ifndef KERN_STATS_H_ 36 #define KERN_STATS_H_ 34 37 35 const char *test_sysinfo1(void) 36 { 37 if (!test_quiet) 38 sysinfo_dump(NULL, 0); 39 return NULL; 40 } 38 extern void kload(void *arg); 39 extern void stats_init(void); 40 41 #endif 42 43 /** @} 44 */ -
kernel/generic/include/sysinfo/sysinfo.h
r38aaacc2 rf4f866c 39 39 #include <str.h> 40 40 41 /** Framebuffer info exported flags */ 41 42 extern bool fb_exported; 42 43 43 typedef union sysinfo_item_val { 44 unative_t val; 45 void *fn; 44 /** Item value type 45 * 46 */ 47 typedef enum { 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 */ 53 } sysinfo_item_val_type_t; 54 55 /** Subtree type 56 * 57 */ 58 typedef enum { 59 SYSINFO_SUBTREE_NONE = 0, /**< No subtree (leaf item) */ 60 SYSINFO_SUBTREE_TABLE = 1, /**< Fixed subtree */ 61 SYSINFO_SUBTREE_FUNCTION = 2 /**< Generated subtree */ 62 } sysinfo_subtree_type_t; 63 64 struct sysinfo_item; 65 66 /** Gerated numeric value function */ 67 typedef unative_t (*sysinfo_fn_val_t)(struct sysinfo_item *); 68 69 /** Generated binary data function */ 70 typedef void *(*sysinfo_fn_data_t)(struct sysinfo_item *, size_t *, bool); 71 72 /** Sysinfo item binary data 73 * 74 */ 75 typedef struct { 76 void *data; /**< Data */ 77 size_t size; /**< Size (bytes) */ 78 } sysinfo_data_t; 79 80 /** Sysinfo item value (union) 81 * 82 */ 83 typedef union { 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 */ 46 88 } sysinfo_item_val_t; 47 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 */ 98 typedef struct { 99 sysinfo_item_val_type_t tag; /**< Return value type */ 100 union { 101 unative_t val; /**< Numberic value */ 102 sysinfo_data_t data; /**< Binary data */ 103 }; 104 } sysinfo_return_t; 105 106 /** Generated subtree function */ 107 typedef sysinfo_return_t (*sysinfo_fn_subtree_t)(const char *, bool); 108 109 /** Sysinfo subtree (union) 110 * 111 */ 112 typedef union { 113 struct sysinfo_item *table; /**< Fixed subtree (list of subitems) */ 114 sysinfo_fn_subtree_t get_data; /**< Generated subtree function */ 115 } sysinfo_subtree_t; 116 117 /** Sysinfo item 118 * 119 */ 48 120 typedef struct sysinfo_item { 49 char *name; 50 union { 51 unative_t val; 52 void *fn; 53 } val; 54 55 union { 56 struct sysinfo_item *table; 57 void *fn; 58 } subinfo; 59 60 struct sysinfo_item *next; 61 int val_type; 62 int subinfo_type; 121 char *name; /**< Item name */ 122 123 sysinfo_item_val_type_t val_type; /**< Item value type */ 124 sysinfo_item_val_t val; /**< Item value */ 125 126 sysinfo_subtree_type_t subtree_type; /**< Subtree type */ 127 sysinfo_subtree_t subtree; /**< Subtree */ 128 129 struct sysinfo_item *next; /**< Sibling item */ 63 130 } sysinfo_item_t; 64 131 65 #define SYSINFO_VAL_VAL 0 66 #define SYSINFO_VAL_FUNCTION 1 67 #define SYSINFO_VAL_UNDEFINED U_SPECIAL 132 extern void sysinfo_set_item_val(const char *, sysinfo_item_t **, unative_t); 133 extern void sysinfo_set_item_data(const char *, sysinfo_item_t **, void *, 134 size_t); 135 extern void sysinfo_set_item_fn_val(const char *, sysinfo_item_t **, 136 sysinfo_fn_val_t); 137 extern void sysinfo_set_item_fn_data(const char *, sysinfo_item_t **, 138 sysinfo_fn_data_t); 139 extern void sysinfo_set_item_undefined(const char *, sysinfo_item_t **); 68 140 69 #define SYSINFO_SUBINFO_NONE 0 70 #define SYSINFO_SUBINFO_TABLE 1 71 #define SYSINFO_SUBINFO_FUNCTION 2 141 extern void sysinfo_set_subtree_fn(const char *, sysinfo_item_t **, 142 sysinfo_fn_subtree_t); 72 143 73 typedef unative_t (*sysinfo_val_fn_t)(sysinfo_item_t *root);74 typedef unative_t (*sysinfo_subinfo_fn_t)(const char *subname);144 extern void sysinfo_init(void); 145 extern void sysinfo_dump(sysinfo_item_t *); 75 146 76 typedef struct sysinfo_rettype { 77 unative_t val; 78 unative_t valid; 79 } sysinfo_rettype_t; 80 81 void sysinfo_set_item_val(const char *name, sysinfo_item_t **root, unative_t val); 82 void sysinfo_dump(sysinfo_item_t **root, int depth); 83 void sysinfo_set_item_function(const char *name, sysinfo_item_t **root, sysinfo_val_fn_t fn); 84 void sysinfo_set_item_undefined(const char *name, sysinfo_item_t **root); 85 86 sysinfo_rettype_t sysinfo_get_val(const char *name, sysinfo_item_t **root); 87 88 unative_t sys_sysinfo_valid(unative_t ptr, unative_t len); 89 unative_t sys_sysinfo_value(unative_t ptr, unative_t len); 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); 90 151 91 152 #endif -
kernel/generic/include/time/clock.h
r38aaacc2 rf4f866c 38 38 #include <typedefs.h> 39 39 40 #define HZ 10040 #define HZ 100 41 41 42 42 /** Uptime structure */
Note:
See TracChangeset
for help on using the changeset viewer.
