00001 /** ============================================================================ 00002 * @file ringiodefs.h 00003 * 00004 * @path $(DSPLINK)/dsp/inc/ 00005 * 00006 * @brief Global definitions for RingIO module 00007 * 00008 * @ver 1.65.00.03 00009 * ============================================================================ 00010 * @copyright Copyright (C) 2002-2009, Texas Instruments Incorporated - 00011 * http://www.ti.com/ 00012 * 00013 * Redistribution and use in source and binary forms, with or without 00014 * modification, are permitted provided that the following conditions 00015 * are met: 00016 * 00017 * * Redistributions of source code must retain the above copyright 00018 * notice, this list of conditions and the following disclaimer. 00019 * 00020 * * Redistributions in binary form must reproduce the above copyright 00021 * notice, this list of conditions and the following disclaimer in the 00022 * documentation and/or other materials provided with the distribution. 00023 * 00024 * * Neither the name of Texas Instruments Incorporated nor the names of 00025 * its contributors may be used to endorse or promote products derived 00026 * from this software without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00029 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00030 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00031 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00032 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00033 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00034 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00035 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00036 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00037 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00038 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00039 * ============================================================================ 00040 */ 00041 00042 00043 #if !defined (RINGIODEFS_H) 00044 #define RINGIODEFS_H 00045 00046 00047 /* ----------------------------------- DSP/BIOS LINK Headers */ 00048 #include <mpcs.h> 00049 00050 00051 #if defined (__cplusplus) 00052 extern "C" { 00053 #endif /* defined (__cplusplus) */ 00054 00055 00056 /* Success code for RingIO component */ 00057 #define RINGIO_SUCCESS (SYS_OK) 00058 #define RINGIO_BASE (SYS_EUSER) 00059 00060 /* Indicates that either: 1) The amount of data requested could not be 00061 serviced due to the presence of an attribute 00062 2) During an attribute read if another is also present 00063 at the same offset */ 00064 #define RINGIO_SPENDINGATTRIBUTE (RINGIO_BASE + 0x1) 00065 00066 /* Generic RingIO error code */ 00067 #define RINGIO_EFAILURE (RINGIO_BASE + 0x2) 00068 00069 /* Indicates that the amount of data requested could not be serviced due to the 00070 ring buffer getting wrapped */ 00071 #define RINGIO_EBUFWRAP (RINGIO_BASE + 0x3) 00072 00073 /* Indicates that there is no data in the buffer for reading */ 00074 #define RINGIO_EBUFEMPTY (RINGIO_BASE + 0x4) 00075 00076 /* Indicates that the buffer is full */ 00077 #define RINGIO_EBUFFULL (RINGIO_BASE + 0x5) 00078 00079 /* Indicates that there is no attribute at the current, but attributes are 00080 present at a future offset */ 00081 #define RINGIO_EPENDINGDATA (RINGIO_BASE + 0x6) 00082 00083 /* Indicates that attibute get() failed, need to extract variable length message 00084 getv() */ 00085 #define RINGIO_EVARIABLEATTRIBUTE (RINGIO_BASE + 0x7) 00086 00087 /* Indicates that the RingIO being created already exists */ 00088 #define RINGIO_EALREADYEXISTS (RINGIO_BASE + 0x8) 00089 00090 /* Indicates that Valid data is present in the buffer but is not contiguous as 00091 * data has been copied from top to footer area. 00092 */ 00093 #define RINGIO_ENOTCONTIGUOUSDATA (RINGIO_BASE + 0x9) 00094 00095 /* Indicates that the RingIO is in a wrong state */ 00096 #define RINGIO_EWRONGSTATE (RINGIO_BASE + 0xA) 00097 00098 /** ============================================================================ 00099 * @macro RINGIO_NAME_MAX_LEN 00100 * 00101 * @brief Maximum length of RingIO strings. 00102 * ============================================================================ 00103 */ 00104 #define RINGIO_NAME_MAX_LEN DSP_MAX_STRLEN 00105 00106 /* ============================================================================ 00107 * @const RINGIO_INVALID_ATTR 00108 * 00109 * @brief This constant denotes an invalid attribute type. 00110 * This should not be used for any valid attribute. 00111 * ============================================================================ 00112 */ 00113 #define RINGIO_INVALID_ATTR (Uint16) 0xFFFF 00114 00115 /** ============================================================================ 00116 * @const RINGIO_DATABUF_CACHEUSE, RINGIO_ATTRBUF_CACHEUSE, 00117 * RINGIO_CONTROL_CACHEUSE, RINGIO_NEED_EXACT_SIZE 00118 * 00119 * @brief These constants denote the flags provided while opening the RingIO. 00120 * ============================================================================ 00121 */ 00122 #define RINGIO_DATABUF_CACHEUSE 0x1 00123 #define RINGIO_ATTRBUF_CACHEUSE 0x2 00124 #define RINGIO_CONTROL_CACHEUSE 0x4 00125 #define RINGIO_NEED_EXACT_SIZE 0x8 00126 00127 00128 /** ============================================================================ 00129 * @name RingIO_NotifyType 00130 * 00131 * @brief Enumeration of RingIO notification types. 00132 * 00133 * @param RINGIO_NOTIFICATION_NONE 00134 * No notification required. 00135 * @param RINGIO_NOTIFICATION_ALWAYS 00136 * Notify whenever the other side sends data/frees up space. 00137 * @param RINGIO_NOTIFICATION_ONCE 00138 * Notify when the other side sends data/frees up space. Once the 00139 * notification is done, the notification is disabled until it is 00140 * enabled again 00141 * @param RINGIO_NOTIFICATION_HDWRFIFO_ALWAYS 00142 * Notify whenever the other side sends data/frees up space. 00143 * This notification is never disabled. 00144 * @param RINGIO_NOTIFICATION_HDWRFIFO_ONCE 00145 * Notify when the other side sends data/frees up space. Once the 00146 * notification is done, the notification is disabled until it is 00147 * enabled again. The notification is enabled once the watermark 00148 * is crossed and does not require buffer to get full/empty. 00149 * ============================================================================ 00150 */ 00151 typedef enum { 00152 RINGIO_NOTIFICATION_NONE = 0, 00153 RINGIO_NOTIFICATION_ALWAYS, 00154 RINGIO_NOTIFICATION_ONCE, 00155 RINGIO_NOTIFICATION_HDWRFIFO_ALWAYS, 00156 RINGIO_NOTIFICATION_HDWRFIFO_ONCE 00157 } RingIO_NotifyType ; 00158 00159 /** ============================================================================ 00160 * @name RingIO_OpenMode 00161 * 00162 * @brief Enumeration of RingIO open modes. 00163 * 00164 * @param RINGIO_MODE_READ 00165 * Reader mode. 00166 * @param RINGIO_MODE_WRITE 00167 * Writer mode. 00168 * ============================================================================ 00169 */ 00170 typedef enum{ 00171 RINGIO_MODE_READ = 0, 00172 RINGIO_MODE_WRITE 00173 } RingIO_OpenMode ; 00174 00175 /** ============================================================================ 00176 * @name RingIO_TransportType 00177 * 00178 * @brief Enumeration of RingIO transport types. 00179 * 00180 * @param RINGIO_TRANSPORT_DSP_DSP 00181 * Intra-DSP transport. 00182 * @param RINGIO_TRANSPORT_GPP_DSP 00183 * GPP<->DSP transport. 00184 * ============================================================================ 00185 */ 00186 typedef enum{ 00187 RINGIO_TRANSPORT_DSP_DSP = 1, 00188 RINGIO_TRANSPORT_GPP_DSP 00189 } RingIO_TransportType ; 00190 00191 00192 /** ============================================================================ 00193 * @name RingIO_Handle 00194 * 00195 * @brief This type is used for the handle to the RingIO Client structure. 00196 * ============================================================================ 00197 */ 00198 typedef Ptr RingIO_Handle ; 00199 00200 /** ============================================================================ 00201 * @name RingIO_ControlHandle 00202 * 00203 * @brief This type is used for the handle to the Shared Control structure. 00204 * ============================================================================ 00205 */ 00206 typedef struct RingIO_ControlStruct_tag * RingIO_ControlHandle ; 00207 00208 /** ============================================================================ 00209 * @name RingIO_BufPtr 00210 * 00211 * @brief This type is used for the Buffer Pointer Type. 00212 * ============================================================================ 00213 */ 00214 typedef Ptr RingIO_BufPtr ; 00215 00216 /** ============================================================================ 00217 * @name RingIO_NotifyParam 00218 * 00219 * @brief This type is used for the Notification Parameter. 00220 * ============================================================================ 00221 */ 00222 typedef Ptr RingIO_NotifyParam ; 00223 00224 /** ============================================================================ 00225 * @name RingIO_NotifyMsg 00226 * 00227 * @brief This type is used for the Notification Message. 00228 * ============================================================================ 00229 */ 00230 typedef Uint16 RingIO_NotifyMsg; 00231 00232 /** ============================================================================ 00233 * @name RingIO_NotifyFunc 00234 * 00235 * @brief Signature of function used as the Notification function. 00236 * 00237 * @param handle 00238 * Handle to the RingIO. 00239 * @param param 00240 * Parameter used while registering the notification. 00241 * @param msg 00242 * Message passed along with notification. 00243 * 00244 * @return None. 00245 * ============================================================================ 00246 */ 00247 typedef Void (* RingIO_NotifyFunc) (RingIO_Handle handle, 00248 RingIO_NotifyParam param, 00249 RingIO_NotifyMsg msg) ; 00250 00251 00252 /** ============================================================================ 00253 * @name RingIO_Attrs 00254 * 00255 * @brief This structure defines the RingIO Creation Parameters. 00256 * 00257 * @param transportType 00258 * Transport type - This specifies whether the data transport is 00259 * between DSP<-> DSP or DSP<->ARM. 00260 * @param ctrlPoolId 00261 * Pool to be used to allocate memory for control structure. 00262 * @param dataPoolId 00263 * Pool to be used to allocate memory for data buffer. 00264 * @param attrPoolId 00265 * Pool to be used to allocate memory for attribute buffer. 00266 * @param lockPoolId 00267 * Pool to be used to allocate memory for lock structure. 00268 * @param dataBufSize 00269 * Data Buffer Size in bytes. 00270 * @param footBufSize 00271 * Footer area for providing contiguous buffer to a reader. 00272 * @param attrBufSize 00273 * Attribute buffer size in bytes. 00274 * ============================================================================ 00275 */ 00276 typedef struct RingIO_Attrs_tag { 00277 RingIO_TransportType transportType ; 00278 Uint16 ctrlPoolId ; 00279 Uint16 dataPoolId ; 00280 Uint16 attrPoolId ; 00281 Uint16 lockPoolId ; 00282 Uint32 dataBufSize ; 00283 Uint32 footBufSize ; 00284 Uint32 attrBufSize ; 00285 } RingIO_Attrs ; 00286 00287 /** ============================================================================ 00288 * @name RingIO_ControlStruct 00289 * 00290 * @brief Forward declaration of RingIO_ControlStruct. 00291 * ============================================================================ 00292 */ 00293 typedef struct RingIO_ControlStruct_tag RingIO_ControlStruct ; 00294 00295 /** ============================================================================ 00296 * @name RingIO_Client 00297 * 00298 * @brief This structure defines the RingIO Shared memory client structure. 00299 * The RingIO Reader or Writer state information is stored in this 00300 * structure 00301 * 00302 * @param procId 00303 * Processor Id where the client is executing 00304 * @param openMode 00305 * Indicates whether the client is a reader or writer 00306 * @param pDataStart 00307 * Virtual start address of the data buffer 00308 * @param pAttrStart 00309 * Virtual start address of the attr buffer 00310 * @param acqStart 00311 * Start offset of data buffer that has been acquired by the 00312 * application. 00313 * @param acqSize 00314 * Size of data that has been acquired 00315 * @param acqAttrStart 00316 * Start offset of the acquired attribute buffer 00317 * @param acqAttrSize 00318 * Size of attribute data that has been acquired 00319 * @param notifyType 00320 * Notification type 00321 * @param notifyFunc 00322 * Notification function for this client 00323 * @param notifyParam 00324 * Parameter to the Notification function 00325 * @param notifyWaterMark 00326 * Watermark that should be satisfied before notification is done 00327 * @param flags 00328 * Counting bits from MSB to LSB 0....31 00329 * B31 - Denotes whether the client uses cache for accessing the 00330 * data buffer (dataBufCacheUseFlag) 00331 * B30 - Denotes whether the client uses cache for accessing the 00332 * attribute buffer (attrBufCacheUseFlag) 00333 * B29 - Denotes whether the client uses cache for accessing the 00334 * control struct (controlStructCacheFlag) 00335 * B28 - Denotes whether requests for acquire buffer should always 00336 * be satisfied. If a contiguous request could not be 00337 * satisfied because of the buffer wrap, we need to mark an 00338 * early end and provide only a contiguous buffer 00339 * (contiguousBufFlag) 00340 * @param virtControlHandle 00341 * Handle to the Control structure. Apps do not have direct access 00342 * to the control structure. The Control structure can only be 00343 * accessed through the client handle 00344 * @param virtLockHandle 00345 * Virtual (GPP) address of the lock that should be used to protect 00346 * the Control structure from multiple accesses. 00347 * @param isValid 00348 * Indicates whether the Client is initialized 00349 * @param notifyFlag 00350 * Denotes whether notification needs to be done or not 00351 * @param refCount 00352 * Denotes whether ringio has been re-opened or not 00353 * @param padding 00354 * Padding. 00355 * ============================================================================ 00356 */ 00357 typedef struct RingIO_Client_tag { 00358 Uint32 procId ; 00359 Uint32 openMode ; 00360 RingIO_BufPtr pDataStart ; 00361 RingIO_BufPtr pAttrStart ; 00362 Uint32 acqStart ; 00363 Uint32 acqSize ; 00364 Uint32 acqAttrStart ; 00365 Uint32 acqAttrSize ; 00366 Uint32 notifyType ; 00367 RingIO_NotifyFunc notifyFunc ; 00368 RingIO_NotifyParam notifyParam ; 00369 Uint32 notifyWaterMark ; 00370 Uint32 flags ; 00371 RingIO_ControlStruct * virtControlHandle ; 00372 Void * virtLockHandle; 00373 Uint32 isValid ; 00374 Uint32 refCount ; 00375 Uint16 notifyFlag ; 00376 ADD_PADDING (padding, RINGIO_CLIENT_PADDING) 00377 } RingIO_Client ; 00378 00379 /** ============================================================================ 00380 * @name RingIO_ControlStruct 00381 * 00382 * @brief This structure defines the RingIO Control Structure. This structure 00383 * is stored in shared memory and is accessible by all clients. The 00384 * control structure supports a single reader and a single writer for 00385 * the ring buffer. 00386 * 00387 * @param procId 00388 * Processor Identifier. 00389 * @param entryId 00390 * ID of the RingIO within the entry array. 00391 * @param transportType 00392 * Transport type - This specifies whether the data transport is 00393 * between DSP<-> DSP or DSP<->ARM. 00394 * @param phyBufStart 00395 * Physical start address of the data buffer. 00396 * @param phyBufEnd 00397 * Total size of the Data buffer (offset from phyBufStart) 00398 * @param curBufEnd 00399 * Current buffer size. This may be <= dataBufEnd (offset from 00400 * phyBufStart) 00401 * @param dataBufEnd 00402 * Size of the main data buffer (offset from phyBufStart) 00403 * @param dataBufSize 00404 * Size of the data buffer 00405 * @param footBufSize 00406 * Size of the foot buffer used for providing linear buffer to a 00407 * reader 00408 * @param validSize 00409 * Amount of valid data available in the data buffer. Valid Data is 00410 * the total data that is readable by the reader using an acquire 00411 * call. This does not include the size of the data buffer already 00412 * acquired by the reader 00413 * @param emptySize 00414 * Amount of empty space in the data buffer. This does not include 00415 the empty space already acquired by the writer 00416 * @param phyAttrStart 00417 * Physical start address of the attr buffer 00418 * @param phyAttrBufEnd 00419 * Total Size of the attribute buffer (offset) 00420 * @param curAttrBufEnd 00421 * Current Attr buffer size. This may be <= the phyAttrBufEnd 00422 * (offset) 00423 * @param validAttrSize 00424 * Amount of valid attribute bytes available in the attribute 00425 * buffer. The valid attribute bytes does not include the attribute 00426 * bytes already acquired by the reader 00427 * @param emptyAttrSize 00428 * Amount of empty space in the attr buffer. This does not include 00429 * the empty attr space already acquired by the writer 00430 * @param prevAttrOffset 00431 * Offset of the most recent attribute 00432 * @param phyLockHandle 00433 * Physical (DSP) address of the lock that should be used to 00434 * protect the Control structure from multiple accesses. 00435 * @param padding 00436 * Padding. 00437 * @param writer 00438 * Writer state information 00439 * @param reader 00440 * Reader state information 00441 * ============================================================================ 00442 */ 00443 struct RingIO_ControlStruct_tag { 00444 Uint32 procId ; 00445 Uint32 entryId; 00446 Uint32 transportType; 00447 RingIO_BufPtr phyBufStart; 00448 Uint32 phyBufEnd; 00449 Uint32 curBufEnd; 00450 Uint32 dataBufEnd; 00451 Uint32 dataBufSize; 00452 Uint32 footBufSize; 00453 Uint32 validSize; 00454 Uint32 emptySize; 00455 RingIO_BufPtr phyAttrStart; 00456 Uint32 phyAttrBufEnd; 00457 Uint32 curAttrBufEnd; 00458 Uint32 validAttrSize; 00459 Uint32 emptyAttrSize; 00460 Int32 prevAttrOffset; 00461 Void * phyLockHandle; 00462 ADD_PADDING (padding, RINGIO_CONTROLSTRUCT_PADDING) 00463 RingIO_Client writer; 00464 RingIO_Client reader; 00465 } ; 00466 00467 /** ============================================================================ 00468 * @name RingIO_Entry 00469 * 00470 * @brief Entry structure for the RingIO data transport 00471 * 00472 * @param name 00473 * System wide unique identifier for the RingIO 00474 * @param phyControl 00475 * Physical (DSP) address of the Control structure for the RingIO. 00476 * @param virtControl 00477 * Virtual (GPP) address of the Control structure for the RingIO. 00478 * @param ownerProcId 00479 * Creator's processor ID of this ringio. 00480 * @param ctrlPoolId 00481 * Pool to be used to allocate memory for control structure. 00482 * @param dataPoolId 00483 * Pool to be used to allocate memory for data buffer. 00484 * @param attrPoolId 00485 * Pool to be used to allocate memory for attribute buffer. 00486 * @param lockPoolId 00487 * Pool to be used to allocate memory for lock structure. 00488 * @param padding 00489 * Padding. 00490 * ============================================================================ 00491 */ 00492 typedef struct RingIO_Entry_tag { 00493 Ptr phyControl ; 00494 Ptr virtControl ; 00495 Char name [RINGIO_NAME_MAX_LEN] ; 00496 Uint16 ownerProcId ; 00497 Uint16 ctrlPoolId ; 00498 Uint16 dataPoolId ; 00499 Uint16 attrPoolId ; 00500 Uint16 lockPoolId ; 00501 ADD_PADDING (padding, RINGIO_ENTRY_PADDING) 00502 } RingIO_Entry ; 00503 00504 /** ============================================================================ 00505 * @name RingIO_Ctrl 00506 * 00507 * @brief This structure defines the control structure required by the 00508 * RINGIO component. It contains information about all RINGIO objects 00509 * shared between the GPP and a specific DSP. 00510 * 00511 * @param isInitialized 00512 * Flag to indicate if this region was initialized 00513 * @param dspId 00514 * ID of the DSP with which the RingIO Region is shared 00515 * @param maxEntries 00516 * Maximum number of RingIO instances supported by the RingIO. 00517 * @param ipsId 00518 * ID of the IPS to be used. 00519 * @param ipsEventNo 00520 * IPS Event number associated with the RingIO. 00521 * @param dspAddrEntry 00522 * Pointer to array in DSP address space of RINGIO objects that can 00523 * be created. 00524 * @param padding 00525 * Padding. 00526 * @param lockObj 00527 * Lock used to protect the shared RingIO_Ctrl from multiple 00528 * simultaneous accesses. 00529 * ============================================================================ 00530 */ 00531 typedef struct RingIO_Ctrl_tag { 00532 Uint32 isInitialized ; 00533 Uint32 dspId ; 00534 Uint32 maxEntries ; 00535 Uint32 ipsId ; 00536 Uint32 ipsEventNo ; 00537 RingIO_Entry * dspAddrEntry ; 00538 ADD_PADDING (padding, RINGIO_CTRL_PADDING) 00539 MPCS_ShObj lockObj ; 00540 } RingIO_Ctrl ; 00541 00542 00543 /** ============================================================================ 00544 * @macro GET_ENTRY_ID 00545 * 00546 * @brief Gets the entry id of the RingIO 00547 * ============================================================================ 00548 */ 00549 #define GET_ENTRY_ID(client) ((client)->virtControlHandle->entryId) 00550 00551 /** ============================================================================ 00552 * @macro GET_LOCK_POOL_ID 00553 * 00554 * @brief Gets the pool id from which the MPCS lock object structure has been 00555 * allocated. 00556 * ============================================================================ 00557 */ 00558 #define GET_LOCK_POOL_ID(entryId) (RingIO_ctrlPtr->entry [entryId].lockPoolId) 00559 00560 /** ============================================================================ 00561 * @macro GET_CTRL_POOL_ID 00562 * 00563 * @brief Gets the pool id from which the RingIO control structure has been 00564 * validated. 00565 * ============================================================================ 00566 */ 00567 #define GET_CTRL_POOL_ID(entryId) (RingIO_ctrlPtr->entry [entryId].ctrlPoolId) 00568 00569 /** ============================================================================ 00570 * @macro GET_DATA_POOL_ID 00571 * 00572 * @brief Gets the pool id from which the RingIO data buffer has been 00573 * allocated. 00574 * ============================================================================ 00575 */ 00576 #define GET_DATA_POOL_ID(entryId) (RingIO_ctrlPtr->entry [entryId].dataPoolId) 00577 00578 /** ============================================================================ 00579 * @macro GET_ATTR_POOL_ID 00580 * 00581 * @brief Gets the pool id from which the RingIO attr buffer has been 00582 * allocated. 00583 * ============================================================================ 00584 */ 00585 #define GET_ATTR_POOL_ID(entryId) (RingIO_ctrlPtr->entry [entryId].attrPoolId) 00586 00587 /** ============================================================================ 00588 * @macro IS_WRITER 00589 * 00590 * @brief Check if client is a writer. 00591 * ============================================================================ 00592 */ 00593 #define IS_WRITER(client) ((client)->openMode == RINGIO_MODE_WRITE) 00594 00595 /** ============================================================================ 00596 * @macro IS_READER 00597 * 00598 * @brief Check if client is a reader. 00599 * ============================================================================ 00600 */ 00601 #define IS_READER(client) ((client)->openMode == RINGIO_MODE_READ) 00602 00603 /** ============================================================================ 00604 * @macro GET_CUR_ATTR_END 00605 * 00606 * @brief Get Current attr buffer end. 00607 * ============================================================================ 00608 */ 00609 #define GET_CUR_ATTR_END(control) ((control)->curAttrBufEnd + 1) 00610 00611 /** ============================================================================ 00612 * @macro GET_CUR_DATA_END 00613 * 00614 * @brief Get Current data buffer end. 00615 * ============================================================================ 00616 */ 00617 #define GET_CUR_DATA_END(control) ((control)->curBufEnd + 1) 00618 00619 /** ============================================================================ 00620 * @macro ADJUST_MODULO 00621 * 00622 * @brief Modulo operation 00623 * ============================================================================ 00624 */ 00625 #define ADJUST_MODULO(start, size, bufSize) (((start) + (size)) % bufSize) 00626 00627 /** ============================================================================ 00628 * @macro SIZEOF_ATTR 00629 * 00630 * @brief Size of RingIO attributes 00631 * ============================================================================ 00632 */ 00633 #define SIZEOF_ATTR(size) (sizeof (RingIO_Attr) + (size)) 00634 00635 #if defined (__cplusplus) 00636 } 00637 #endif /* defined (__cplusplus) */ 00638 00639 #endif /* if !defined (RINGIODEFS_H) */