aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/program_metadata.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Switch 2: window image sizes, queue semaphores, built-in fonts, memory budgetTakoroka7 days1-0/+1
| | | | | | | | | | | | - 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.
* npdm: parse the Switch 2 ACID layoutTakoroka8 days1-2/+19
| | | | | | | | Switch 2 ACID blocks have a 0x300-byte signature/key area (Switch 1: 0x200), so the ACID header starts 0x100 bytes later. Without this the FAC offset was garbage and loading failed with ErrorBadFileAccessControl. Also read FAC/FAH relative to their ACID/ACI block, as the format (and the existing KAC read) does.
* [fmt] use {#:x} instead of 0x{:#x} (#4170)lizzie2026-07-251-9/+9
| | | | | | | | | | continuation of #309 but applying to even more files than before :) also makes them lowercase because `0xfafafa` is better as `0XFAFAFA` Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4170 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com>
* [msvc] fix error with new <T>bitfields (#4196)lizzie2026-07-131-1/+1
| | | | | | | | | fixes MSVC build errors Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4196 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [common] rework BitField and BitUtil, use concepts whenever possible (#4076)lizzie2026-07-091-1/+1
| | | | | | | | | | test no regressions especially on Liiinux Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4076 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@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>
* [fmt] use {:#X} for format instead of 0x{:X} (#309)lizzie2025-08-271-1/+4
| | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/309 Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* scope_exit: Make constexprFearlessTobi2024-02-191-1/+3
| | | | | Allows the use of the macro in constexpr-contexts. Also avoids some potential problems when nesting braces inside it.
* vfs: Move vfs files to their own directoryFearlessTobi2024-01-251-1/+1
|
* general: properly support multiple memory instancesLiam2023-12-221-1/+5
|
* kernel: update KProcessLiam2023-10-211-5/+5
|
* loader: don't reassign program ID on npdm reparseLiam2023-09-301-0/+8
|
* general: Enforce C4800 everywhere except in video_coreMorph2022-10-221-1/+1
|
* Merge pull request #6142 from lat9nq/prog_meta_ref_bind_addressbunnei2022-10-061-5/+47
|\ | | | | program_metadata: Avoid reference binding to misaligned address
| * program_metadata: Unpack FileAccessHeader and FileAccessControllat9nq2022-02-131-5/+47
| | | | | | | | | | | | Avoids a reference binding to a misaligned addresses. Unpacking one requires unpacking the other, otherwise there'll be a misaligned address on the leftover one.
* | 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.
* program_metadata: Add default ThreadInfo kernel capabilityOatmealDome2021-11-101-1/+4
|
* style: Remove extra space preceding the :: operatorMorph2021-09-291-1/+1
|
* Fix GCC undefined behavior sanitizer.Markus Wick2021-06-101-1/+3
| | | | | | | | | * Wrong alignment in u64 LOG_DEBUG -> memcpy. * Huge shift exponent in stride calculation for linear buffer, unused result -> skipped. * Large shift in buffer cache if word = 0, skip checking for set bits. Non of those were critical, so this should not change any behavior. At least with the assumption, that the last one used masking behavior, which always yield continuous_bits = 0.
* program_metadata: Set a default resource size when a NPDM is not presentMorph2021-04-231-2/+4
| | | | Sets a default size of 0x1FE00000 bytes (510 MiB) for the system_resource_size when a NPDM is not present.
* file_sys: Replace inclusions with forward declarations where applicableLioncash2020-08-231-0/+1
| | | | Same behavior, minus unnecessary inclusions where not necessary.
* file_sys: program_metadata: Add a helper function for generating reasonable ↵bunnei2020-04-201-0/+11
| | | | | | default metadata. - We need this for homebrew process initialization.
* loader; Resolve sign conversion/truncation errorsLioncash2019-11-121-3/+3
|
* Implement MapPhysicalMemory/UnmapPhysicalMemoryMichael Scire2019-07-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This implements svcMapPhysicalMemory/svcUnmapPhysicalMemory for Yuzu, which can be used to map memory at a desired address by games since 3.0.0. It also properly parses SystemResourceSize from NPDM, and makes information available via svcGetInfo. This is needed for games like Super Smash Bros. and Diablo 3 -- this PR's implementation does not run into the "ASCII reads" issue mentioned in the comments of #2626, which was caused by the following bugs in Yuzu's memory management that this PR also addresses: * Yuzu's memory coalescing does not properly merge blocks. This results in a polluted address space/svcQueryMemory results that would be impossible to replicate on hardware, which can lead to game code making the wrong assumptions about memory layout. * This implements better merging for AllocatedMemoryBlocks. * Yuzu's implementation of svcMirrorMemory unprotected the entire virtual memory range containing the range being mirrored. This could lead to games attempting to map data at that unprotected range/attempting to access that range after yuzu improperly unmapped it. * This PR fixes it by simply calling ReprotectRange instead of Reprotect.
* program_metadata: Add function to load meta from raw parametersZach Hilman2019-06-051-0/+15
| | | | Needed for KIP loading as KIPs do not have an NPDM but do have the essential parts of the data within.
* file_sys/program_metadata: Remove obsolete TODOsLioncash2019-04-051-13/+14
| | | | | | | BitField has been trivially copyable since b20657a36f909e2bb7e2b8e171c6718d5a3149d6, so we can eliminate these TODO comments and use ReadObject() directly instead of memcpying the data.
* file_sys/program_metadata: Print out more descriptive address space descriptionsLioncash2018-12-271-3/+7
| | | | | | | Provides extra information that makes it easier to tell if an executable being run is using a 36-bit address space or a 39-bit address space. While we don't support AArch32 executables yet, this also puts in distinguishing information for the 32-bit address space types as well.
* kernel/process: Hook up the process capability parser to the process itselfLioncash2018-12-211-0/+11
| | | | | While we're at it, we can also toss out the leftover capability parsing from Citra.
* process/vm_manager: Amend API to allow reading parameters from NPDM metadataLioncash2018-09-241-1/+3
| | | | | | | | | Rather than hard-code the address range to be 36-bit, we can derive the parameters from supplied NPDM metadata if the supplied exectuable supports it. This is the bare minimum necessary for this to be possible. The following commits will rework the memory code further to adjust to this.
* file-sys: Default heavy-weight class destructors in the cpp fileLioncash2018-09-191-0/+4
| | | | | | | | | | Several classes have a lot of non-trivial members within them, or don't but likely should have the destructor defaulted in the cpp file for future-proofing/being more friendly to forward declarations. Leaving the destructor unspecified allows the compiler to inline the destruction code all over the place, which is generally undesirable from a code bloat perspective.
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-1/+1
|
* file_sys: Replace includes with forward declarations where applicableLioncash2018-09-031-1/+4
| | | | | Cuts down on include dependencies, resulting in less files that need to be rebuilt when certain things are changed.
* loader: Add more descriptive errorsZach Hilman2018-08-091-6/+6
| | | Full list of new errors and descriptions in core/loader/loader.h
* Virtual Filesystem 2: Electric Boogaloo (#676)Zach Hilman2018-07-181-27/+16
| | | | | | | | | | * Virtual Filesystem * Fix delete bug and documentate * Review fixes + other stuff * Fix puyo regression
* Revert "Virtual Filesystem (#597)"bunnei2018-07-071-16/+27
| | | | This reverts commit 12e9522b32d972a8e9b327c7ee7c14040a61ffdd.
* Virtual Filesystem (#597)Zach Hilman2018-07-061-27/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add VfsFile and VfsDirectory classes * Finish abstract Vfs classes * Implement RealVfsFile (computer fs backend) * Finish RealVfsFile and RealVfsDirectory * Finished OffsetVfsFile * More changes * Fix import paths * Major refactor * Remove double const * Use experimental/filesystem or filesystem depending on compiler * Port partition_filesystem * More changes * More Overhaul * FSP_SRV fixes * Fixes and testing * Try to get filesystem to compile * Filesystem on linux * Remove std::filesystem and document/test * Compile fixes * Missing include * Bug fixes * Fixes * Rename v_file and v_dir * clang-format fix * Rename NGLOG_* to LOG_* * Most review changes * Fix TODO * Guess 'main' to be Directory by filename
* Update clang formatJames Rowe2018-07-021-1/+1
|
* Rename logging macro back to LOG_*James Rowe2018-07-021-18/+18
|
* general: Make formatting of logged hex values more straightforwardLioncash2018-05-021-9/+9
| | | | | | This makes the formatting expectations more obvious (e.g. any zero padding specified is padding that's entirely dedicated to the value being printed, not any pretty-printing that also gets tacked on).
* file-sys: Move logging macros over to the new fmt-capable onesLioncash2018-04-251-20/+19
|
* file_sys: Style tweaksshinyquagsire232018-02-251-3/+0
| | | | Asdf
* file_sys: Add support for parsing NPDM filesshinyquagsire232018-02-251-0/+117