diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-07-04 17:47:11 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-07-04 17:47:11 +0100 |
commit | ce5c899f22106926ca50c153a600b537d08970bc (patch) | |
tree | e23cbd3e5901a3178957ee36b22f1277832858b2 /extras/mini-os/include/sys | |
parent | 355b0469a8d017b80d9ce1078c90fe628c8b3bbe (diff) | |
download | xen-ce5c899f22106926ca50c153a600b537d08970bc.tar.gz xen-ce5c899f22106926ca50c153a600b537d08970bc.tar.bz2 xen-ce5c899f22106926ca50c153a600b537d08970bc.zip |
stubdom: use host's gcc
This makes stubdom use the host's gcc instead of downloading/compiling
binutils+gcc. That requires a bunch of changes and even uncovered a
few bugs, but saves a lot of time.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'extras/mini-os/include/sys')
-rw-r--r-- | extras/mini-os/include/sys/lock.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/extras/mini-os/include/sys/lock.h b/extras/mini-os/include/sys/lock.h new file mode 100644 index 0000000000..0757a749dd --- /dev/null +++ b/extras/mini-os/include/sys/lock.h @@ -0,0 +1,52 @@ +#ifndef _MINIOS_SYS_LOCK_H_ +#define _MINIOS_SYS_LOCK_H_ + +#ifdef HAVE_LIBC + +/* Due to inclusion loop, we can not include sched.h, so have to hide things */ + +#include <waittypes.h> + + +typedef struct { + int busy; + struct wait_queue_head wait; +} _LOCK_T; + +#define __LOCK_INIT(class,lock) \ + class _LOCK_T lock = { .wait = __WAIT_QUEUE_HEAD_INITIALIZER(lock.wait) } +int ___lock_init(_LOCK_T *lock); +int ___lock_acquire(_LOCK_T *lock); +int ___lock_try_acquire(_LOCK_T *lock); +int ___lock_release(_LOCK_T *lock); +int ___lock_close(_LOCK_T *lock); +#define __lock_init(__lock) ___lock_init(&__lock) +#define __lock_acquire(__lock) ___lock_acquire(&__lock) +#define __lock_release(__lock) ___lock_release(&__lock) +#define __lock_try_acquire(__lock) ___lock_try_acquire(&__lock) +#define __lock_close(__lock) 0 + + +typedef struct { + struct thread *owner; + int count; + struct wait_queue_head wait; +} _LOCK_RECURSIVE_T; + +#define __LOCK_INIT_RECURSIVE(class, lock) \ + class _LOCK_RECURSIVE_T lock = { .wait = __WAIT_QUEUE_HEAD_INITIALIZER((lock).wait) } + +int ___lock_init_recursive(_LOCK_RECURSIVE_T *lock); +int ___lock_acquire_recursive(_LOCK_RECURSIVE_T *lock); +int ___lock_try_acquire_recursive(_LOCK_RECURSIVE_T *lock); +int ___lock_release_recursive(_LOCK_RECURSIVE_T *lock); +int ___lock_close_recursive(_LOCK_RECURSIVE_T *lock); +#define __lock_init_recursive(__lock) ___lock_init_recursive(&__lock) +#define __lock_acquire_recursive(__lock) ___lock_acquire_recursive(&__lock) +#define __lock_release_recursive(__lock) ___lock_release_recursive(&__lock) +#define __lock_try_acquire_recursive(__lock) ___lock_try_acquire_recursive(&__lock) +#define __lock_close_recursive(__lock) 0 + +#endif + +#endif /* _MINIOS_SYS_LOCK_H_ */ |