2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CARAMMANAGER
|
|
|
|
#define _CARAMMANAGER
|
2022-04-10 00:17:06 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
class CARAMManager {
|
|
|
|
public:
|
2022-12-06 07:59:41 +00:00
|
|
|
enum EDMAPriority {
|
|
|
|
kDMAPrio_Zero,
|
|
|
|
kDMAPrio_One,
|
|
|
|
kDMAPrio_Two,
|
|
|
|
kDMAPrio_Three,
|
|
|
|
kDMAPrio_Four,
|
|
|
|
kDMAPrio_Five,
|
|
|
|
kDMAPrio_Six,
|
|
|
|
};
|
|
|
|
|
2022-04-10 00:17:06 +00:00
|
|
|
static void Shutdown();
|
|
|
|
static void CollectGarbage();
|
2022-09-18 06:05:46 +00:00
|
|
|
static void PreInitializeAlloc(uint size) { mPreInitializeAlloc += size; }
|
2022-09-13 04:26:54 +00:00
|
|
|
static void Initialize(uint);
|
2022-11-17 10:12:03 +00:00
|
|
|
static void WaitForAllDMAsToComplete();
|
2022-12-06 07:59:41 +00:00
|
|
|
static const void* GetInvalidAlloc() { return (const void*)kInvalidAlloc; }
|
|
|
|
static const uint GetInvalidDMAHandle() { return kInvalidHandle; }
|
2022-12-03 21:31:54 +00:00
|
|
|
static bool CancelDMA(uint);
|
|
|
|
static void WaitForDMACompletion(uint);
|
2022-12-06 07:59:41 +00:00
|
|
|
static bool IsDMACompleted(uint handle);
|
|
|
|
static void* Alloc(uint len);
|
2022-12-03 21:31:54 +00:00
|
|
|
static void Free(const void* ptr);
|
2022-12-06 07:59:41 +00:00
|
|
|
static int DMAToARAM(void*, void*, uint, EDMAPriority);
|
|
|
|
static int DMAToMRAM(void*, void*, uint, EDMAPriority);
|
2022-09-13 04:26:54 +00:00
|
|
|
private:
|
2022-10-09 05:37:23 +00:00
|
|
|
static uint mPreInitializeAlloc;
|
2022-12-06 07:59:41 +00:00
|
|
|
static const int kInvalidAlloc;
|
|
|
|
static const int kInvalidHandle;
|
2022-04-10 00:17:06 +00:00
|
|
|
};
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CARAMMANAGER
|