changeset 442:0dbc1795ff42

os_sem_fl.c: os_SemaphoreInformation() done
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 23 Jun 2014 00:46:57 +0000
parents b23743555ca8
children 42f9e12a9ced
files gsm-fw/gpf/osl/os_sem_fl.c
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);
+}