Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1586 → Rev 1587

/kernel/trunk/generic/include/proc/task.h
92,6 → 92,10
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/generic/src/proc/task.c
140,6 → 140,26
*/
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
258,6 → 278,8
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,8 → 147,10
ipl = interrupts_disable();
spinlock_lock(&inactive_as_with_asid_lock);
if (as->asid != ASID_INVALID && as->asid != ASID_KERNEL) {
list_remove(&as->inactive_as_with_asid_link);
 
if (as->asid != ASID_INVALID && as != AS_KERNEL) {
if (!as->cpu_refcount)
list_remove(&as->inactive_as_with_asid_link);
asid_put(as->asid);
}
spinlock_unlock(&inactive_as_with_asid_lock);
/kernel/trunk/arch/sparc64/include/proc/task.h
33,5 → 33,6
} task_arch_t;
 
#define task_create_arch(t)
#define task_destroy_arch(t)
 
#endif
/kernel/trunk/arch/ia64/include/proc/task.h
33,5 → 33,6
} task_arch_t;
 
#define task_create_arch(t)
#define task_destroy_arch(t)
 
#endif
/kernel/trunk/arch/ppc32/include/proc/task.h
33,5 → 33,6
} task_arch_t;
 
#define task_create_arch(t)
#define task_destroy_arch(t)
 
#endif
/kernel/trunk/arch/amd64/src/proc/task.c
27,6 → 27,7
*/
 
#include <proc/task.h>
#include <mm/slab.h>
#include <arch/types.h>
 
/** Perform amd64 specific task initialization.
38,3 → 39,13
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,5 → 33,6
} task_arch_t;
 
#define task_create_arch(t)
#define task_destroy_arch(t)
 
#endif
/kernel/trunk/arch/mips32/include/proc/task.h
33,5 → 33,6
} task_arch_t;
 
#define task_create_arch(t)
#define task_destroy_arch(t)
 
#endif
/kernel/trunk/arch/ia32/src/proc/task.c
29,6 → 29,7
#include <proc/task.h>
#include <arch/types.h>
#include <adt/bitmap.h>
#include <mm/slab.h>
 
/** Perform ia32 specific task initialization.
*
39,3 → 40,13
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);
}