aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/sm/sm_controller.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[hle] constexpr handler dispatch maps, introduce version gating ↵PavelBARABANOV2026-10-151-0/+128
| | | | | | | | | | | | | | | | | (#4480)" (#4532) This reverts commit 218c6705d950635bc18f8458d738a1996fb592b6. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4532 Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com>
* [hle] constexpr handler dispatch maps, introduce version gating (#4480)lizzie2026-10-131-128/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR primarily focuses on upbringing constexpr maps for handlers. Each time an HLE object of a service is construed, it registers it's own handlers, over and over. Regardless of whetever it needs them at the moment or not. Additionally we don't require to keep track of different function pointers amongst each object. This can be done by overriding the given function instead, as opposed to having a separate hash map for every given object. In other words: Remove handlers (and handlers_tipc) map for every instance then read from a static defined per-class. - [x] Migrate all HLE functions to new `frozen::map` constexpr time finder - [ ] Measure if this approach actually makes better codegen Optional: - [x] Properly gate all functions (that have versions commented next to them) - [x] Maybe store `HandlerFnP<>` and `const char*` separately, version gating can go in a different map as well Information such as name can be used on debug builds, but doesn't particularly help on release as one can consult an external reference (or have an annotated IPC map) Signed-off-by: lizzie <lizzie@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Co-authored-by: Maufeat <sahyno1996@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4480 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [hle] remove parent object reference data on Request/Response builders, pass ↵lizzie2026-06-291-1/+1
| | | | | | | | | | | | | | | | by argument (#3774) anyways this should remove a bunch of redundant code/stack usage for response builders (ahem, msvc) SHOULD help games that use IPC heavily like PKZA and whatnot biblical levels of performance greed Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3774 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com>
* [video_core, hle] remove redundant parent references in system structs (#3908)lizzie2026-06-231-3/+2
| | | | | | | | | | reworked a bit to remove references of parent objects and instead pass as arguments to methods to prevent useless reloads Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: maufeat <sahyno1996@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3908 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev>
* [common/logging] Simplify logging logic and fix issues when logging before ↵lizzie2026-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | system is created (#3688) - our logging code was bigger than spdlog itself, why???? just keep it simple - fix issues when logging before logging system is even started - removes the "initialized logging twice" issue - removes uneeded indirection in file logging - uses direct formatting instead of jumping hoopla-around the fmt::format() ressult - code duplication and dead code removal as usual I did explore dup2() but I think it's not worth the hassle I did try `fwopen()` but it's better if things are just kept as-is. there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [core/hle] implement Unknown330 and stub extra 20/15 missing funcs (#3269)lizzie2026-01-061-1/+1
| | | | | | | | | | | | stub for IApplicationFunctions::Unknown330; stubs for BSD sockets values Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3269 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [meta] fix license headers (#2547)lizzie2025-09-211-0/+3
| | | | | | | Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2547 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [cmake] enable clang-cl and WoA builds (#348)lizzie2025-09-091-4/+4
| | | | | | | | | | | | | | Compilation and CMake fixes for both Windows on ARM and clang-cl, meaning Windows can now be built on both MSVC and clang on both amd64 and aarch64. Compiling on clang is *dramatically* faster so this should be useful for CI. Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: crueter <crueter@crueter.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/348 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* service: sm/kernel/loader: Implement QueryPointerBufferSize, automatic ↵JPikachu2025-04-301-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pointer buffer sizing, and SM service improvements This commit introduces multiple improvements to IPC handling and system management services, enhancing game compatibility and emulator stability. --- 1. Fully Implemented QueryPointerBufferSize Service: - Exposes the per-process IPC pointer buffer size through `QueryPointerBufferSize` instead of returning stubbed values. - Added `m_pointer_buffer_size` field to `KProcess`, initialized with a safe default (0x8000). - Introduced getter and setter methods (`GetPointerBufferSize()` / `SetPointerBufferSize()`). - Registered new handler in `sm_controller` for handling QueryPointerBufferSize requests. - Ensures accurate buffer size reporting for games relying on this service. --- 2. Automatic Pointer Buffer Sizing Per-Game: - Automatically determines heap size by parsing `main.npdm` from the game’s ExeFS: - Heap size > 1 GiB → pointer buffer size set to `0x10000`. - Heap size > 512 MiB → pointer buffer size set to `0xC000`. - Otherwise, defaults to `0x8000`. - Gracefully handles missing or malformed `main.npdm` by falling back to default settings. - Automatically configures pointer buffer size during `AppLoader_NCA::Load`. - Added logging for heap size detection and buffer size configuration for easier debugging. --- 3. SM Service Improvements: - Added full implementation of `QueryPointerBufferSize` within the SM service framework. - Cleaned up stubbed methods and ensured correct domain handling. - Registered new service commands (e.g., `SetPointerBufferSize` and `QueryPointerBufferSize`) in `sm_controller`. - Improved session handling with proper conversion to domain objects where necessary. --- Benefits: - Greatly improves compatibility with games that require larger IPC pointer buffers - Eliminates the need for manual per-game pointer buffer overrides. - More accurate emulation of Switch system services, improving stability for both commercial titles and homebrew. - Provides cleaner logging for easier debugging and maintenance. - Future-proofs IPC handling for upcoming titles with higher memory demands. --- Additional Notes: - Default pointer buffer size remains 0x8000 for smaller titles or if heap size cannot be determined. - Falls back to safe defaults without affecting overall emulator performance. - All new service calls properly registered and integrated without breaking existing functionality.
* kernel: fix resource limit imbalanceLiam2023-12-221-4/+3
|
* kernel: match calls to Register and UnregisterLiam2023-04-291-0/+3
|
* kernel: convert KPort, KSessionLiam2023-03-121-1/+1
|
* service: move hle_ipc from kernelLiam2023-03-011-5/+5
|
* service: refactor server architectureLiam2023-02-211-3/+4
| | | | Converts services to have their own processes
* kernel/svc_types: refreshLiam2022-11-091-2/+2
|
* k_server_session: add SendReplyHLELiam2022-10-311-4/+1
|
* kernel: invert session request handling flowLiam2022-10-311-10/+11
|
* kernel: more complete fix for KPort reference countingLiam2022-10-311-10/+23
|
* kernel: remove most SessionRequestManager handling from KServerSessionLiam2022-10-191-2/+3
|
* core: Replace all instances of ResultCode with Resultgerman772022-06-261-1/+1
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* core: Remove unused includesameerj2021-11-031-2/+0
|
* service: Append service name prefix to common filenamesMorph2021-07-141-0/+80