Commit Graph
31 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 27ce1be6e9 Module start/stop threads: Honor the whole SceKernelSMOption
sceKernelStartModule, sceKernelStopModule and the self-stop calls now
check their option first: with SDK 2.08 or later its size must be 0x14,
and attribute bits outside 0x00F06000 are an error.

The option's attribute is added to the module's thread attribute rather
than ignored (or, when stopping, replacing it), and the default attribute
is 0 rather than the module's own attribute. A nonzero mpidstack puts the
stack in that partition, which has to be user-accessible for a user
module and kernel-only for a kernel module.

A failed thread creation is now returned instead of asserting.

Hardware test: modules/startoptions.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 10:10:22 -06:00
Henrik RydgårdandClaude Opus 5.5 f47269864a _sceKernelAllocateTlspl: Check user pointers, support the timeout
The third argument is a timeout pointer, as threadman.prx shows. A kernel
address from user mode is ILLEGAL_ADDR there; we used to write through it.
Also, no lookup by index: the syscall requires the exact uid.

Adds the threads/tls/allocate test, recorded on hardware.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 10:05:07 -06:00
Henrik RydgårdandClaude Opus 5.5 ac39c55c36 Implement _sceKernelAllocateTlspl
This is the syscall usersystemlib's sceKernelGetTlsAddr makes when the
thread's cached TLS address is null, as (uid, &addr, 0). Code that has to
run before usersystemlib.prx is loaded (like plugins built with a Rust SDK)
inlines sceKernelGetTlsAddr and imports this directly.

Shares the allocation with sceKernelGetTlsAddr. A thread waiting on a full
pool stores its address pointer as the wait value, so no state changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 10:04:44 -06:00
Henrik Rydgård 8cb1732564 Clean up the memory partition ID enum 2026-07-25 14:53:02 +02:00
Henrik Rydgård 8fe166e182 Expose VPL internals as well. 2025-03-31 10:32:01 +02:00
Henrik Rydgård 91809b8667 Expose FPL 2025-03-31 10:26:57 +02:00
Unknown W. Brackets 251cc73afd Kernel: Allow volatile for MsgPipe buffers. 2022-09-20 09:20:05 -07:00
sum2012 8a905bbb9d Wrap some SysMemForKernel
Used in "Hatsune Miku Project Diva Extend" chinese patched version
Prepare real support the chinese patched game.
2020-06-07 11:16:46 +08:00
Henrik Rydgård e3aa2f5e4c Assorted fixes (build and crash) 2020-04-26 11:19:31 +02:00
Henrik Rydgård bf73d3d663 Address Unknown's feedback
https://github.com/hrydgard/ppsspp/pull/7965/files
2020-04-26 11:19:31 +02:00
sum2012 a8c2c02b82 Move SysMemForKernel to sceKernelMemory
As SysMemForUser in there
2020-04-26 11:18:41 +02:00
Unknown W. Brackets 0b43e28595 Move SysMemForKernel to sceKernelMemory. 2016-08-04 09:46:27 -07:00
Unknown W. Brackets abacba4e31 Clarify some module loading code. 2014-08-17 14:26:00 -07:00
Unknown W. Brackets e73d43c434 Correct sceKernelTlspl func names, etc.
This is mostly pedantic but it's nice to have the right names.
2013-12-02 23:40:16 -08:00
Unknown W. Brackets 18832f3ca7 Wrap sceKernelFreeFpl() and use better errors. 2013-08-25 16:38:49 -07:00
Unknown W. Brackets 6c6aa1b8ee Wrap sceKernelAllocateFpl() and friends. 2013-08-25 16:38:49 -07:00
Unknown W. Brackets a947c95829 Clean up sceKernelReferFplStatus(). 2013-08-25 16:38:47 -07:00
Unknown W. Brackets fb95f07c5d Implement cancel and delete for fpls. 2013-08-25 16:38:47 -07:00
Unknown W. Brackets f48b730828 Wrap sceKernelCreateFpl and fix refer status.
Just initial changes to make it test properly.
2013-08-25 15:14:20 -07:00
Unknown W. Brackets e77647a394 Basically working implementation of TLS funcs.
But doesn't wait at all, which it should.
2013-04-14 16:36:02 -07:00
Unknown W. Brackets a68798225a Give ThreadManForUser_8DAFF657 and friends a name.
Calling allocate on the same thread gives the same ptr, but on a different
one it waits or returns a new ptr.

Let's call it thread local storage for now.
2013-04-14 13:02:01 -07:00
Unknown W. Brackets 42b925a440 Initial stab at implementing some new memory funcs.
Borrowed from JPCSP, kept simple.  Need to do tests.
2013-04-07 20:57:53 -07:00
Unknown W. Brackets 76e693f674 Cleanup the other vpl functions. 2013-01-18 01:38:15 -08:00
Unknown W. Brackets 4c510b5649 Clean up sceKernelFreeVpl(), not waking yet. 2013-01-18 01:38:13 -08:00
Unknown W. Brackets c8bb837996 Implement basic waiting for VPL allocation.
Always times out so far, though.
2013-01-18 01:38:13 -08:00
Unknown W. Brackets 373f1f8655 Cleanup sceKernelCreateVpl() and add warns/errors. 2013-01-18 01:38:11 -08:00
Unknown W. Brackets 3ed2045f6b Add state saving to tertiary kernel modules. 2012-12-28 13:55:25 -08:00
Unknown W. Brackets 595759ef78 Implement a factory for kernel objects.
Couldn't think of a better way to do this, maybe there's some fancy
one I don't know about.

Also finished up a couple left over kernel objects.

Maybe a quarter the way there?
2012-12-28 13:55:22 -08:00
Xele02 020e4e7f13 Add code for sdk version info
Modify Encrypt file data
2012-12-28 11:42:41 +01:00
Henrik Rydgard 64cc573703 Switch to "GPL 2.0 or later" for various reasons. I wrote most of the code I imported from Dolphin (which is GPL2-but-not-later), so it should be OK. 2012-11-04 23:24:00 +01:00
Henrik Rydgard 4f7ad15758 Add snapshot of the whole source code. 2012-11-01 16:19:01 +01:00