/trunk/kernel/genarch/include/fb/fb.h |
---|
35,8 → 35,8 |
#ifndef KERN_FB_H_ |
#define KERN_FB_H_ |
#include <typedefs.h> |
#include <arch/types.h> |
#include <synch/spinlock.h> |
extern spinlock_t fb_lock; |
void fb_init(uintptr_t addr, unsigned int x, unsigned int y, unsigned int scan, unsigned int visual); |
/trunk/kernel/genarch/include/mm/page_ht.h |
---|
40,7 → 40,7 |
#define KERN_PAGE_HT_H_ |
#include <mm/page.h> |
#include <typedefs.h> |
#include <synch/mutex.h> |
#include <arch/types.h> |
#include <adt/list.h> |
#include <adt/hash_table.h> |
/trunk/kernel/generic/include/synch/futex.h |
---|
42,12 → 42,12 |
#include <genarch/mm/page_pt.h> |
/** Kernel-side futex structure. */ |
struct futex { |
typedef struct { |
uintptr_t paddr; /**< Physical address of the status variable. */ |
waitq_t wq; /**< Wait queue for threads waiting for futex availability. */ |
link_t ht_link; /**< Futex hash table link. */ |
count_t refcount; /**< Number of tasks that reference this futex. */ |
}; |
} futex_t; |
extern void futex_init(void); |
extern unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags); |
/trunk/kernel/generic/include/synch/condvar.h |
---|
37,12 → 37,12 |
#include <arch/types.h> |
#include <synch/waitq.h> |
#include <typedefs.h> |
#include <synch/mutex.h> |
#include <synch/synch.h> |
struct condvar { |
typedef struct { |
waitq_t wq; |
}; |
} condvar_t; |
#define condvar_wait(cv,mtx) \ |
_condvar_wait_timeout((cv),(mtx),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NONE) |
/trunk/kernel/generic/include/synch/rwlock.h |
---|
41,17 → 41,17 |
#include <synch/synch.h> |
#include <synch/spinlock.h> |
enum rwlock_type { |
typedef enum { |
RWLOCK_NONE, |
RWLOCK_READER, |
RWLOCK_WRITER |
}; |
} rwlock_type_t; |
struct rwlock { |
typedef struct { |
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. */ |
}; |
} rwlock_t; |
#define rwlock_write_lock(rwl) \ |
_rwlock_write_lock_timeout((rwl),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NONE) |
/trunk/kernel/generic/include/synch/mutex.h |
---|
40,9 → 40,9 |
#include <synch/semaphore.h> |
#include <synch/synch.h> |
struct mutex { |
typedef struct { |
semaphore_t sem; |
}; |
} mutex_t; |
#define mutex_lock(mtx) \ |
_mutex_lock_timeout((mtx),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NONE) |
/trunk/kernel/generic/include/synch/spinlock.h |
---|
42,12 → 42,12 |
#include <debug.h> |
#ifdef CONFIG_SMP |
struct spinlock { |
typedef struct { |
#ifdef CONFIG_DEBUG_SPINLOCK |
char *name; |
#endif |
atomic_t val; |
}; |
} spinlock_t; |
/* |
* SPINLOCK_DECLARE is to be used for dynamically allocated spinlocks, |
103,6 → 103,8 |
#else |
typedef void spinlock_t; |
/* On UP systems, spinlocks are effectively left out. */ |
#define SPINLOCK_DECLARE(name) |
#define SPINLOCK_INITIALIZE(name) |
/trunk/kernel/generic/include/synch/semaphore.h |
---|
40,10 → 40,9 |
#include <synch/waitq.h> |
#include <synch/synch.h> |
struct semaphore |
{ |
typedef struct { |
waitq_t wq; |
}; |
} semaphore_t; |
#define semaphore_down(s) \ |
_semaphore_down_timeout((s),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NONE) |
/trunk/kernel/generic/include/synch/waitq.h |
---|
45,7 → 45,7 |
#define WAKEUP_ALL 1 |
/** Wait queue structure. */ |
struct waitq { |
typedef struct { |
/** Lock protecting wait queue structure. |
* |
55,7 → 55,7 |
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. */ |
}; |
} waitq_t; |
#define waitq_sleep(wq) \ |
waitq_sleep_timeout((wq),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NONE) |
/trunk/kernel/generic/include/mm/asid.h |
---|
43,6 → 43,7 |
#ifndef __ASM__ |
#include <arch/mm/asid.h> |
#include <synch/spinlock.h> |
#include <typedefs.h> |
#endif |
/trunk/kernel/generic/include/typedefs.h |
---|
50,15 → 50,6 |
typedef struct task task_t; |
typedef struct thread thread_t; |
typedef struct spinlock spinlock_t; |
typedef struct mutex mutex_t; |
typedef struct semaphore semaphore_t; |
typedef struct rwlock rwlock_t; |
typedef enum rwlock_type rwlock_type_t; |
typedef struct condvar condvar_t; |
typedef struct waitq waitq_t; |
typedef struct futex futex_t; |
typedef struct as_area as_area_t; |
typedef struct as as_t; |