Implement gfxalloc

This commit is contained in:
Cuyler36
2023-03-17 21:28:05 -04:00
parent b7a609b9e1
commit 2bf1616199
7 changed files with 72 additions and 10 deletions
-3
View File
@@ -9,9 +9,6 @@
#include "JSystem/JKernel/JKRThread.h"
#include "JSystem/JSupport/JSUList.h"
#define ALIGN_PREV(u, align) (u & (~(align-1)))
#define ALIGN_NEXT(u, align) ((u + (align-1)) & (~(align-1)))
#define ARAM_GROUP_ID_ALL 0
#define ARAM_GROUP_ID_DEFAULT 0xFF
+19
View File
@@ -0,0 +1,19 @@
#ifndef GFXALLOC_H
#define GFXALLOC_H
#include "types.h"
#include "PR/mbi.h"
#ifdef __cplusplus
extern "C" {
#endif
extern Gfx* gfxopen(Gfx* gfxp);
extern Gfx* gfxclose(Gfx* gfxp, Gfx* gfxp_new);
extern Gfx* gfxalloc(Gfx** gfxpp, size_t size);
#ifdef __cplusplus
};
#endif
#endif
+3
View File
@@ -40,6 +40,9 @@ typedef u32 unknown;
#define AT_ADDRESS(x) : (x)
#define ALIGN_PREV(u, align) (u & (~(align-1)))
#define ALIGN_NEXT(u, align) ((u + (align-1)) & (~(align-1)))
#ifndef ATTRIBUTE_ALIGN
#if defined(__MWERKS__) || defined(__GNUC__)
#define ATTRIBUTE_ALIGN(num) __attribute__((aligned(num)))