1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     nnet_ring.h
4 
5   Copyright (C)2009 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: 14703 $
14  *---------------------------------------------------------------------------*/
15 
16 /**
17  * NNETモジュールのリングバッファ関連定義
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 /**
30  * データブロック構造体
31  */
32 typedef struct NNETBlock {
33     u8*   ptr;    /**< データの先頭ポインタ */
34     s32   len;    /**< データ長 */
35 } NNETBlock;
36 
37 /**
38  * データベクタ構造体
39  */
40 typedef struct NNETVec {
41     void* data;    /**< データの先頭ポインタ */
42     s32   len;     /**< データ長 */
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