Commit Graph

36 Commits

Author SHA1 Message Date
Lizardy 5eecd089ab
thread_management.cpp: Various Mandatory Threading Fixes | Resolve #398 (#394)
* Handle empty mutex attribute

- scePthreadMutexInit did not return default when the mutex attributes were empty, now it does

* fix conditional unsafety

* Update thread_management.cpp

fix deref

* accurate heap api

- modified HeapAPI to a struct with preset function fields
- utilized the full array parameter passed to _sceKernelRtldSetApplicationHeapAPI

* fallback to std malloc

* clang format

* Declare all HeapAPI replacement functions

- calloc, realloc, memalign, reallocalign, malloc_stats, malloc_stats_fast, malloc_usable_size
- posix_memalign corrected parameters

* resolve suggestions

- `using` definition replacement for AppHeapAPI
- linux uses heap_malloc, windows uses std::malloc

---------

Co-authored-by: microsoftv <6063922+microsoftv@users.noreply.github.com>
2024-08-13 09:08:03 +03:00
TheTurtle a2cd1669b6
memory: Cleanups and refactors (#324)
* memory: Various fixes

* Added (Partial) sceKernelBatchMap/sceKernelBatchMap2

* memory: Rename and implement batch unmap

* memory: Remove uneeded assert

* memory: Commonize free search routine

* memory: Contains check is inclusive

* memory: Address some alignment issues

* clang format

---------

Co-authored-by: raziel1000 <ckraziel@gmail.com>
2024-07-25 23:01:12 +03:00
georgemoralis 3b87c3c128 moved elf logging to DebugDump fuction , which can be enabled in config . This reduces main log file a lot 2024-07-01 23:07:57 +03:00
georgemoralis 0ada442cbc
Stabilization8 (#218)
* disable configured flexible memory size (caused issues in some games)

* fixed case S_OR_B64 for blazing chrome

* submodules updates and fixes for latest SDL

* stubbed _sigprocmask (not handled and spams too much)

* added ReplaceOp case in Stencilop

* dummy ajm module added
2024-06-27 16:37:17 +03:00
IndecisiveTurtle 3a80df007e linker: More null check 2024-06-26 18:05:31 +03:00
IndecisiveTurtle 73d60b7e8d linker: Set rela bits for all symbol types 2024-06-22 18:09:04 +03:00
IndecisiveTurtle 30351ad112 linker: Fix TLS for dynamic modules
* Technically not fully accurate but it works. TlsGetAddr should handle dynamic allocation of TLS blocks
2024-06-22 18:09:04 +03:00
IndecisiveTurtle 2506a285f4 kernel: Implement some functions 2024-06-22 18:09:03 +03:00
TheTurtle c5d1d579b1
core: Many things (#194)
* video_core: Add a few missed things

* libkernel: More proper memory mapped files

* memory: Fix tessellation buffer mapping

* Cuphead work

* sceKernelPollSema fix

* clang format

* fixed ngs2 lle loading and rtc lib

* draft pthreads keys implementation

* fixed return codes

* return error code if sceKernelLoadStartModule module is invalid

* re-enabled system modules and disable debug in libs.h

* Improve linux support

* fix windows build

* kernel: Rework keys

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2024-06-15 14:36:07 +03:00
TheTurtle 728249f58d
core: Properly implement TLS (#164)
* core: Split module code from linker

* linker: Properly implement thread local storage

* kernel: Fix a few memory functions

* kernel: Implement module loading

* Now it's easy to do anyway with new module rework
2024-06-05 22:08:18 +03:00
psucien f624f7749c
Fixes and QoL (#159)
* to ensure that we're not unlocking submits too early

* a final touch

* video_core: texture_cache: fix for page table corruption

* core: linker: a name for the game main thread

* libraries: gnmdriver: an option to dump application command lists

* libraries: kernel: named guest threads

* video_core: added a heuristic for determination of CB/DB surface extents

* fix for rebase leftover
2024-06-01 23:50:03 +03:00
TheTurtle 1b9bf924ca
core: Rewrite thread local storage implementation (#118) 2024-05-01 13:38:41 +03:00
GPUCode 5e2ac6c72b src: Reorganize and cleanup libraries 2024-04-14 00:37:17 +03:00
georgemoralis 6f1c2d3060 clang format fix 2024-04-09 13:40:03 +03:00
georgemoralis 7b16e9af23 improved linker resolver 2024-04-09 13:39:35 +03:00
whereismyfoodat e272b152ed small fixes , cleanups 2024-03-27 08:41:14 +02:00
georgemoralis da7b4df1c3 implemented sceKernelGetProcParam 2024-03-26 18:48:26 +02:00
georgemoralis 683a0d55bf we can now load libc.prx 2024-03-26 18:29:37 +02:00
georgemoralis 1a7f5f7b31 function to start modules 2024-03-26 18:13:27 +02:00
georgemoralis bc7228fcb2 relocate before execution 2024-03-26 17:33:48 +02:00
georgemoralis e5a224aa96 rewrote relocations 2024-03-26 17:17:59 +02:00
georgemoralis 7dbe258edc improved LoadSymbols for export support 2024-03-26 14:05:18 +02:00
georgemoralis f70fbcac19 linker : Resolve can now load exports as well 2024-03-26 12:57:18 +02:00
georgemoralis 596831947e small improvements on linker Resolve method 2024-03-26 12:31:46 +02:00
georgemoralis 02dcf4d45c
LLE libc + other fixes part1 (#97)
* app0 folder is absolute

* some improvements on symbols types

* clang format

* missing libs.h

* improved symbols_resolver

* moved config to config folder

* functions to dump import functions

* improved logging output

* option for debugdump and improvements

* Apply suggestions from code review

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>

* clang format

---------

Co-authored-by: GPUCode <47210458+GPUCode@users.noreply.github.com>
2024-03-11 13:26:33 +02:00
GPUCode 79d6c8a377
common: Rewrite logging based on cut down citra logger (#86)
* common: Rewrite logging based on cut down Citra logger

* code: Misc fixes

* core: Bring back tls handler

* linker: Cleanup

* config: Remove log level

* logging: Enable console output by default

* core: Fix windows build
2024-02-28 00:10:34 +02:00
GPUCode 584b7d2b15 chore: Make shadps4 REUSE compliant 2024-02-23 23:33:43 +02:00
GPUCode 6f4c6ae0bb
code: Add clang-format target and CI workflow (#82)
* code: Add clang format target, rules and CI workflow

* code: Run clang format on sources
2024-02-23 22:57:57 +02:00
GPUCode fe43558779 common: Rework timekeeping with native RDTSC and port to linux 2024-02-23 11:30:06 +02:00
Stefanos Kornilios Mitsis Poiitidis 724c56d8aa Basic TLS with patching + int 0x80 2024-01-20 14:29:23 +02:00
georgemoralis af18453950 initial PT_TLS support 2023-11-21 17:27:11 +02:00
georgemoralis ae12f351f8 better posix errors 2023-11-12 13:23:35 +02:00
georgemoralis a10af46153 some refactoring on thread class 2023-11-10 20:51:02 +02:00
georgemoralis 86bc2d427f moved thread_management to proper package 2023-11-10 17:31:56 +02:00
GPUCode 79c9d9ebd1 kernel: To snake case 2023-11-06 01:19:57 +02:00
GPUCode 369d92fa56 core: Reorganize 2023-11-06 01:11:54 +02:00
Renamed from src/core/PS4/Linker.cpp (Browse further)