FreeCalypso > hg > freecalypso-sw
changeset 446:57f8e2b747c4
os_sem_fl.c: os_OpenSemaphore() done
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 23 Jun 2014 01:31:11 +0000 |
parents | 9eeeef3ff7db |
children | b55882290007 |
files | gsm-fw/gpf/osl/os_sem_fl.c |
diffstat | 1 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/gsm-fw/gpf/osl/os_sem_fl.c Mon Jun 23 01:19:50 2014 +0000 +++ b/gsm-fw/gpf/osl/os_sem_fl.c Mon Jun 23 01:31:11 2014 +0000 @@ -112,3 +112,19 @@ *Count = SemCount; return(OS_OK); } + +GLOBAL LONG +os_OpenSemaphore(OS_HANDLE TaskHandle, char *Name, OS_HANDLE *SemHandle) +{ + USHORT i; + + for (i = 1; i <= MaxSemaphores; i++) { + if (!SemTable[i].Name[0]) + continue; + if (strncmp(Name, SemTable[i].Name, RESOURCE_NAMELEN-1)) + continue; + *SemHandle = i; + return(OS_OK); + } + return(OS_ERROR); +}