Changes in kernel/generic/include/proc/task.h [41df2827:ee42e43] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/proc/task.h
r41df2827 ree42e43 1 1 /* 2 * Copyright (c) 20 01-2004Jakub Jermar2 * Copyright (c) 2010 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 40 40 #include <synch/spinlock.h> 41 41 #include <synch/mutex.h> 42 #include <synch/rwlock.h>43 42 #include <synch/futex.h> 44 43 #include <adt/avl.h> … … 56 55 #include <ipc/kbox.h> 57 56 #include <mm/as.h> 58 59 #define TASK_NAME_BUFLEN 20 57 #include <sysinfo/abi.h> 60 58 61 59 struct thread; … … 71 69 * threads. 72 70 */ 73 SPINLOCK_DECLARE(lock);74 71 IRQ_SPINLOCK_DECLARE(lock); 72 75 73 char name[TASK_NAME_BUFLEN]; 76 74 /** List of threads contained in this task. */ … … 81 79 task_id_t taskid; 82 80 /** Task security context. */ 83 context_id_t context; 84 81 context_id_t context; 82 85 83 /** Number of references (i.e. threads). */ 86 84 atomic_t refcount; 87 85 /** Number of threads that haven't exited yet. */ 88 86 atomic_t lifecount; 89 87 90 88 /** Task capabilities. */ 91 cap_t capabilities; 92 89 cap_t capabilities; 90 93 91 /* IPC stuff */ 94 92 answerbox_t answerbox; /**< Communication endpoint */ 95 93 phone_t phones[IPC_MAX_PHONES]; 94 stats_ipc_t ipc_info; /**< IPC statistics */ 96 95 /** 97 96 * Active asynchronous messages. It is used for limiting uspace to … … 101 100 /** List of synchronous answerboxes. */ 102 101 link_t sync_box_head; 103 102 104 103 #ifdef CONFIG_UDEBUG 105 104 /** Debugging stuff. */ 106 105 udebug_task_t udebug; 107 106 108 107 /** Kernel answerbox. */ 109 108 kbox_t kb; 110 #endif 111 109 #endif /* CONFIG_UDEBUG */ 110 112 111 /** Architecture specific task data. */ 113 112 task_arch_t arch; … … 119 118 mutex_t futexes_lock; 120 119 /** B+tree of futexes referenced by this task. */ 121 btree_t futexes; 120 btree_t futexes; 122 121 123 122 /** Accumulated accounting. */ 124 uint64_t cycles; 123 uint64_t ucycles; 124 uint64_t kcycles; 125 125 } task_t; 126 126 127 SPINLOCK_EXTERN(tasks_lock);127 IRQ_SPINLOCK_EXTERN(tasks_lock); 128 128 extern avltree_t tasks_tree; 129 129 130 130 extern void task_init(void); 131 131 extern void task_done(void); 132 extern task_t *task_create(as_t *as, char *name); 133 extern void task_destroy(task_t *t); 134 extern task_t *task_find_by_id(task_id_t id); 135 extern int task_kill(task_id_t id); 136 extern uint64_t task_get_accounting(task_t *t); 137 extern void task_print_list(void); 132 extern task_t *task_create(as_t *, const char *); 133 extern void task_destroy(task_t *); 134 extern void task_hold(task_t *); 135 extern void task_release(task_t *); 136 extern task_t *task_find_by_id(task_id_t); 137 extern int task_kill(task_id_t); 138 extern void task_get_accounting(task_t *, uint64_t *, uint64_t *); 139 extern void task_print_list(bool); 138 140 139 extern void cap_set(task_t * t, cap_t caps);140 extern cap_t cap_get(task_t * t);141 extern void cap_set(task_t *, cap_t); 142 extern cap_t cap_get(task_t *); 141 143 142 144 #ifndef task_create_arch 143 extern void task_create_arch(task_t * t);145 extern void task_create_arch(task_t *); 144 146 #endif 145 147 146 148 #ifndef task_destroy_arch 147 extern void task_destroy_arch(task_t * t);149 extern void task_destroy_arch(task_t *); 148 150 #endif 149 151 150 extern unative_t sys_task_get_id(task_id_t * uspace_task_id);151 extern unative_t sys_task_set_name(const char * uspace_name, size_t name_len);152 extern unative_t sys_task_get_id(task_id_t *); 153 extern unative_t sys_task_set_name(const char *, size_t); 152 154 153 155 #endif
Note:
See TracChangeset
for help on using the changeset viewer.