# HG changeset patch # User Michael Spacefalcon # Date 1403484417 0 # Node ID 0dbc1795ff421faa654b14e6d597db8b8cdc8e33 # Parent b23743555ca8d4e31e76174cb07f2797791cffe7 os_sem_fl.c: os_SemaphoreInformation() done diff -r b23743555ca8 -r 0dbc1795ff42 gsm-fw/gpf/osl/os_sem_fl.c --- a/gsm-fw/gpf/osl/os_sem_fl.c Mon Jun 23 00:23:49 2014 +0000 +++ b/gsm-fw/gpf/osl/os_sem_fl.c Mon Jun 23 00:46:57 2014 +0000 @@ -43,3 +43,23 @@ } else return(OS_ERROR); } + +GLOBAL LONG +os_SemaphoreInformation(USHORT Index, char *Buffer) +{ + OS_HANDLE Handle; + OPTION SuspendType; + UNSIGNED Current, TasksWaiting; + NU_TASK *First; + CHAR Name[NU_MAX_NAME]; + + if (os_GetSemaphoreEntry(Index, &Handle) < 0) + return(OS_ERROR); + if (NU_Semaphore_Information(&SemTable[Handle].SemCB, Name, &Current, + &SuspendType, &TasksWaiting, &First) + != NU_SUCCESS) + return(OS_ERROR); + sprintf(Buffer, "Semname:%s Count:%ld Suspend:%d Waiting:%ld", Name, + Current, SuspendType, TasksWaiting); + return(OS_OK); +}