rm unused function prototypes
[libogc.git] / gc / ogc / arqueue.h
blob2aff9e1780201a23826a8e229756ff816dc2373e
1 /*-------------------------------------------------------------
3 arqueue.h -- ARAM task request queue implementation
5 Copyright (C) 2004
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
26 distribution.
29 -------------------------------------------------------------*/
32 #ifndef __ARQUEUE_H__
33 #define __ARQUEUE_H__
35 #include <gctypes.h>
36 #include <ogc/lwp_queue.h>
37 #include "aram.h"
39 #define ARQ_MRAMTOARAM AR_MRAMTOARAM
40 #define ARQ_ARAMTOMRAM AR_ARAMTOMRAM
42 #define ARQ_DEF_CHUNK_SIZE 4096
44 #define ARQ_PRIO_LO 0
45 #define ARQ_PRIO_HI 1
47 #ifdef __cplusplus
48 extern "C" {
49 #endif /* __cplusplus */
51 enum {
52 ARQ_TASK_READY = 0,
53 ARQ_TASK_RUNNING,
54 ARQ_TASK_FINISHED
57 typedef struct _arq_request ARQRequest;
58 typedef void (*ARQCallback)(ARQRequest *);
60 struct _arq_request {
61 lwp_node node;
62 u32 owner,dir,prio,state;
63 u32 aram_addr,mram_addr,len;
64 ARQCallback callback;
67 void ARQ_Init();
68 void ARQ_Reset();
71 /*!
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.
84 * \return none
86 void ARQ_PostRequest(ARQRequest *req,u32 owner,u32 dir,u32 prio,u32 aram_addr,u32 mram_addr,u32 len);
89 /*!
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.
102 * \return none
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);
111 #ifdef __cplusplus
113 #endif /* __cplusplus */
115 #endif