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