1 /*-------------------------------------------------------------
3 arqueue.h -- ARAM task request queue implementation
6 Michael Wiedenbauer (shagkur)
7 Dave Murphy (WinterMute)
9 This software is provided 'as-is', without any express or implied
10 warranty. In no event will the authors be held liable for any
11 damages arising from the use of this software.
13 Permission is granted to anyone to use this software for any
14 purpose, including commercial applications, and to alter it and
15 redistribute it freely, subject to the following restrictions:
17 1. The origin of this software must not be misrepresented; you
18 must not claim that you wrote the original software. If you use
19 this software in a product, an acknowledgment in the product
20 documentation would be appreciated but is not required.
22 2. Altered source versions must be plainly marked as such, and
23 must not be misrepresented as being the original software.
25 3. This notice may not be removed or altered from any source
29 -------------------------------------------------------------*/
36 #include <ogc/lwp_queue.h>
39 #define ARQ_MRAMTOARAM AR_MRAMTOARAM
40 #define ARQ_ARAMTOMRAM AR_ARAMTOMRAM
42 #define ARQ_DEF_CHUNK_SIZE 4096
49 #endif /* __cplusplus */
57 typedef struct _arq_request ARQRequest
;
58 typedef void (*ARQCallback
)(ARQRequest
*);
62 u32 owner
,dir
,prio
,state
;
63 u32 aram_addr
,mram_addr
,len
;
72 * \fn void ARQ_PostRequest(ARQRequest *req,u32 owner,u32 dir,u32 prio,u32 aram_addr,u32 mram_addr,u32 len)
73 * \brief Enqueue a ARAM DMA transfer request.
75 * \param[in] req structure to hold ARAM DMA request informations.
76 * \param[in] owner unique owner id.
77 * \param[in] dir direction of ARAM DMA transfer.
78 * \param[in] prio priority of request.
79 * \param[in] aram_addr startaddress of buffer to be pushed onto the queue. <b><i>NOTE:</i></b> Must be 32-bytealigned.
80 * \param[in] mram_addr length of data to be pushed onto the queue.
81 * \param[in] len startaddress of buffer to be pushed onto the queue. <b><i>NOTE:</i></b> Must be 32-bytealigned.
82 * \param[in] cb length of data to be pushed onto the queue.
86 void ARQ_PostRequest(ARQRequest
*req
,u32 owner
,u32 dir
,u32 prio
,u32 aram_addr
,u32 mram_addr
,u32 len
);
90 * \fn void ARQ_PostRequestAsync(ARQRequest *req,u32 owner,u32 dir,u32 prio,u32 aram_addr,u32 mram_addr,u32 len,ARQCallback cb)
91 * \brief Enqueue a ARAM DMA transfer request.
93 * \param[in] req structure to hold ARAM DMA request informations.
94 * \param[in] owner unique owner id.
95 * \param[in] dir direction of ARAM DMA transfer.
96 * \param[in] prio priority of request.
97 * \param[in] aram_addr startaddress of buffer to be pushed onto the queue. <b><i>NOTE:</i></b> Must be 32-bytealigned.
98 * \param[in] mram_addr length of data to be pushed onto the queue.
99 * \param[in] len startaddress of buffer to be pushed onto the queue. <b><i>NOTE:</i></b> Must be 32-bytealigned.
100 * \param[in] cb length of data to be pushed onto the queue.
104 void ARQ_PostRequestAsync(ARQRequest
*req
,u32 owner
,u32 dir
,u32 prio
,u32 aram_addr
,u32 mram_addr
,u32 len
,ARQCallback cb
);
105 void ARQ_RemoveRequest(ARQRequest
*req
);
106 void ARQ_SetChunkSize(u32 size
);
107 u32
ARQ_GetChunkSize();
108 void ARQ_FlushQueue();
109 u32
ARQ_RemoveOwnerRequest(u32 owner
);
113 #endif /* __cplusplus */