Commit Graph

6 Commits

Author SHA1 Message Date
Vladislav Mikhalin
e1ecd8e98c
threads: initialize tls on thread creation (take 2) (#4070) 2026-02-24 20:35:05 +03:00
Stephen Miller
6a7f8a9e5a
Libs.LibcInternal: _Fofind, _Lockfilelock, _Unlockfilelock, _Foprep, _Fopen, fopen, fflush, _Nnl, _Fspos, fseek, _Frprep, fread, _Fofree, fclose, _Mtxinit, _Mtxlock, _Mtxunlock, _Mtxdst implementations (#4019)
* Initial definitions

* internal__Fofind

* Libcinternal threads

fopen stores a valid pthread mutex in the FILE struct. Since this is exposed to the game/app, we need to handle this accurately.

* internal__Foprep (and various other functions called in it)

* Actual fopen implementation

At long last, an actual function I'm supposed to implement.

* fflush + compile fixes

* fseek implementation

Comes with functions fseek calls, aside from fflush which I pushed earlier.

* fread, _Frprep

Also changed some parameter names a tad to match how I named things in my decomp.
And fixed some bugs with how I was handling the weird offseted mode thing

* fclose, _Fofree

Not confident on this one, but we'll see I guess.

* Bug fixing

No more crashes at least, fread seems to be broken though.

* fopen bugfixes

Behavior now matches LLE, at least in how LLE font seems to use it.

* Fix _Frprep

Seems like everything works now?

* Logging

Probably going to need to swap lseek and read logs to debug/trace later but this is for debugging.

* Remove alignment check

Seems I must've misinterpreted some of what Ghidra spat out, since libSceNgs2 is calling with size 1, nmemb 4.

* Reduce fseek, fread logs to trace

* Clang
2026-02-11 08:13:28 +02:00
squidbus
f94c7e52b7
kernel: Implement scePthreadGetaffinity (#2916) 2025-05-12 10:46:53 -07:00
squidbus
678f18ddb9
core: Introduce host call wrapper. (#2913)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2025-05-11 20:27:54 -07:00
polyproxy
1926900945
hotfix: reset stop source on thread stop 2025-01-02 12:30:05 +01:00
TheTurtle
c4506da0ae
kernel: Rewrite pthread emulation (#1440)
* libkernel: Cleanup some function places

* kernel: Refactor thread functions

* kernel: It builds

* kernel: Fix a bunch of bugs, kernel thread heap

* kernel: File cleanup pt1

* File cleanup pt2

* File cleanup pt3

* File cleanup pt4

* kernel: Add missing funcs

* kernel: Add basic exceptions for linux

* gnmdriver: Add workload functions

* kernel: Fix new pthreads code on macOS. (#1441)

* kernel: Downgrade edeadlk to log

* gnmdriver: Add sceGnmSubmitCommandBuffersForWorkload

* exception: Add context register population for macOS. (#1444)

* kernel: Pthread rewrite touchups for Windows

* kernel: Multiplatform thread implementation

* mutex: Remove spamming log

* pthread_spec: Make assert into a log

* pthread_spec: Zero initialize array

* Attempt to fix non-Windows builds

* hotfix: change incorrect NID for scePthreadAttrSetaffinity

* scePthreadAttrSetaffinity implementation

* Attempt to fix Linux

* windows: Address a bunch of address space problems

* address_space: Fix unmap of region surrounded by placeholders

* libs: Reduce logging

* pthread: Implement condvar with waitable atomics and sleepqueue

* sleepq: Separate and make faster

* time: Remove delay execution

* Causes high cpu usage in Tohou Luna Nights

* kernel: Cleanup files again

* pthread: Add missing include

* semaphore: Use binary_semaphore instead of condvar

* Seems more reliable

* libraries/sysmodule: log module on `sceSysmoduleIsLoaded`

* libraries/kernel: implement `scePthreadSetPrio`

---------

Co-authored-by: squidbus <175574877+squidbus@users.noreply.github.com>
Co-authored-by: Daniel R. <47796739+polybiusproxy@users.noreply.github.com>
2024-11-21 22:59:38 +02:00