/SPARTAN/trunk/generic/include/synch/rwlock.h |
---|
43,7 → 43,7 |
struct rwlock { |
spinlock_t lock; |
mutex_t exclusive; /**< Mutex for writers, readers can bypass it if readers_in is positive. */ |
int readers_in; /**< Number of readers in critical section. */ |
count_t readers_in; /**< Number of readers in critical section. */ |
}; |
#define rwlock_write_lock(rwl) \ |
/SPARTAN/trunk/generic/include/config.h |
---|
35,8 → 35,8 |
#define STACK_SIZE PAGE_SIZE |
#define CONFIG_MEMORY_SIZE 8*1024*1024 |
#define CONFIG_HEAP_SIZE 300*1024 |
#define CONFIG_MEMORY_SIZE (8*1024*1024) |
#define CONFIG_HEAP_SIZE (300*1024) |
#define CONFIG_STACK_SIZE STACK_SIZE |
struct config { |
/SPARTAN/trunk/generic/include/arch.h |
---|
52,7 → 52,7 |
* the bottom of the stack. |
*/ |
struct the { |
int preemption_disabled; /**< Preemption disabled counter. */ |
count_t preemption_disabled; /**< Preemption disabled counter. */ |
thread_t *thread; /**< Current thread. */ |
task_t *task; /**< Current task. */ |
cpu_t *cpu; /**< Executing cpu. */ |
/SPARTAN/trunk/generic/include/proc/scheduler.h |
---|
38,10 → 38,11 |
#define RQ_COUNT 16 |
#define NEEDS_RELINK_MAX (HZ) |
/** Scheduler run queue structure. */ |
struct runq { |
spinlock_t lock; |
link_t rq_head; /**< List of ready threads. */ |
int n; /**< Number of threads in rq_ready. */ |
count_t n; /**< Number of threads in rq_ready. */ |
}; |
extern atomic_t nrdy; |
51,11 → 52,12 |
extern void scheduler(void); |
extern void kcpulb(void *arg); |
extern void before_thread_runs(void); |
/* |
* To be defined by architectures: |
*/ |
extern void before_thread_runs(void); |
extern void before_thread_runs_arch(void); |
#endif |
/SPARTAN/trunk/generic/include/typedefs.h |
---|
39,7 → 39,6 |
typedef unsigned int index_t; |
typedef struct config config_t; |
typedef struct cpu_private_data cpu_private_data_t; |
typedef struct cpu_info cpu_info_t; |
typedef struct cpu cpu_t; |
/SPARTAN/trunk/generic/include/cpu.h |
---|
45,9 → 45,9 |
spinlock_t lock; |
context_t saved_context; |
volatile int nrdy; |
volatile count_t nrdy; |
runq_t rq[RQ_COUNT]; |
volatile int needs_relink; |
volatile count_t needs_relink; |
spinlock_t timeoutlock; |
link_t timeout_active_head; |
/SPARTAN/trunk/generic/src/proc/scheduler.c |
---|
50,7 → 50,6 |
atomic_t nrdy; |
/** Take actions before new thread runs |
* |
* Perform actions that need to be |
116,7 → 115,7 |
* @return Thread to be scheduled. |
* |
*/ |
static struct thread *find_best_thread(void) |
static thread_t *find_best_thread(void) |
{ |
thread_t *t; |
runq_t *r; |