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