Skip to content

Commit

Permalink
GUID stuff some fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Princess-of-Sleeping committed Apr 12, 2022
1 parent dc8a703 commit 27ff088
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion db/360/SceSysmem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ modules:
ksceGUIDGetObjectWithClass: 0x7ABFA9A7
ksceGUIDGetUIDVectorByClass: 0xEC7D36EF
ksceGUIDKernelCreateWithAttr: 0x53E1FFDE
ksceGUIDKernelCreateWithOpt: 0xDF0288D7
ksceGUIDOpenByGUID: 0xCF53EEE4
ksceKernelAddressSpaceFreeAllMemBlock: 0x89CE1F31
ksceKernelAddressSpaceSetPhyMemPart: 0x67955EE9
Expand All @@ -493,7 +494,6 @@ modules:
ksceKernelAlloc: 0xC0A4D2F3
ksceKernelAllocSystemCallTable: 0x5FFE4B79
ksceKernelCreateAddressSpace: 0x4A3737F0
ksceKernelCreateUidObj: 0xDF0288D7
ksceKernelDeleteAddressSpace: 0xF2D7FE3A
ksceKernelFindClassByName: 0x62989905
ksceKernelFree: 0xABAB0FAB
Expand Down
2 changes: 1 addition & 1 deletion db/363/SceSysmem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ modules:
kernel: true
nid: 0x02451F0F
functions:
ksceKernelCreateUidObj: 0xFB6390CE
ksceGUIDKernelCreateWithOpt: 0xFB6390CE
ksceKernelFindClassByName: 0x7D87F706
ksceKernelGetMemBlockType: 0xD44FE44B
ksceKernelRxMemcpyKernelToUserForPid: 0x2995558D
Expand Down
37 changes: 28 additions & 9 deletions include/psp2kern/kernel/sysmem/uid_guid.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
extern "C" {
#endif

typedef struct SceCreateUidObjOpt {
SceUInt32 flags;
typedef struct SceGUIDKernelCreateOpt {
union {
SceUInt32 flags;
SceUInt32 attr;
};
SceUInt32 field_4;
SceUInt32 field_8;
SceUInt32 pid;
SceUInt32 field_10;
SceUInt32 field_14;
SceUInt32 field_18;
SceUInt32 field_1C;
} SceCreateUidObjOpt;
} SceGUIDKernelCreateOpt;

/*
* Create a GUID object that belongs to the target process id
Expand All @@ -35,19 +38,17 @@ typedef struct SceCreateUidObjOpt {
*
* @return GUID on success, < 0 on error.
*/
SceUID ksceKernelCreateUidObj(SceClass *sce_class, const char *name, SceCreateUidObjOpt *opt, SceObjectBase **obj);
SceUID ksceGUIDKernelCreateWithOpt(SceClass *sce_class, const char *name, SceGUIDKernelCreateOpt *opt, SceObjectBase **obj);

/*
* Close GUID (Remove GUID)
* Close GUID (Inactive GUID)
*
* @param[in] guid - The remove target guid.
*
* @return 0 on success, < 0 on error.
*/
int ksceGUIDClose(SceUID guid);

#define ksceKernelDeleteUid(guid) ksceGUIDClose(guid)

/**
* Gets an object from a UID.
*
Expand All @@ -74,8 +75,6 @@ int ksceGUIDReferObject(SceUID guid, SceObjectBase **object);
*/
int ksceGUIDReferObjectWithClass(SceUID guid, SceClass *sce_class, SceObjectBase **object);

#define ksceKernelGetObjForUid(guid, sce_class, object) ksceGUIDReferObjectWithClass(guid, sce_class, object)

/**
* Gets an object from a UID with class and level.
*
Expand Down Expand Up @@ -104,8 +103,28 @@ int ksceGUIDReferObjectWithClassLevel(SceUID guid, SceClass *pClass, SceUInt32 l
*/
int ksceGUIDReleaseObject(SceUID guid);

/**
* Get created GUID vectors.
*
* @param[in] cls - The Class.
* @param[in] vis_level - The Visible level.
* @param[out] vector - The GUID vector output.
* @param[in] num - The GUID vector max number.
* @param[out] ret_num - The GUID vector result number.
*
* @return 0 on success, < 0 on error.
*/
int ksceGUIDGetUIDVectorByClass(SceClass *cls, int vis_level, SceUID *vector, SceSize num, SceSize *ret_num);


typedef SceGUIDKernelCreateOpt SceCreateUidObjOpt;

#define ksceKernelCreateUidObj(sce_class, name, opt, obj) ksceGUIDKernelCreateWithOpt(sce_class, name, opt, obj)
#define ksceKernelDeleteUid(guid) ksceGUIDClose(guid)
#define ksceKernelGetObjForUid(guid, sce_class, object) ksceGUIDReferObjectWithClass(guid, sce_class, object)
#define ksceKernelUidRelease(guid) ksceGUIDReleaseObject(guid)


#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 27ff088

Please sign in to comment.