1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     nnet_ring.h
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 46347 $
14  *---------------------------------------------------------------------------*/
15 
16 /* Please see man pages for details
17 
18  */
19 
20 #ifndef __NNET_RING_H__
21 #define __NNET_RING_H__
22 
23 #include <nn/net/compatible/nos.h>    /* for NOSMessageBuf */
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /* Please see man pages for details
30 
31  */
32 typedef struct NNETBlock {
33     u8*   ptr;    /* Please see man pages for details */
34     s32   len;    /* Please see man pages for details */
35 } NNETBlock;
36 
37 /* Please see man pages for details
38 
39  */
40 typedef struct NNETVec {
41     void* data;    /* Please see man pages for details */
42     s32   len;     /* Please see man pages for details */
43 } NNETVec;
44 
45 u8*   NNET_RingIn ( u8* buf, s32 size, u8* head, s32 used, const u8* data, s32 len );
46 u8*   NNET_RingInMbuf ( u8* buf, s32 size, u8* head, s32 used, NOSMessageBuf *mbuf, s32 len );
47 u8*   NNET_RingInExMbuf( u8* buf, s32 size, u8* head, s32 used, s32 offset, NOSMessageBuf *mbuf, s32* plen, NNETBlock* blocks, s32 maxblock );
48 u8*   NNET_RingOut( u8* buf, s32 size, u8* head, s32 used, u8* data, s32 len );
49 int NNET_RingGet(u8* buf, s32 size, u8* head, s32 used, NNETVec* vec, s32 len);
50 int NNET_RingGetMbuf(u8* buf, s32 size, u8* head, s32 used, NOSMessageBuf *mbuf, s32 len);
51 u8*   NNET_RingPut( u8* buf, s32 size, u8* head, s32 used, s32 len );
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif  /* __NNET_RING_H__ */
58