X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=kern%2Fsem.c;h=7b3b472965999f53b13ac200af5ac1260ceed101;hb=0c154bc0927a32f77467f32aac3cc3507baa97ca;hp=eab3e5db475d26a1d2b46b5eb46429c69d30ae7c;hpb=3a77131c5f9f16bd97c08bc5dd2e0c9333c75259;p=bertos.git diff --git a/kern/sem.c b/kern/sem.c index eab3e5db..7b3b4729 100755 --- a/kern/sem.c +++ b/kern/sem.c @@ -3,7 +3,7 @@ * * * \brief Semaphore based synchronization services. @@ -15,6 +15,15 @@ /*#* *#* $Log$ + *#* Revision 1.11 2006/02/24 01:17:05 bernie + *#* Update for new emulator. + *#* + *#* Revision 1.10 2005/11/04 16:20:02 bernie + *#* Fix reference to README.devlib in header. + *#* + *#* Revision 1.9 2005/04/11 19:10:28 bernie + *#* Include top-level headers from cfg/ subdir. + *#* *#* Revision 1.8 2005/01/22 04:20:42 bernie *#* Add integrity checks. *#* @@ -41,11 +50,10 @@ *#*/ #include "sem.h" -#include "proc.h" -#include "proc_p.h" -#include "signal.h" -#include "hw.h" -#include +#include +#include +#include +#include INLINE void sem_verify(struct Semaphore *s) { @@ -133,7 +141,7 @@ void sem_obtain(struct Semaphore *s) } else { - ASSERT(ISLISTEMPTY(&s->wait_queue)); + ASSERT(LIST_EMPTY(&s->wait_queue)); /* The semaphore was free: lock it */ s->owner = CurrentProcess; @@ -175,7 +183,7 @@ void sem_release(struct Semaphore *s) s->owner = NULL; /* Give semaphore to the first applicant, if any */ - if (UNLIKELY((proc = (Process *)REMHEAD(&s->wait_queue)))) + if (UNLIKELY((proc = (Process *)list_remHead(&s->wait_queue)))) { s->nest_count = 1; s->owner = proc;