Commit Graph
1187 Commits
Author SHA1 Message Date
Emanueleandmugurc 30cc4ea2e6 feat(libkernel): start the guest off the main thread on macOS
AppKit, which SDL uses for windows, Metal surfaces, event pumping and game
controllers, works only on the main thread, and a guest never hands its
thread back. The macOS relinker emits a call to Aps5StartGuest as the
entry of a relinked executable; no library provided it.

- Aps5StartGuest runs the guest entry on a new thread with the stack size
  of the main thread (at least 8 MiB) and serves the main dispatch queue
  from the run loop of the main thread. The guest ends the process with
  exit; a guest entry that returns aborts.
- Aps5RunOnMainThread runs a function on the main thread and waits for it,
  or in place where the main thread is the caller or Aps5StartGuest was
  never called.
- libSceVideoOut sends its SDL calls through OnMainThread, which carries
  the exceptions back to the caller: the initialisation and shutdown of the
  video and game controller subsystems, the window, its Vulkan surface and
  drawable size, the event polling and the pad, mouse and keyboard input,
  which are created and destroyed there. On the other platforms the
  functions run in place.
- The flip test starts its tests through Aps5StartGuest on macOS, as a
  relinked guest does.

Co-authored-by: mugurc <[email protected]>
2026-10-25 16:02:42 +01:00
valenciana-nc 37ba4a9d2f fix(libkernel): reject ended threads in pthread_attr_get_np 2026-10-25 15:49:57 +01:00
orezraeyandClaude Opus 5.5 b78627d354 fix(libkernel): fail the yield loop setter on a destroyed mutex as measured on a PS5
On PS5 firmware 13.60 pthread_mutex_setyieldloops_np and
scePthreadMutexSetyieldloops return EINVAL on a destroyed mutex, as the
other spin and yield loop calls already did here. The default counts
(2000 spins for an adaptive mutex, 0 otherwise, 0 yields) match.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 11:41:31 -03:00
harisibrar1andClaude Opus 5.5 aebd8881d4 fix(libkernel): fail a write to a pipe without a reader with EPIPE on Windows
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 10:27:58 -04:00
orezraeyandClaude Opus 5.5 2d339842eb fix(libkernel): add 0x80020000 to any event fflags in sceKernelGetEventError as measured on a PS5
On PS5 firmware 13.60 sceKernelGetEventError returns 0x80020000 plus the
event's fflags in 32 bits for every non-zero fflags, including values
above 0xFFFF, where it used to throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 11:25:04 -03:00
orezraeyandClaude Opus 5.5 92448b72f9 fix(libkernel): accept any block size and a null block in the system software version getters as measured on a PS5
On PS5 firmware 13.60 sceKernelGetProsperoSystemSwVersion and
sceKernelGetSystemSwVersion return 0 for every value in the leading size
field, keep it, write the string and the packed version, and return 0
without writing for a null block.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 11:19:52 -03:00
Adrià FranchandClaude Sonnet 5.5 f63b27bdaa feat(libkernel): implement getlogin
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 15:07:38 +01:00
Yunus Shaikh 8be8dc83af Merge main into fix/libkernel-signal-handler-mask
Main's #10706 moves the declarations of exported functions and their types
into the libraries' public headers, and gives WaitForPendingInSet a
KernelTimespec timeout. The merge keeps this branch's DeliverUnblockedPending
and ChangeBlockedMask with main's KernelTimespec. It takes main's side of
the declarations in GuestSignalSets.cpp, whose setjmp and longjmp this
branch had added and libc's Api.hpp now declares. GuestSignalHandlerMask.cpp
includes the libkernel and libc public headers in place of its own
declarations and GuestSignalSet and GuestSigaction types, as the
public_headers audit requires.
2026-10-25 07:05:46 -07:00
GruzzberryandClaude Opus 5.5 e6b07323de feat(libkernel_sys): implement settimeofday
FreeBSD 11.4's kern_settimeofday rejects a timeval with a microsecond
field outside 0 to 999999 or a negative second field with EINVAL before
changing anything, sets the clock from a valid timeval, and then stores
the timezone, which gettimeofday reports. settimeofday now checks the
timeval the same way and throws for a valid one, as clock_settime does,
because the host clock is not changed. A timezone given without a
timeval is stored and gettimeofday reports it instead of 0 and 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 13:20:31 +00:00
harisibrar1andClaude Opus 5.5 e829b5c331 fix(libkernel): fail SO_ACCEPTFILTER with EINVAL on a socket that is not listening as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 09:15:05 -04:00
harisibrar1andClaude Opus 5.5 73fffbee8e fix(libkernel): refuse undefined protection bits in the map calls with EINVAL as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 09:13:23 -04:00
fogydes bde7cc210a fix(libkernel): report ECHILD to a Windows waiter another thread reaps first 2026-10-25 13:57:18 +01:00
fogydes 0514307ab8 fix(libkernel): translate waitpid child statuses to the guest numbering 2026-10-25 13:57:18 +01:00
fogydes df18d83072 docs: add the spawn role variable and shorten the waitpid debt 2026-10-25 13:57:18 +01:00
fogydes 723d932f73 feat(libSceLibcInternal): implement posix_spawn process creation and reaping 2026-10-25 13:57:17 +01:00
dwk001andClaude Opus 5.5 e632137d7c fix(libkernel): keep the mutex kind as a signed 16-bit value as firmware 13.42 does
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B7MJ4KkM4JNNWQxjsXT4ib
2026-10-25 12:53:57 +00:00
Adrià c2e087b2a6 Merge pull request #7049 from blawesom/followup/6510
fix(libkernel): retire an EV_ONESHOT note through its delete callback and follow Windows $Deleted paths
2026-10-25 12:38:21 +01:00
orezraeyandClaude Opus 5.5 b3b0760369 Merge main into fix/libkernel-rtld-thread-atexit-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 08:05:05 -03:00
Yunus Shaikh 00924d8f9f Merge main into fix/libkernel-getsockopt-net-sockets
Main extends the libkernel debt entry on libSceNet sockets with poll and
fcntl, where this branch adds getsockopt to the same entry; the merge keeps
both.
2026-10-25 03:59:43 -07:00
orezraeyandClaude Opus 5.5 20b38adb09 Merge main into fix/libkernel-socket-address-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 07:53:50 -03:00
Adrià c7d6660ef8 Merge pull request #9365 from thuanquang/docs/debt-sweep-kernel-sockets
docs(libkernel): correct three stale socket statements
2026-10-25 11:47:05 +01:00
Adrià 62660f3309 Merge pull request #9363 from thuanquang/docs/debt-sweep-kernel-misc
docs(libkernel): drop stale mlockall, open file limit and protection bit claims
2026-10-25 11:44:36 +01:00
Adrià 109d288487 Merge pull request #9359 from thuanquang/docs/debt-sweep-kernel-signals
docs(libkernel): drop the stale 32-signal limit from the pthread_sigmask entry
2026-10-25 11:41:41 +01:00
Adrià 43a4a36b95 Merge pull request #9298 from UnhealthyKraken/docs/kernel-cleanup-debt
docs(libkernel): record cleanup unwind and allocation limits
2026-10-25 11:38:09 +01:00
Adrià eddc9f9a09 Merge pull request #9239 from Dom3005/docs/debt-windows-directory-descriptor
docs(debt): match the Windows directory descriptor entry to the code
2026-10-25 11:34:30 +01:00
alnsx d5ed8797cc chore: merge main and use canonical test declarations 2026-10-25 05:46:51 -04:00
pushkarreddyy d2a54a6a43 docs(libkernel): record sysKernel update version and mode queries 2026-10-25 14:03:12 +05:30
Yunus Shaikh 18b4543ac2 docs(libkernel): note __Ux86_64_setcontext has no known prototype 2026-10-25 07:56:02 +00:00
Dean 9a2020c220 Merge pull request #10425 from Retr0G28/fix/sendfile-nonregular-einval
fix(libkernel): fail sendfile with EINVAL for a file that is not a regular file
2026-10-25 19:29:21 +13:00
orezraeyandClaude Opus 5.5 9319aeec2d Merge main into docs/libkernel-select-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 03:25:47 -03:00
harisibrar1 b8b42143b1 Merge main e7e3e9c198 into fix/pselect-pending-signal-eintr 2026-10-25 01:24:28 -04:00
Felipebmaitan f68eb887c9 docs(libkernel): record wait allocation failure ownership gap 2026-10-25 02:17:27 -03:00
Felipebmaitan 84340f6d63 fix(libkernel): avoid cancellation wakeups during thread exit 2026-10-25 02:13:36 -03:00
Felipebmaitan bc8562f746 fix(libkernel): preserve AIO request ownership and identities 2026-10-25 01:56:43 -03:00
xXPBSXxandClaude Sonnet 5.5 5c6cd07831 docs(debt): note what a title does with the sceKernelGetOperationMode values
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 04:58:21 +01:00
orezraeyandClaude Opus 5.5 472623ec33 docs(libkernel): mark the AF_INET bind and connect check order unmeasured
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 23:55:06 -03:00
orezraeyandClaude Opus 5.5 65e712b9c6 Merge main into fix/libkernel-socket-address-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 23:32:33 -03:00
milescovielloandClaude Opus 5.5 de5306dd29 docs(debt): record the unpinned fallback of the TSC frequency measurement
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 02:25:03 +00:00
Dean a2a67c726e Merge pull request #9059 from mehmetbayoglu/feat/libkernel-tls-get-addr
feat(libkernel): implement __tls_get_addr
2026-10-25 15:23:44 +13:00
Dean d7878da690 Merge pull request #9169 from slopgobblercobbler/fix/socket-addr-validation
fix(libkernel): validate address family against socket family in bind
2026-10-25 15:17:00 +13:00
frankea ad9a0c8ef9 fix(libkernel): report 12 GiB of direct memory, as a PS5 does
sceKernelGetDirectMemorySize returns 0x300000000 inside Gran Turismo 7 (PPSA01317) on a PS5 with firmware 13.40. DIRECT_MEMORY_SIZE was 13824 MiB.
2026-10-24 22:11:58 -04:00
babyhuey cf950fac5d feat(libkernel): answer kern.proc.pid for the calling process
Source Port (PPSA20040) checks whether a debugger is attached with
sysctl {CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()} into a 1,088-byte
buffer and tests P_TRACED (0x800) in ki_flag at offset 0x170; the MIB was
unsupported, so the title threw at start-up. Return a FreeBSD 11 amd64
kinfo_proc for the calling process with ki_structsize, ki_pid, ki_ppid and
ki_comm filled and every other field 0, so P_TRACED is clear. Like
kern.proc.vmmap, any other pid fails with ESRCH, a write with EPERM and a
short buffer with ENOMEM. The rest of the record is not measured on a
console and is recorded as debt.
2026-10-24 21:57:59 -04:00
slopgobblercobbler 9b4a3b3d81 feat(libkernel_sys): implement scePthreadMain through pthread_main_np 2026-10-25 02:28:39 +01:00
xXPBSXxandClaude Sonnet 5.5 127340cbb6 docs(debt): note the attributes titles pass to sceKernelCreateEventFlag
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 02:17:31 +01:00
slopgobblercobbler 7239ebb63e fix(libkernel): validate address family against socket family in bind 2026-10-25 02:14:14 +01:00
orezraeyandClaude Opus 5.5 284884d40b Merge main into fix/libkernel-cond-destroyed-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 22:12:05 -03:00
Henryisdjfunkyho 5d0ddabbde Merge remote-tracking branch 'origin/main' into fix/cancellable-timed-sleeps
# Conflicts:
#	core/libs/tests/GuestSleepCancel.cpp
2026-10-24 18:06:20 -07:00
Dean c6b318cfd9 Merge pull request #9165 from MaxLikesCode/fix/pthread-timed-self-lock
fix(libkernel): time out timed locks of a lock the caller already holds
2026-10-25 14:01:45 +13:00
Yunus Shaikh fc47c2f491 Merge main into fix/libkernel-getsockopt-net-sockets
Main's #10706 declares getsockopt_nid_postfix and sceNetGetsockopt in the libraries' public headers, so this branch's local declarations of them in GuestSceNet.cpp and libSceNet's Export.cpp go.
2026-10-24 17:34:28 -07:00
memob cf27259538 feat(libkernel): implement __tls_get_addr
Resolve a FreeBSD/ELF tls_index {module, offset} the way the relinker's
DTPMOD64 values are laid out: on Windows through the PE _tls_index the
module word points at and the thread's ThreadLocalStoragePointer, on
Linux through glibc's __tls_get_addr.
2026-10-24 20:29:20 -04:00