RetroArch
arqueue.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------
2 
3 arqueue.h -- ARAM task request queue implementation
4 
5 Copyright (C) 2004
6 Michael Wiedenbauer (shagkur)
7 Dave Murphy (WinterMute)
8 
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.
12 
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:
16 
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.
21 
22 2. Altered source versions must be plainly marked as such, and
23 must not be misrepresented as being the original software.
24 
25 3. This notice may not be removed or altered from any source
26 distribution.
27 
28 
29 -------------------------------------------------------------*/
30 
31 
32 #ifndef __ARQUEUE_H__
33 #define __ARQUEUE_H__
34 
35 #include <gctypes.h>
36 #include <ogc/lwp_queue.h>
37 #include "aram.h"
38 
39 #define ARQ_MRAMTOARAM AR_MRAMTOARAM
40 #define ARQ_ARAMTOMRAM AR_ARAMTOMRAM
41 
42 #define ARQ_DEF_CHUNK_SIZE 4096
43 
44 #define ARQ_PRIO_LO 0
45 #define ARQ_PRIO_HI 1
46 
47 #ifdef __cplusplus
48  extern "C" {
49 #endif /* __cplusplus */
50 
51 enum {
55 };
56 
57 typedef struct _arq_request ARQRequest;
58 typedef void (*ARQCallback)(ARQRequest *);
59 
60 struct _arq_request {
65 };
66 
67 void ARQ_Init();
68 void ARQ_Reset();
69 
70 
86 void ARQ_PostRequest(ARQRequest *req,u32 owner,u32 dir,u32 prio,u32 aram_addr,u32 mram_addr,u32 len);
87 
88 
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);
108 void ARQ_FlushQueue();
110 
111 #ifdef __cplusplus
112  }
113 #endif /* __cplusplus */
114 
115 #endif
u32 owner
Definition: arqueue.h:62
u32 mram_addr
Definition: arqueue.h:63
void ARQ_PostRequest(ARQRequest *req, u32 owner, u32 dir, u32 prio, u32 aram_addr, u32 mram_addr, u32 len)
Enqueue a ARAM DMA transfer request.
Definition: arqueue.c:204
Data type definitions.
u32 aram_addr
Definition: arqueue.h:63
lwp_node node
Definition: arqueue.h:61
GLenum GLsizei len
Definition: glext.h:7389
GLsizeiptr size
Definition: glext.h:6559
u32 prio
Definition: arqueue.h:62
Definition: lwp_queue.h:16
ARQCallback callback
Definition: arqueue.h:64
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
void ARQ_Reset()
Definition: arqueue.c:138
ARAM subsystem.
Definition: arqueue.h:60
void ARQ_SetChunkSize(u32 size)
Definition: arqueue.c:146
u32 dir
Definition: arqueue.h:62
void(* ARQCallback)(ARQRequest *)
Definition: arqueue.h:58
u32 ARQ_GetChunkSize()
Definition: arqueue.c:154
void ARQ_PostRequestAsync(ARQRequest *req, u32 owner, u32 dir, u32 prio, u32 aram_addr, u32 mram_addr, u32 len, ARQCallback cb)
Enqueue a ARAM DMA transfer request.
Definition: arqueue.c:172
Definition: arqueue.h:53
Definition: arqueue.h:54
void ARQ_FlushQueue()
Definition: arqueue.c:159
void ARQ_Init()
Definition: arqueue.c:113
u32 state
Definition: arqueue.h:62
u32 len
Definition: arqueue.h:63
u32 ARQ_RemoveOwnerRequest(u32 owner)
Definition: arqueue.c:227
Definition: arqueue.h:52
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
void ARQ_RemoveRequest(ARQRequest *req)
Definition: arqueue.c:217