From 41bd039ab64002251149f7882a268d23cf39b98e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20G?= Date: Fri, 25 Apr 2014 21:58:38 +0100 Subject: [PATCH] usersystemlib: sceKernelGetTlsAddr NID and doc --- include/usersystemlib_kernel.h | 6 +++--- lib/libKernel_Library.a | Bin 17916 -> 17910 bytes lib/libsceGe_lazy.a | Bin 2176 -> 2176 bytes src/usersystemlib/exports.exp | 2 +- src/usersystemlib/thread.c | 20 +++++++++----------- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/include/usersystemlib_kernel.h b/include/usersystemlib_kernel.h index 8732f55..28a1a61 100644 --- a/include/usersystemlib_kernel.h +++ b/include/usersystemlib_kernel.h @@ -101,13 +101,13 @@ s32 sceKernelGetThreadId(void); s32 sceKernelCheckThreadStack(void); /** - * \fixme Unknown. + * Gets a tls address. * - * @param arg0 Unknown. + * @param uid Unique tls identifier. * * @return A pointer, otherwise NULL on error. */ -void *Kernel_Library_FA835CDE(s32 arg0); +void *sceKernelGetTlsAddr(SceUID uid); /* Lightweight Mutex */ diff --git a/lib/libKernel_Library.a b/lib/libKernel_Library.a index 2fe6fae8f1bf50c044400a424da4e74d60f135a3..67c6ce6afb4b1ca2406092c0b862ed3fe6b94846 100644 GIT binary patch delta 736 zcmey<&G@aGae`F6rG<&9g@u8sf`Wkp2q2RR3Z@1YU{M8y1TF>!1|bFp7AXb>4lM=- z?sE(b{CNxv!a#AcRSXPLUJMMfpBNYvr!g?7+A%O_JY!(cX=7k8P-0*(KE}Xcp2omn z&BwrCw~2wlDJ(v|xTG{GJ~w~k%y>q|_{kIPq$Ue7Nld)M$?cw65|UHwn37V&u-TF6 zEu#p+g@y(OK<5ETh0RVZf0(h#Os;cE+q{EA3x_P9X4>W$9yJ`Y>vYmK|KV4{Aq&zw zLl~D{kgSC`F4=vGX`63I>ESRL2zS1 z0f*iO16(e7XN=3lK66}d1o>@_^&dvYg2{?1KfrM6-Guer1Szzp&-D-&cFZw!u6;C delta 749 zcmey?&G@IAae`F6v8A!8nW>?Hf&vf$0Wzte0G0rYCvY(^FbFX)u*fhlaOf~Fa9?0x z;4ffc5awZE5L?5*AmzirAp3=ZL2(8HgQ^1qgT@O62AvKD1_Koa2ICV94CWaO4Aue+ z40c->7@Q*Ft=hVw~QhPhZ-6f09^?pH#@NWVa6^Kz%c>4%wz-Mw9QdGYB*%q=%j7_#jk{2cC&$S z4-T0NVz^`qq^4lkGdX}GZF8NR77p10skF^XN_u!?PpRUP1^KZ^6Neu+uhHqiVJgT) z>kM$Y2xMxI2@X>ygWUVc9G8ngCeO0|!^oJwSzd*Saq=uXk;!ZA#IZ&mIAHATaXABI a)FY<|#?5?Oa~YL!BpP691p_8_1_l6E8K=Sk diff --git a/lib/libsceGe_lazy.a b/lib/libsceGe_lazy.a index 2e2f6312e6e78ee628d0dea73d156f41a8576063..8346c307c3983a2be338f992c75d98192370be60 100644 GIT binary patch delta 70 wcmZn=Y!I9v#bIe-VrpSwU^-Fhf(VSQpkQcVU;ri+HnTB)V8$-P#ahM;06_o`SpWb4 delta 70 vcmZn=Y!I9v#bIn|Y-(m|XfRRff(VSQpkQcVU;rUEvoU^P#xBFfTE+|jJK7IS diff --git a/src/usersystemlib/exports.exp b/src/usersystemlib/exports.exp index 06ab84d..cebdc53 100644 --- a/src/usersystemlib/exports.exp +++ b/src/usersystemlib/exports.exp @@ -26,7 +26,7 @@ PSP_EXPORT_FUNC_HASH(sceKernelReferLwMutexStatus) # avoid name collision with ThreadMan PSP_EXPORT_FUNC_NID(_sceKernelCheckThreadStack, 0xD13BDE95) PSP_EXPORT_FUNC_HASH(sceKernelTryLockLwMutex) -PSP_EXPORT_FUNC_NID(Kernel_Library_FA835CDE, 0xFA835CDE) +PSP_EXPORT_FUNC_HASH(sceKernelGetTlsAddr) PSP_EXPORT_END PSP_EXPORT_START(sceGe_lazy, 0x0011, 0x0001) diff --git a/src/usersystemlib/thread.c b/src/usersystemlib/thread.c index 4bef4bc..56b52bb 100644 --- a/src/usersystemlib/thread.c +++ b/src/usersystemlib/thread.c @@ -37,10 +37,11 @@ s32 _sceKernelCheckThreadStack(void) } // Kernel_Library_FA835CDE -void *Kernel_Library_FA835CDE(s32 arg0) +void *sceKernelGetTlsAddr(SceUID uid) { - void *ptr; + void *addr; s32 *k0; + s32 res; // SceThread* ? k0 = (s32*)pspGetK0(); @@ -58,23 +59,20 @@ void *Kernel_Library_FA835CDE(s32 arg0) return NULL; } - if (arg0 < 0) { + if (uid < 0) { return NULL; } // range k0[16-31] - ptr = (void*)k0[((arg0 >> 3) & 0xF) + 16]; + addr = (void*)k0[((uid >> 3) & 0xF) + 16]; - // this is why I think that a pointer is returned - if (ptr == NULL) { // loc_000004FC - s32 ret; + if (addr == NULL) { // loc_000004FC + res = _sceKernelAllocateTlspl(uid, &addr, 0); - ret = _sceKernelAllocateTlspl(arg0, &ptr, 0); - - if (ret < 0) { + if (res < 0) { return NULL; } } - return ptr; + return addr; }