changeset 507:8fdcb8e01bbf

osx.c: _osx_open() done
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 01 Jul 2014 19:46:44 +0000
parents 65c9bd2eed85
children e3b597f858ce
files gsm-fw/gpf/osx/osx.c
diffstat 1 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/gpf/osx/osx.c	Tue Jul 01 19:33:07 2014 +0000
+++ b/gsm-fw/gpf/osx/osx.c	Tue Jul 01 19:46:44 2014 +0000
@@ -13,7 +13,7 @@
 
 int osx_config = 2;
 int _caller;
-T_OSX_REGISTER _osx_registry[7];
+T_OSX_REGISTER _osx_registry[MAX_OSX_QUEUE];
 
 void
 int_osx_send_sig(int caller, unsigned long opc, void *signal_ptr,
@@ -180,3 +180,20 @@
 {
 	return int_osx_alloc_mem(_caller, len);
 }
+
+int
+_osx_open(int caller, unsigned short queue_type, int queue_handle)
+{
+	if (!queue_type && !queue_handle) {
+		_caller = caller;
+		return(OSX_ERROR);
+	}
+	if (queue_type >= MAX_OSX_QUEUE)
+		return(OSX_ERROR);
+	if (_osx_registry[queue_type].queue_handle != queue_handle &&
+	    _osx_registry[queue_type].queue_handle != -1)
+		return(OSX_ERROR);
+	_osx_registry[queue_type].queue_handle = queue_handle;
+	_osx_registry[queue_type].caller = caller;
+	return(OSX_OK);
+}