aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/k_process.cpp
Commit message (Collapse)AuthorAgeFilesLines
* core: use the 12 GiB layout and auto-stub IPC for Switch 2 titlesTakoroka6 days1-0/+1
| | | | | | | | | Switch 2 titles size their heap from the total memory and stop at the first unimplemented command, so they only booted with the 12 GiB layout and EDEN_NX2_AUTO_STUB set by hand. Detect them from main.npdm before the kernel starts and apply the layout as a per-game value (the configured layout comes back once the game is closed), and auto-stub unknown commands from Switch 2 processes.
* Switch 2: window image sizes, queue semaphores, built-in fonts, memory budgetTakoroka7 days1-0/+7
| | | | | | | | | | | | - gsv 1510 CalculateRequirements: block-linear size/alignment for window images. - nvhost-gpu: Switch 2 channel event 7 is a real (unsignalled) event. - Puller mirrors NVN2 queue semaphore releases into the page the CPU and GPU wait on (the first two-page nx2:gpu region); EDEN_NX2_METHOD_TRACE logs methods. - pl:u 2000/2010 GetBuiltInFontSharedMemory/GetBuiltInFontData serve plain TTF copies of the shared fonts. - Switch 2 processes count the alias region in their max memory, so the game's nninitStartup heap (total - 6.3 GiB) has room for its sound heap. - gdbrsp.py: interrupt, threads, selthread, hits, continue_async, sleep.
* [gdb] fix conn state to use same pipe (instead of a copy) (#4339)xbzk2026-09-021-0/+3
| | | | | | | | | | | | | | | | | - [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. ------------------- I was trying to use GDB stub to investigate MHR and it was not connecting. Error was suggesting it was not available for connection although i saw it booting on logs. Debugged and noticed signal_pipe_ was not the correct one, and followed the example of client_socket_. GDB stub is now working, on windows, at least. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4339 Reviewed-by: Lizzie and Samuel <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [video_core, hle] remove redundant parent references in system structs (#3908)lizzie2026-06-231-191/+179
| | | | | | | | | | 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>
* [hle] support passing arguments to homebrew applications (#4013)xbzk2026-06-151-3/+24
| | | | | | | | | | | | | | | | | | | Homebrew (.NRO) program args support Adds a 'program_args' setting and delivers it to NRO homebrews via libnx's homebrew ABI. NROs previously had no way to receive CLI flags (e.g. NZ:P's -noglsl). Setting: program_args, Category::System, startup-only. Surfaced in Qt + Android Debug sections. NRO loader: builds a 4-entry 'ConfigEntry' table + argv at the data segment tail; prepends 'homebrew ' so user args land at argv[1]; scans for 'svc #7' to use as LR. Drops the stale NSO-style argdata append. KProcess: stores loader-provided guest addresses; 'Run' switches to the homebrew entry (x0=config_ptr, x1=-1, lr=svc7) and patches the real MainThreadHandle into the ConfigEntry slot. Legacy NSO path unchanged. Tested on NZP — args reach 'argv' correctly. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4013 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [hle] Fixes for nxident, nxmp and nxplay, remove hbl.nsp workarounds (#3996)lizzie2026-06-121-3/+1
| | | | | | | | | | | | | | | adds `gpio` and `i2c` services implements `IApplicationFunctions::SetMediaPlaybackStateForApplicatio` stubs `IBtmSystemCore::GetDiscoveredAudioDevice` implements `nvhost_ctrl_gpu::PmuGetGpuLoad` IOCTL (0x20) implements `PSM::GetBatteryAgePercentage`, `PSM::GetBatteryVoltageState` and `PSM::GetBatteryChargeInfoFields` implements `ISystemSettingsServer::GetConsoleInformationUploadFlag`, `ISystemSettingsServer::SetConsoleInformationUploadFlag`, `ISystemSettingsServer::GetAutomaticApplicationDownloadFlag`, `ISystemSettingsServer::SetAutomaticApplicationDownloadFlag`, `&ISystemSettingsServer::GetUsb30EnableFlag`, `ISystemSettingsServer::SetUsb30EnableFlag` removes `hbl.nsp` specific workarounds Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3996 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
* [kernel, hle] Initial 22.0.0 kernel changes and cmd stubs (#3761)maufeat2026-05-051-0/+13
| | | | | | | | | | | | | - KProcess::Run() and CreateThread() SVC now write the current thread handle to TLS+0x110 - KPageTableBase::LockForMapDeviceAddressSpace now checks for a new KPageTableBase boolean, m_allowed_exec_device_mapping - Stub `am` + `acc` + `settings` cmd module that needs to work for qlaunch Thanks to: @alula and @yellows8 Source for changes: https://github.com/Atmosphere-NX/Atmosphere/pull/2744, https://switchbrew.org/, https://yls8.mtheall.com/ Co-authored-by: PavelBARABANOV <pavelbarabanov94@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3761 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [nce] add split patch mode to support modules bigger than 128MB (#3489)Maufeat2026-02-071-1/+10
| | | | | | | | | | nce patcher was extended to support modules larger than 128MB due to ARM64 branch limit. now added a pre-patch and (existing) post-patch module code. Allowwing MRS/MSR/SVC handler to remain within branch branch range Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3489 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
* [common, core] remove uneeded memory indirection overhead at startup (#3306)lizzie2026-01-161-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for core stuff: just remove unique ptrs that dont need any pointer stability at all (afterall its an allocation within an allocation so yeah) for fibers: Main reasoning behind this is because virtualBuffer<> is stupidly fucking expensive and it also clutters my fstat view ALSO mmap is a syscall, syscalls are bad for performance or whatever ALSO std::vector<> is better suited for handling this kind of "fixed size thing where its like big but not THAT big" (512 KiB isn't going to kill your memory usage for each fiber...) for core.cpp stuff - inlines stuff into std::optional<> as opposed to std::unique_ptr<> (because yknow, we are making the Impl from an unique_ptr, allocating within an allocation is unnecessary) - reorganizes the structures a bit so padding doesnt screw us up (it's not perfect but eh saves a measly 44 bytes) - removes unused/dead code - uses std::vector<> instead of std::deque<> no perf impact expected, maybe some initialisation boost but very minimal impact nonethless lto gets rid of most calls anyways - the heavy issue is with shared_ptr and the cache coherency from the atomics... but i clumped them together because well, they kinda do not suffer from cache coherency - hopefully not a mistake this balloons the size of Impl to about 1.67 MB - which is fine because we throw it in the stack anyways REST OF INTERFACES: most of them ballooned in size as well, but overhead is ok since its an allocation within an alloc, no stack is used (when it comes to storing these i mean) Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3306 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [core/loader] Implement a bit improper ASLR (#2945)lizzie2025-11-041-10/+6
| | | | | | | | | | | | | | A bit improper of an ASLR - it does something but something good? Who knows... All I know is that there is a non-uniform distrobution for rand() and that rng_seed is likely a better solution? I don't know Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2945 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [kernel] Implement code address offset for Skyline compatibility (#2858)JPikachu2025-10-311-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | - Add debug logging for 32-bit syscall argument tracking. - Add CodeStartOffset constant (0x500000) applied to only 32-bit code address space types in KProcess::LoadFromMetadata. - Replace CheckMemoryStateContiguous with two-stage CheckMemoryState in KPageTableBase::UnmapCodeMemory to discover and verify memory state more accurately. Based on similar fixes in Ryujinx (commit 5e9678c8fe) Fixes compatibility with: - Skyline 32-bit modding framework - CTGP-DX (Mario Kart 8 Deluxe mod) - Other homebrew using 32bit Skyline Co-authored-by: JPikachu <jpikachu.eden@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2858 Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: Lizzie <lizzie@eden-emu.dev> Co-authored-by: JPikachu <jpikachu@eden-emu.dev> Co-committed-by: JPikachu <jpikachu@eden-emu.dev>
* [core/hle/kernel] fix scoped JIT remnants (#2912)lizzie2025-10-311-6/+4
| | | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2912 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* Revert "[heap_tracker] Use ankerl map instead of rb tree (#249)" (#382)crueter2025-09-041-0/+4
| | | | | | | | | | | | This reverts commit c9a3baab5d5ba524778492027ef8961da947df2d. this commit caused issues in ender magnolia or something, need to make sure I didn't mess up the revert Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/382 Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@outlook.com>
* [heap_tracker] Use ankerl map instead of rb tree (#249)lizzie2025-08-271-4/+0
| | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/249 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* "Merge Tagged PR 13018"yuzubot2024-03-031-0/+1
|
* scope_exit: Make constexprFearlessTobi2024-02-191-5/+11
| | | | | Allows the use of the macro in constexpr-contexts. Also avoids some potential problems when nesting braces inside it.
* core: fix multiprocess with nceLiam2024-02-091-1/+6
|
* Core: Make sure GPU Dirty Managers ae shared by all processes.Fernando Sahmkow2024-01-181-10/+4
|
* Merge pull request #12677 from GPUCode/whyy-moddersliamwhite2024-01-151-2/+2
|\ | | | | core: Support multiple modules per patcher
| * core: Support multiple modules per patcherGPUCode2024-01-151-2/+2
| |
* | kernel: fix page leak on process terminationLiam2024-01-121-0/+6
|/
* core: track separate heap allocation for linuxLiam2023-12-251-2/+4
|
* kernel: restrict nce to applicationsLiam2023-12-221-2/+2
|
* general: properly support multiple memory instancesLiam2023-12-221-15/+21
|
* kernel: instantiate memory separately for each guest processLiam2023-12-221-6/+12
|
* core: refactor emulated cpu core activationLiam2023-12-041-4/+36
|
* general: fix mac compileLiam2023-11-261-1/+1
|
* arm: Implement native code execution backendLiam2023-11-251-0/+11
|
* kernel: Manually specify aslr region startLiam2023-11-251-6/+6
|
* kernel: add KPageTableBaseLiam2023-11-101-9/+9
| | | | Co-authored-by: Kelebek1 <eeeedddccc@hotmail.co.uk>
* kernel: update KProcessLiam2023-10-211-451/+991
|
* kernel: fix incorrect calculation of used non system memory valueLiam2023-10-201-1/+1
|
* core: improve debug workflowLiam2023-09-141-1/+4
|
* kernel: offset code entry point for 39-bit address space type (#11326)liamwhite2023-08-251-5/+20
|
* Merge pull request #10839 from lat9nq/pgc-plusliamwhite2023-08-021-1/+2
|\ | | | | general: Reimplement per-game configurations
| * settings,core,config_sys: Remove optional type from custom_rtc, rng_seedlat9nq2023-07-211-1/+2
| | | | | | | | core: Fix MSVC errors
* | k_process: PageTable -> GetPageTableLiam2023-07-141-1/+1
|/
* memory: rename global memory references to application memoryLiam2023-03-231-10/+12
|
* kernel: use KTypedAddress for addressesLiam2023-03-221-16/+19
|
* kernel: additional style fixes to KThread, KProcessLiam2023-03-121-10/+10
|
* kernel: convert KProcess to new styleLiam2023-03-121-132/+136
|
* kernel: convert KThread to new styleLiam2023-03-121-1/+0
|
* kernel: prefer std::addressofLiam2023-03-121-3/+4
|
* kernel: remove kernel_Liam2023-03-121-34/+34
|
* general: fix spelling mistakesLiam2023-03-121-1/+1
|
* kernel: be more careful about kernel address keysLiam2023-03-011-1/+1
|
* kernel: refactor priority inheritance to represent locks as C++ objectsLiam2023-03-011-2/+2
|
* service: refactor server architectureLiam2023-02-211-4/+0
| | | | Converts services to have their own processes
* core: kernel: k_process: Use application system resource.bunnei2023-02-101-1/+1
|
* kernel: KPageTable: updateLiam2023-01-221-15/+25
|