vitasdk
Documentation of the vitasdk
uid_class.h
Go to the documentation of this file.
1 
6 #ifndef _PSP2KERN_KERNEL_SYSMEM_UID_CLASS_H_
7 #define _PSP2KERN_KERNEL_SYSMEM_UID_CLASS_H_
8 
9 #include <vitasdk/build_utils.h>
10 #include <psp2kern/types.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 typedef int (* SceClassCallback)(void *item);
17 
18 typedef struct SceClass {
19  struct SceClass *next;
20  struct SceClass *root;
21  struct SceClass *prev;
22  const char *name;
23  struct SceClass *uidclass;
24  unsigned int attributes;
25  unsigned short itemsize;
26  unsigned short itemsize_aligned;
27  unsigned int unk1C;
30  unsigned int magic; /* 0xABCE9DA5 */
31 } SceClass;
33 
34 typedef struct SceObjectBase { // size is 0x8-bytes
35  union {
36  uint32_t sce_reserved[2];
37  struct { // used by internally.
38  void *object; // PUID entry, kernel heap object, etc...
40  };
41  };
42  uint32_t data[];
45 
50 
51 int ksceUIDClassInitClass(SceClass *cls, const char *name, void *uidclass, SceSize itemsize, SceClassCallback create, SceClassCallback destroy);
52 
53 int ksceKernelFindClassByName(const char *name, SceClass **cls);
54 
55 /* Macros for backwards compatibility */
56 #define ksceKernelCreateClass(cls, name, uidclass, itemsize, create, destroy) ksceUIDClassInitClass(cls, name, uidclass, itemsize, create, destroy)
57 
58 #define ksceKernelGetUidClass() ksceKernelGetUIDClass()
59 #define ksceKernelGetUidDLinkClass() ksceKernelGetUIDDLinkClass()
60 #define ksceKernelGetUidHeapClass() ksceKernelGetUIDHeapClass()
61 #define ksceKernelGetUidMemBlockClass() ksceKernelGetUIDMemBlockClass()
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* _PSP2KERN_KERNEL_SYSMEM_UID_CLASS_H_ */
uint32_t data[]
Definition: uid_class.h:42
int ksceKernelFindClassByName(const char *name, SceClass **cls)
SceClass * ksceKernelGetUIDMemBlockClass(void)
struct SceClass * uidclass
Definition: uid_class.h:23
struct SceClass * next
Definition: uid_class.h:19
unsigned int attributes
Definition: uid_class.h:24
void * object
Definition: uid_class.h:38
unsigned int unk1C
Definition: uid_class.h:27
SceClassCallback create_cb
Definition: uid_class.h:28
struct SceClass * prev
Definition: uid_class.h:21
unsigned short itemsize_aligned
Definition: uid_class.h:26
const char * name
Definition: uid_class.h:22
SceClass * ksceKernelGetUIDHeapClass(void)
SceClass * sce_class
Definition: uid_class.h:39
struct SceClass * root
Definition: uid_class.h:20
int(* SceClassCallback)(void *item)
Definition: uid_class.h:16
int ksceUIDClassInitClass(SceClass *cls, const char *name, void *uidclass, SceSize itemsize, SceClassCallback create, SceClassCallback destroy)
unsigned short itemsize
Definition: uid_class.h:25
unsigned int magic
Definition: uid_class.h:30
SceClassCallback destroy_cb
Definition: uid_class.h:29
SceClass * ksceKernelGetUIDDLinkClass(void)
VITASDK_BUILD_ASSERT_EQ(0x2C, SceClass)
SceClass * ksceKernelGetUIDClass(void)
Definition: uid_class.h:18
Definition: uid_class.h:34
unsigned int SceSize
Definition: types.h:56