/SPARTAN/trunk/src/synch/semaphore.c |
---|
30,6 → 30,7 |
#include <synch/semaphore.h> |
#include <synch/waitq.h> |
#include <synch/spinlock.h> |
#include <arch/asm.h> |
void semaphore_initialize(semaphore_t *s, int val) |
{ |
/SPARTAN/trunk/src/debug/print.c |
---|
30,6 → 30,7 |
#include <print.h> |
#include <synch/spinlock.h> |
#include <arch/arg.h> |
#include <arch/asm.h> |
static char digits[] = "0123456789abcdef"; /**< Hexadecimal characters */ |
/SPARTAN/trunk/src/proc/scheduler.c |
---|
131,7 → 131,7 |
continue; |
} |
/* avoid deadlock with relink_rq */ |
/* avoid deadlock with relink_rq() */ |
if (!spinlock_trylock(&CPU->lock)) { |
/* |
* Unlock r and try again. |
446,7 → 446,6 |
cpu_t *cpu; |
cpu = &cpus[(i + k) % config.cpu_active]; |
r = &cpu->rq[j]; |
/* |
* Not interested in ourselves. |
453,9 → 452,10 |
* Doesn't require interrupt disabling for kcpulb is X_WIRED. |
*/ |
if (CPU == cpu) |
continue; |
continue; |
restart: pri = cpu_priority_high(); |
r = &cpu->rq[j]; |
spinlock_lock(&r->lock); |
if (r->n == 0) { |
spinlock_unlock(&r->lock); |
470,10 → 470,11 |
/* |
* We don't want to steal CPU-wired threads neither threads already stolen. |
* The latter prevents threads from migrating between CPU's without ever being run. |
* We don't want to steal threads whose FPU context is still in CPU |
* We don't want to steal threads whose FPU context is still in CPU. |
*/ |
spinlock_lock(&t->lock); |
if ( (!(t->flags & (X_WIRED | X_STOLEN))) && (!(t->fpu_context_engaged)) ) { |
/* |
* Remove t from r. |
*/ |
/SPARTAN/trunk/src/proc/thread.c |
---|
176,7 → 176,7 |
frame_ks = frame_alloc(FRAME_KA); |
if (THREAD_USER_STACK & flags) { |
frame_us = frame_alloc(0); |
frame_us = frame_alloc(FRAME_KA); |
} |
pri = cpu_priority_high(); |
/SPARTAN/trunk/src/mm/vm.c |
---|
38,6 → 38,7 |
#include <config.h> |
#include <list.h> |
#include <panic.h> |
#include <arch/asm.h> |
vm_t *vm_create(void) |
{ |
/SPARTAN/trunk/src/mm/frame.c |
---|
42,6 → 42,8 |
#include <synch/spinlock.h> |
#include <arch/asm.h> |
count_t frames = 0; |
count_t frames_free; |
/SPARTAN/trunk/src/mm/heap.c |
---|
32,6 → 32,7 |
#include <memstr.h> |
#include <panic.h> |
#include <arch/types.h> |
#include <arch/asm.h> |
/* |
* First-fit algorithm. |