1 /**
2 * @file RscTable.h
3 *
4 * @brief Definitions for the RscTable interface.
5 *
6 * ============================================================================
7 *
8 * Copyright (c) 2012-2014, Texas Instruments Incorporated
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 *
17 * * Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * * Neither the name of Texas Instruments Incorporated nor the names of
22 * its contributors may be used to endorse or promote products derived
23 * from this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 * Contact information for paper mail:
37 * Texas Instruments
38 * Post Office Box 655303
39 * Dallas, Texas 75265
40 * Contact information:
41 * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
42 * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
43 * ============================================================================
44 *
45 */
48 #ifndef RscTable_H
49 #define RscTable_H
51 #if defined (__cplusplus)
52 extern "C" {
53 #endif
55 #include <ti/syslink/SysLink.h>
56 #include <rsc_types.h>
57 #include <ti/syslink/ProcMgr.h>
59 /*!
60 * @def RSCTABLE_MODULEID
61 * @brief Module ID for rsctable.
62 */
63 #define RSCTABLE_MODULEID (UInt16) 0x6a87
65 /* =============================================================================
66 * All success and failure codes for the module
67 * =============================================================================
68 */
70 /*!
71 * @def RSCTABLE_STATUSCODEBASE
72 * @brief Error code base for RscTable.
73 */
74 #define RSCTABLE_STATUSCODEBASE (RSCTABLE_MODULEID << 12u)
76 /*!
77 * @def RSCTABLE_MAKE_FAILURE
78 * @brief Macro to make failure code.
79 */
80 #define RSCTABLE_MAKE_FAILURE(x) ((Int)( 0x80000000 \
81 | (RSCTABLE_STATUSCODEBASE + (x))))
83 /*!
84 * @def RSCTABLE_MAKE_SUCCESS
85 * @brief Macro to make success code.
86 */
87 #define RSCTABLE_MAKE_SUCCESS(x) (RSCTABLE_STATUSCODEBASE + (x))
89 /*!
90 * @def RSCTABLE_E_INVALIDARG
91 * @brief Argument passed to a function is invalid.
92 */
93 #define RSCTABLE_E_INVALIDARG RSCTABLE_MAKE_FAILURE(1)
95 /*!
96 * @def RSCTABLE_E_MEMORY
97 * @brief Memory allocation failed.
98 */
99 #define RSCTABLE_E_MEMORY RSCTABLE_MAKE_FAILURE(2)
101 /*!
102 * @def RSCTABLE_E_FAIL
103 * @brief Generic failure.
104 */
105 #define RSCTABLE_E_FAIL RSCTABLE_MAKE_FAILURE(3)
107 /*!
108 * @def RSCTABLE_E_NOTSUPPORTED
109 * @brief Functionality is not supported
110 */
111 #define RSCTABLE_E_NOTSUPPORTED RSCTABLE_MAKE_FAILURE(4)
113 /*!
114 * @def RSCTABLE_E_NOTIMPL
115 * @brief Functionality is not implemented
116 */
117 #define RSCTABLE_E_NOTIMPL RSCTABLE_MAKE_FAILURE(5)
119 /*!
120 * @def RSCTABLE_SUCCESS
121 * @brief Operation successful.
122 */
123 #define RSCTABLE_SUCCESS RSCTABLE_MAKE_SUCCESS(0)
126 /*
127 * @brief Defines RscTable object handle
128 */
129 typedef struct RscTable_Object * RscTable_Handle;
131 RscTable_Handle RscTable_alloc (Char * fileName, UInt16 procId);
133 Int RscTable_free (RscTable_Handle * handle);
135 Int RscTable_process (UInt16 procId, Bool tryAlloc, UInt32 * numBlocks);
137 Int RscTable_getMemEntries (UInt16 procId, SysLink_MemEntry * memEntries,
138 UInt32 * numMemEntries);
140 Int RscTable_getInfo (UInt16 procId, UInt32 type, UInt32 extra, UInt32 * da,
141 UInt32 *pa, UInt32 * len);
143 Int RscTable_update (UInt16 procId, ProcMgr_Handle procHandle);
145 Int RscTable_free (RscTable_Handle * handle);
147 Int RscTable_setStatus (UInt16 procId, UInt32 value);
149 #if defined (__cplusplus)
150 }
151 #endif /* defined (__cplusplus) */
153 #endif /* RscTable_H */