OpenClovis Logo

clHandleApi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2012 OpenClovis Solutions Inc. All Rights Reserved.
3  *
4  * This file is available under a commercial license from the
5  * copyright holder or the GNU General Public License Version 2.0.
6  *
7  * The source code for this program is not published or otherwise
8  * divested of its trade secrets, irrespective of what has been
9  * deposited with the U.S. Copyright office.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * For more information, see the file COPYING provided with this
17  * material.
18  */
19 /*******************************************************************************
20  * ModuleName : utils
21  * File : clHandleApi.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  *
27  * This is the interface to a client side handle management service.
28  *
29  * Part of this code was inspired by the openais code, hence I retained
30  * the copyright below.
31  *
32  *
33  *****************************************************************************/
34 
35 /*
36  * Copyright (c) 2002-2003 MontaVista Software, Inc.
37  *
38  * All rights reserved.
39  *
40  * Author: Steven Dake (sdake@mvista.com)
41  *
42  * This software licensed under BSD license, the text of which follows:
43  *
44  * Redistribution and use in source and binary forms, with or without
45  * modification, are permitted provided that the following conditions are met:
46  *
47  * - Redistributions of source code must retain the above copyright notice,
48  * this list of conditions and the following disclaimer.
49  * - Redistributions in binary form must reproduce the above copyright notice,
50  * this list of conditions and the following disclaimer in the documentation
51  * and/or other materials provided with the distribution.
52  * - Neither the name of the MontaVista Software, Inc. nor the names of its
53  * contributors may be used to endorse or promote products derived from this
54  * software without specific prior written permission.
55  *
56  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
57  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
58  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
59  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
60  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
61  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
62  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
63  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
64  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
66  * THE POSSIBILITY OF SUCH DAMAGE.
67  */
68 
80 #ifndef _CL_HANDLE_API_H_
81 #define _CL_HANDLE_API_H_
82 
83 #ifdef __cplusplus
84 extern "C"
85 {
86 #endif
87 
88 #include <clCommon.h>
89 #include <clIocApi.h>
90 
95 #define CL_HANDLE_INVALID_VALUE 0x0
96 #define CL_HDL_IDX_MASK 0x00000000FFFFFFFFULL
97 #define CL_HDL_IDX(hdl) (ClUint32T)( (hdl) & CL_HDL_IDX_MASK)
98 
99 #define CL_HDL_NODE_ADDR_MASK 0xFFF0000000000000ULL
100 #define CL_HDL_PORT_ADDR_MASK 0x000FFF0000000000ULL
101 #define CL_HDL_DB_ADDR_MASK 0x000000FF00000000ULL
102 
103 #define CL_HDL_NODE_ADDR(hdl) ((((ClUint64T)hdl)&CL_HDL_NODE_ADDR_MASK)>>52)
104 #define CL_HDL_PORT_ADDR(hdl) ((((ClUint64T)hdl)&CL_HDL_PORT_ADDR_MASK)>>40)
105 #define CL_HDL_DB_ADDR(hdl) ((((ClUint64T)hdl)&CL_HDL_DB_ADDR_MASK)>>32)
106 
110 typedef ClPtrT ClHandleDatabaseHandleT;
111 
146  CL_IN void (*destructor)(void*),
147  CL_OUT ClHandleDatabaseHandleT *databaseHandle);
148 
176  CL_IN ClHandleDatabaseHandleT databaseHandle);
177 
213  CL_IN ClHandleDatabaseHandleT databaseHandle,
214  CL_IN ClInt32T instanceSize,
215  CL_OUT ClHandleT *handle);
216 
253 extern ClRcT
255  CL_IN ClHandleDatabaseHandleT databaseHandle,
256  CL_IN ClInt32T instance_size,
257  CL_IN ClIocPhysicalAddressT compAddr,
258  CL_OUT ClHandleT *handle_out);
259 
297  CL_IN ClHandleDatabaseHandleT databaseHandle,
298  CL_IN ClHandleT handle);
299 
334  CL_IN ClHandleDatabaseHandleT databaseHandle,
335  CL_IN ClHandleT handle,
336  CL_OUT void **instance);
337 
369  CL_IN ClHandleDatabaseHandleT databaseHandle,
370  CL_IN ClHandleT handle);
371 
372 extern ClRcT clHandleMove(
373  CL_IN ClHandleDatabaseHandleT databaseHandle,
374  CL_IN ClHandleT oldHandle,
375  CL_IN ClHandleT newHandle);
376 
402 
403 #ifdef __cplusplus
404 }
405 #endif
406 
407 #endif /* _CL_HANDLE_API_H_ */
408 
409 
Typical defines found in any software project.
Header file of Ioc Data Structures and APIs.
ClUint32T ClRcT
Clovis return code type.
Definition: clCommon.h:168
#define CL_OUT
CL_OUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:110
#define CL_IN
CL_IN macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:106
ClRcT clHandleWithAddressCreate(CL_IN ClHandleDatabaseHandleT databaseHandle, CL_IN ClInt32T instance_size, CL_IN ClIocPhysicalAddressT compAddr, CL_OUT ClHandleT *handle_out)
Creates a handle with component address.
ClRcT clHandleDatabaseDestroy(CL_IN ClHandleDatabaseHandleT databaseHandle)
Destroys a handle database.
ClRcT clHandleDestroy(CL_IN ClHandleDatabaseHandleT databaseHandle, CL_IN ClHandleT handle)
Destroy a handle.
ClRcT clHandleDatabaseCreate(CL_IN void(*destructor)(void *), CL_OUT ClHandleDatabaseHandleT *databaseHandle)
Creates a handle database.
ClWordT clHandleGetDatabaseId(ClHandleDatabaseHandleT *databaseHandle)
Get the handle database Identifier.
ClRcT clHandleCreate(CL_IN ClHandleDatabaseHandleT databaseHandle, CL_IN ClInt32T instanceSize, CL_OUT ClHandleT *handle)
Creates a handle.
ClRcT clHandleCheckout(CL_IN ClHandleDatabaseHandleT databaseHandle, CL_IN ClHandleT handle, CL_OUT void **instance)
Check out a handle.
ClRcT clHandleCheckin(CL_IN ClHandleDatabaseHandleT databaseHandle, CL_IN ClHandleT handle)
Check in a handle.
ClPtrT ClHandleDatabaseHandleT
Handle database handle.
Definition: clHandleApi.h:110
The IOC Physical address of an application's communication end point.
Definition: clIocApi.h:383

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen