1 /****************************************************************************
3 (c) SYSTEC electronic GmbH, D-07973 Greiz, August-Bebel-Str. 29
4 www.systec-electronic.com
6 Project: Project independend shared buffer (linear + circular)
8 Description: Declaration of platform specific part for the
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions
17 1. Redistributions of source code must retain the above copyright
18 notice, this list of conditions and the following disclaimer.
20 2. Redistributions in binary form must reproduce the above copyright
21 notice, this list of conditions and the following disclaimer in the
22 documentation and/or other materials provided with the distribution.
24 3. Neither the name of SYSTEC electronic GmbH nor the names of its
25 contributors may be used to endorse or promote products derived
26 from this software without prior written permission. For written
27 permission, please contact info@systec-electronic.com.
29 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
32 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
33 COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
34 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
35 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
36 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
37 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
39 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 POSSIBILITY OF SUCH DAMAGE.
44 If a provision of this License is or becomes illegal, invalid or
45 unenforceable in any jurisdiction, that shall not affect:
46 1. the validity or enforceability in that jurisdiction of any other
47 provision of this License; or
48 2. the validity or enforceability in other jurisdictions of that or
49 any other provision of this License.
51 -------------------------------------------------------------------------
53 2006/06/27 -rs: V 1.00 (initial version)
55 ****************************************************************************/
60 //---------------------------------------------------------------------------
62 //---------------------------------------------------------------------------
64 typedef int (*tSigHndlrNewData) (tShbInstance pShbInstance_p);
65 typedef void (*tSigHndlrJobReady) (tShbInstance pShbInstance_p,
66 unsigned int fTimeOut_p);
68 #if (TARGET_SYSTEM == _WIN32_)
69 #if defined(INLINE_FUNCTION_DEF)
70 #undef INLINE_FUNCTION
71 #define INLINE_FUNCTION INLINE_FUNCTION_DEF
72 #define SHBIPC_INLINE_ENABLED TRUE
73 #define SHBIPC_INLINED
74 #include "ShbIpc-Win32.c"
77 #elif (TARGET_SYSTEM == _LINUX_)
78 #if defined(INLINE_FUNCTION_DEF)
79 #undef INLINE_FUNCTION
80 #define INLINE_FUNCTION INLINE_FUNCTION_DEF
81 #define SHBIPC_INLINE_ENABLED TRUE
82 #define SHBIPC_INLINED
83 #include "ShbIpc-LinuxKernel.c"
87 //---------------------------------------------------------------------------
89 //---------------------------------------------------------------------------
91 tShbError ShbIpcInit(void);
92 tShbError ShbIpcExit(void);
94 tShbError ShbIpcAllocBuffer(unsigned long ulBufferSize_p,
95 const char *pszBufferID_p,
96 tShbInstance * ppShbInstance_p,
97 unsigned int *pfShbNewCreated_p);
98 tShbError ShbIpcReleaseBuffer(tShbInstance pShbInstance_p);
100 #if !defined(SHBIPC_INLINE_ENABLED)
102 tShbError ShbIpcEnterAtomicSection(tShbInstance pShbInstance_p);
103 tShbError ShbIpcLeaveAtomicSection(tShbInstance pShbInstance_p);
105 tShbError ShbIpcStartSignalingNewData(tShbInstance pShbInstance_p,
107 pfnSignalHandlerNewData_p,
108 tShbPriority ShbPriority_p);
109 tShbError ShbIpcStopSignalingNewData(tShbInstance pShbInstance_p);
110 tShbError ShbIpcSignalNewData(tShbInstance pShbInstance_p);
112 tShbError ShbIpcStartSignalingJobReady(tShbInstance pShbInstance_p,
113 unsigned long ulTimeOut_p,
115 pfnSignalHandlerJobReady_p);
116 tShbError ShbIpcSignalJobReady(tShbInstance pShbInstance_p);
118 void *ShbIpcGetShMemPtr(tShbInstance pShbInstance_p);
121 #undef SHBIPC_INLINE_ENABLED // disable actual inlining of functions
122 #undef INLINE_FUNCTION
123 #define INLINE_FUNCTION // define INLINE_FUNCTION to nothing
125 #endif // #ifndef _SHBIPC_H_