/kernel/trunk/generic/include/time/timeout.h |
---|
39,7 → 39,7 |
typedef void (* timeout_handler_t)(void *arg); |
struct timeout { |
spinlock_t lock; |
SPINLOCK_DECLARE(lock); |
link_t link; /**< Link to the list of active timeouts on THE->cpu */ |
/kernel/trunk/generic/include/proc/scheduler.h |
---|
40,7 → 40,7 |
/** Scheduler run queue structure. */ |
struct runq { |
spinlock_t lock; |
SPINLOCK_DECLARE(lock); |
link_t rq_head; /**< List of ready threads. */ |
count_t n; /**< Number of threads in rq_ready. */ |
}; |
/kernel/trunk/generic/include/proc/task.h |
---|
34,7 → 34,7 |
#include <list.h> |
struct task { |
spinlock_t lock; |
SPINLOCK_DECLARE(lock); |
link_t th_head; /**< List of threads contained in this task. */ |
link_t tasks_link; /**< Link to other tasks within the system. */ |
vm_t *vm; |
/kernel/trunk/generic/include/proc/thread.h |
---|
70,7 → 70,7 |
* Must be acquired before T.lock for each T of type task_t. |
* |
*/ |
spinlock_t lock; |
SPINLOCK_DECLARE(lock); |
void (* thread_code)(void *); /**< Function implementing the thread. */ |
void *thread_arg; /**< Argument passed to thread_code() function. */ |
/kernel/trunk/generic/include/cpu.h |
---|
42,7 → 42,7 |
#define CPU_STACK_SIZE STACK_SIZE |
struct cpu { |
spinlock_t lock; |
SPINLOCK_DECLARE(lock); |
context_t saved_context; |
volatile count_t nrdy; |
49,7 → 49,7 |
runq_t rq[RQ_COUNT]; |
volatile count_t needs_relink; |
spinlock_t timeoutlock; |
SPINLOCK_DECLARE(timeoutlock); |
link_t timeout_active_head; |
#ifdef CONFIG_SMP |
/kernel/trunk/generic/include/synch/rwlock.h |
---|
33,6 → 33,7 |
#include <typedefs.h> |
#include <synch/mutex.h> |
#include <synch/synch.h> |
#include <synch/spinlock.h> |
enum rwlock_type { |
RWLOCK_NONE, |
41,7 → 42,7 |
}; |
struct rwlock { |
spinlock_t lock; |
SPINLOCK_DECLARE(lock); |
mutex_t exclusive; /**< Mutex for writers, readers can bypass it if readers_in is positive. */ |
count_t readers_in; /**< Number of readers in critical section. */ |
}; |
/kernel/trunk/generic/include/synch/spinlock.h |
---|
41,6 → 41,29 |
int val; |
}; |
/* |
* SPINLOCK_DECLARE is to be used for dynamically allocated spinlocks, |
* where the lock gets initialized in run time. |
*/ |
#define SPINLOCK_DECLARE(slname) spinlock_t slname |
/* |
* SPINLOCK_INITIALIZE is to be used for statically allocated spinlocks. |
* It declares and initializes the lock. |
*/ |
#ifdef CONFIG_DEBUG_SPINLOCK |
#define SPINLOCK_INITIALIZE(slname) \ |
spinlock_t slname = { \ |
.name = #slname, \ |
.val = 0 \ |
} |
#else |
#define SPINLOCK_INITIALIZE(slname) \ |
spinlock_t slname = { \ |
.val = 0 \ |
} |
#endif |
extern void spinlock_initialize(spinlock_t *sl, char *name); |
extern void spinlock_lock(spinlock_t *sl); |
extern int spinlock_trylock(spinlock_t *sl); |
48,8 → 71,9 |
#else |
struct spinlock { |
}; |
/* On UP systems, spinlocks are effectively left out. */ |
#define SPINLOCK_DECLARE(name) |
#define SPINLOCK_INITIALIZE(name) |
#define spinlock_initialize(x,name) |
#define spinlock_lock(x) preemption_disable() |
/kernel/trunk/generic/include/synch/waitq.h |
---|
45,7 → 45,7 |
* |
* Must be acquired before T.lock for each T of type thread_t. |
*/ |
spinlock_t lock; |
SPINLOCK_DECLARE(lock); |
int missed_wakeups; /**< Number of waitq_wakeup() calls that didn't find a thread to wake up. */ |
link_t head; /**< List of sleeping threads for wich there was no missed_wakeup. */ |
/kernel/trunk/generic/include/console/chardev.h |
---|
52,7 → 52,7 |
char *name; |
waitq_t wq; |
spinlock_t lock; /**< Protects everything below. */ |
SPINLOCK_DECLARE(lock); /**< Protects everything below. */ |
__u8 buffer[CHARDEV_BUFLEN]; |
count_t counter; |
chardev_operations_t *op; /**< Implementation of chardev operations. */ |
/kernel/trunk/generic/include/console/kconsole.h |
---|
55,7 → 55,7 |
/** Structure representing one kconsole command. */ |
struct cmd_info { |
link_t link; /**< Command list link. */ |
spinlock_t lock; /**< This lock protects everything below. */ |
SPINLOCK_DECLARE(lock); /**< This lock protects everything below. */ |
const char *name; /**< Command name. */ |
const char *description; /**< Textual description. */ |
int (* func)(cmd_arg_t *); /**< Function implementing the command. */ |
/kernel/trunk/generic/include/mm/frame.h |
---|
54,7 → 54,7 |
struct zone { |
link_t link; /**< link to previous and next zone */ |
spinlock_t lock; /**< this lock protects everything below */ |
SPINLOCK_DECLARE(lock); /**< this lock protects everything below */ |
__address base; /**< physical address of the first frame in the frames array */ |
frame_t *frames; /**< array of frame_t structures in this zone */ |
count_t free_count; /**< number of free frame_t structures */ |
/kernel/trunk/generic/include/mm/vm.h |
---|
57,7 → 57,7 |
* In the future, it should not be difficult to support shared areas of vm. |
*/ |
struct vm_area { |
spinlock_t lock; |
SPINLOCK_DECLARE(lock); |
link_t link; |
vm_type_t type; |
int size; |
72,7 → 72,7 |
* set up during system initialization. |
*/ |
struct vm { |
spinlock_t lock; |
SPINLOCK_DECLARE(lock); |
link_t vm_area_head; |
pte_t *ptl0; |
asid_t asid; |