Commit graph

17 commits

Author SHA1 Message Date
Stephen Miller
99b90cbd5c
Minor libkernel changes (#2721)
* sceKernelDebugOutText

Some homebrew use this for logging, and these logs do show up in console klogs.
I wasn't sure where the most suitable place for this function would be, so I made a separate file for these debug functions.

* Implement kernel exit

Some homebrew I have use this exit when an error occurs. Since actually closing the emulator isn't implemented yet, I've used an unreachable message that logs the status code.
I've placed it in process.cpp for now, let me know if I should change that.

* Improved implementations for sceKernelDebugRaiseException functions

These functions take in two parameters, an error code and some other value that I have no idea what is for. If that second parameter is not zero, they return ORBIS_KERNEL_ERROR_EINVAL before any calls to mdbg_service.
These improved implementations add the early error return and a message with the error code to the unreachable.

* Add missing exports

Homebrew apps like to use these kernel exports of posix functions instead.

* Clang
2025-03-30 01:27:33 +02:00
Pavel
8bcdd9c068
Fix sceKernelLoadStartModule (#2635) 2025-03-10 11:12:12 +02:00
panzone91
a711f4d86e
libkernel: improve module finding in sceKernelLoadStartModule (#2541)
* libkernel: improve module finding in sceKernelLoadStartModule

* clang-format

* asserts for system module

* fixes

* linting

* cleaning

* fix linker impl
2025-03-09 23:44:17 +02:00
Stephen Miller
20ea0ee190
Handle error behavior in sceSysmoduleGetModuleInfoForUnwind stub (#2629)
* Stubby implementation of sceSysmoduleGetModuleInfoForUnwind

* Update sysmodule.cpp

* Minor cleanup
2025-03-09 23:17:33 +02:00
Stephen Miller
b51c767296
Better bounds checks for sceKernelDlsym (#2394)
Unity, being the awful game engine it is, checks for a return value of zero to determine if sceKernelLoadStartModule failed. This results in it throwing an error code into sceKernelDlsym's handle parameter when the module it's searching for doesn't exist.
2025-02-09 19:31:07 -08:00
hspir404
c5cd4bc5cf
Remove log line that was consuming as much as 0.6ms frame time (#2335) 2025-02-03 02:37:11 -08:00
georgemoralis
8aea0fc7ee
Revert "libkernel: handle special case in path for load module (#2269)" (#2298)
This reverts commit ec0cf25097.
2025-01-31 12:54:16 +02:00
panzone91
ec0cf25097
libkernel: handle special case in path for load module (#2269)
* libkernel: handle special case for load module

* fix linting
2025-01-31 10:51:03 +02:00
squidbus
af8c748e9c
elf_info: Fix GCC build. (#2089) 2025-01-07 17:37:08 +02:00
psucien
ddc658f8c8 clang-format 2025-01-04 00:32:17 +01:00
squidbus
7153bc8d8f
kernel: Check PSF for neo mode support. (#2028) 2025-01-04 00:29:09 +01:00
TheTurtle
8acefd25e7
hot-fix the hot-fix 2024-12-13 18:26:16 +02:00
TheTurtle
bab00dbca8
kernel: Fix module finding
Patch by Elbread
2024-12-13 18:23:01 +02:00
Daniel R.
fea2593ab4
The way to Unity, pt.3 (#1681) 2024-12-08 18:30:33 +02:00
Vinicius Rangel
2380f2f9c9
Virtual device abstraction (#1577)
* IOFile: removes seek limit checks when file is writable

* add virtual devices scaffold

* add stdin/out/err as virtual devices

* fixed some merging issues

* clang-fix

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2024-12-05 18:00:17 +02:00
TheTurtle
5b6e0ab238
core: Library cleanup (#1631)
* core: Split error codes into separate files

* Reduces build times and is cleaner

* core: Bring structs and enums to codebase style

* core: More style changes
2024-11-30 22:37:36 +02: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