/kernel/trunk/generic/src/proc/task.c |
---|
140,26 → 140,6 |
*/ |
void task_destroy(task_t *t) |
{ |
spinlock_lock(&tasks_lock); |
btree_remove(&tasks_btree, t->taskid, NULL); |
spinlock_unlock(&tasks_lock); |
task_destroy_arch(t); |
btree_destroy(&t->futexes); |
mutex_lock_active(&t->as->lock); |
if (--t->as->refcount == 0) { |
mutex_unlock(&t->as->lock); |
as_destroy(t->as); |
/* |
* t->as is destroyed. |
*/ |
} else { |
mutex_unlock(&t->as->lock); |
} |
free(t); |
TASK = NULL; |
} |
/** Create new task with 1 thread and run it |
278,8 → 258,6 |
spinlock_lock(&ta->lock); |
ta->refcount++; |
spinlock_unlock(&ta->lock); |
spinlock_unlock(&tasks_lock); |
t = thread_create(ktaskclnp, NULL, ta, 0, "ktaskclnp"); |
/kernel/trunk/generic/src/mm/as.c |
---|
147,10 → 147,8 |
ipl = interrupts_disable(); |
spinlock_lock(&inactive_as_with_asid_lock); |
if (as->asid != ASID_INVALID && as != AS_KERNEL) { |
if (!as->cpu_refcount) |
list_remove(&as->inactive_as_with_asid_link); |
if (as->asid != ASID_INVALID && as->asid != ASID_KERNEL) { |
list_remove(&as->inactive_as_with_asid_link); |
asid_put(as->asid); |
} |
spinlock_unlock(&inactive_as_with_asid_lock); |
/kernel/trunk/generic/include/proc/task.h |
---|
92,10 → 92,6 |
extern void task_create_arch(task_t *t); |
#endif |
#ifndef task_destroy_arch |
extern void task_destroy_arch(task_t *t); |
#endif |
extern __native sys_task_get_id(task_id_t *uspace_task_id); |
#endif |
/kernel/trunk/arch/ia32/src/proc/task.c |
---|
29,7 → 29,6 |
#include <proc/task.h> |
#include <arch/types.h> |
#include <adt/bitmap.h> |
#include <mm/slab.h> |
/** Perform ia32 specific task initialization. |
* |
40,13 → 39,3 |
t->arch.iomapver = 0; |
bitmap_initialize(&t->arch.iomap, NULL, 0); |
} |
/** Perform ia32 specific task destruction. |
* |
* @param t Task to be initialized. |
*/ |
void task_destroy_arch(task_t *t) |
{ |
if (t->arch.iomap.map) |
free(t->arch.iomap.map); |
} |
/kernel/trunk/arch/ia64/include/proc/task.h |
---|
33,6 → 33,5 |
} task_arch_t; |
#define task_create_arch(t) |
#define task_destroy_arch(t) |
#endif |
/kernel/trunk/arch/mips32/include/proc/task.h |
---|
33,6 → 33,5 |
} task_arch_t; |
#define task_create_arch(t) |
#define task_destroy_arch(t) |
#endif |
/kernel/trunk/arch/sparc64/include/proc/task.h |
---|
33,6 → 33,5 |
} task_arch_t; |
#define task_create_arch(t) |
#define task_destroy_arch(t) |
#endif |
/kernel/trunk/arch/ppc32/include/proc/task.h |
---|
33,6 → 33,5 |
} task_arch_t; |
#define task_create_arch(t) |
#define task_destroy_arch(t) |
#endif |
/kernel/trunk/arch/amd64/src/proc/task.c |
---|
27,7 → 27,6 |
*/ |
#include <proc/task.h> |
#include <mm/slab.h> |
#include <arch/types.h> |
/** Perform amd64 specific task initialization. |
39,13 → 38,3 |
t->arch.iomapver = 0; |
bitmap_initialize(&t->arch.iomap, NULL, 0); |
} |
/** Perform amd64 specific task destruction. |
* |
* @param t Task to be initialized. |
*/ |
void task_destroy_arch(task_t *t) |
{ |
if (t->arch.iomap.map) |
free(t->arch.iomap.map); |
} |
/kernel/trunk/arch/ppc64/include/proc/task.h |
---|
33,6 → 33,5 |
} task_arch_t; |
#define task_create_arch(t) |
#define task_destroy_arch(t) |
#endif |