prime/include/Kyoto/CARAMManager.hpp

39 lines
1.0 KiB
C++
Raw Normal View History

#ifndef _CARAMMANAGER
#define _CARAMMANAGER
#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,
};
static void Shutdown();
static void CollectGarbage();
2022-09-18 06:05:46 +00:00
static void PreInitializeAlloc(uint size) { mPreInitializeAlloc += size; }
static void Initialize(uint);
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);
private:
static uint mPreInitializeAlloc;
2022-12-06 07:59:41 +00:00
static const int kInvalidAlloc;
static const int kInvalidHandle;
};
#endif // _CARAMMANAGER