md: tidy up status_resync to handle large arrays.
[linux-2.6] / drivers / staging / epl / ShbIpc.h
1 /****************************************************************************
2
3   (c) SYSTEC electronic GmbH, D-07973 Greiz, August-Bebel-Str. 29
4       www.systec-electronic.com
5
6   Project:      Project independend shared buffer (linear + circular)
7
8   Description:  Declaration of platform specific part for the
9                 shared buffer
10
11   License:
12
13     Redistribution and use in source and binary forms, with or without
14     modification, are permitted provided that the following conditions
15     are met:
16
17     1. Redistributions of source code must retain the above copyright
18        notice, this list of conditions and the following disclaimer.
19
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.
23
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.
28
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.
41
42     Severability Clause:
43
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.
50
51   -------------------------------------------------------------------------
52
53   2006/06/27 -rs:   V 1.00 (initial version)
54
55 ****************************************************************************/
56
57 #ifndef _SHBIPC_H_
58 #define _SHBIPC_H_
59
60 //---------------------------------------------------------------------------
61 //  Type definitions
62 //---------------------------------------------------------------------------
63
64 typedef int (*tSigHndlrNewData) (tShbInstance pShbInstance_p);
65 typedef void (*tSigHndlrJobReady) (tShbInstance pShbInstance_p,
66                                    unsigned int fTimeOut_p);
67
68 //---------------------------------------------------------------------------
69 //  Prototypes
70 //---------------------------------------------------------------------------
71
72 tShbError ShbIpcInit(void);
73 tShbError ShbIpcExit(void);
74
75 tShbError ShbIpcAllocBuffer(unsigned long ulBufferSize_p,
76                             const char *pszBufferID_p,
77                             tShbInstance * ppShbInstance_p,
78                             unsigned int *pfShbNewCreated_p);
79 tShbError ShbIpcReleaseBuffer(tShbInstance pShbInstance_p);
80
81 tShbError ShbIpcEnterAtomicSection(tShbInstance pShbInstance_p);
82 tShbError ShbIpcLeaveAtomicSection(tShbInstance pShbInstance_p);
83
84 tShbError ShbIpcStartSignalingNewData(tShbInstance pShbInstance_p,
85                                       tSigHndlrNewData
86                                       pfnSignalHandlerNewData_p,
87                                       tShbPriority ShbPriority_p);
88 tShbError ShbIpcStopSignalingNewData(tShbInstance pShbInstance_p);
89 tShbError ShbIpcSignalNewData(tShbInstance pShbInstance_p);
90
91 tShbError ShbIpcStartSignalingJobReady(tShbInstance pShbInstance_p,
92                                        unsigned long ulTimeOut_p,
93                                        tSigHndlrJobReady
94                                        pfnSignalHandlerJobReady_p);
95 tShbError ShbIpcSignalJobReady(tShbInstance pShbInstance_p);
96
97 void *ShbIpcGetShMemPtr(tShbInstance pShbInstance_p);
98
99 #endif // #ifndef _SHBIPC_H_