summaryrefslogtreecommitdiff
path: root/src/core/loader (follow)
Commit message (Collapse)AuthorAgeFilesLines
* XCI: Add function for checking the existence of the program NCAGravatar Lioncash2018-10-161-2/+1
| | | | | | The only reason the getter existed was to check whether or not the program NCA was null. Instead, we can just provide a function to query for the existence of it, instead of exposing it entirely.
* nso: Return an optional address from LoadModuleGravatar Lioncash2018-10-155-16/+29
| | | | | If a malformed NSO is attempted to be loaded, we shouldn't continue onwards. We should be reporting an error and bailing out.
* nso: Make LoadModule take a VfsFile by const referenceGravatar Lioncash2018-10-143-11/+9
|
* nro: Make LoadNro take a VfsFile by const referenceGravatar Lioncash2018-10-142-6/+6
| | | | | | This function doesn't need to care about ownership semantics, so we can just pass it a reference to the file itself, rather than a std::shared_ptr alias.
* kernel/process: Make CodeSet a regular non-inherited objectGravatar Lioncash2018-10-123-43/+31
| | | | | | | | These only exist to ferry data into a Process instance and end up going out of scope quite early. Because of this, we can just make it a plain struct for holding things and just std::move it into the relevant function. There's no need to make this inherit from the kernel's Object type.
* patch_manager: Return a std::unique_ptr from ParseControlNCA() and ↵Gravatar Lioncash2018-10-094-4/+4
| | | | | | | | | | | | | | | | GetControlMetadata() instead of a std::shared_ptr Neither of these functions require the use of shared ownership of the returned pointer. This makes it more difficult to create reference cycles with, and makes the interface more generic, as std::shared_ptr instances can be created from a std::unique_ptr, but the vice-versa isn't possible. This also alters relevant functions to take NCA arguments by const reference rather than a const reference to a std::shared_ptr. These functions don't alter the ownership of the memory used by the NCA instance, so we can make the interface more generic by not assuming anything about the type of smart pointer the NCA is contained within and make it the caller's responsibility to ensure the supplied NCA is valid.
* nso/nro: Use default allocation size for arg_dataGravatar Zach Hilman2018-10-074-14/+20
|
* cmd: Support passing game arguments from command lineGravatar Zach Hilman2018-10-072-2/+2
| | | | Uses -p (--program) and following string as args.
* nso/nro: Add NSO arguments structure to data sectionGravatar Zach Hilman2018-10-074-3/+38
| | | | Only added if arguments string is non-empty and a pass is requested by loader.
* romfs_factory: Extract packed update setter to new functionGravatar Zach Hilman2018-10-052-0/+11
|
* loader: Add getter for packed updateGravatar Zach Hilman2018-10-056-3/+58
| | | | Reads the update included with the game if it has one and adds the new ErrorNoPackedUpdate status.
* loader: Add ReadRomFSIVFCOffset to NSP, XCI, and NAX loadersGravatar Zach Hilman2018-10-056-6/+20
| | | | Fixes errors with certain updates
* nso: Optimize loading of IPS patchesGravatar Zach Hilman2018-10-023-6/+5
| | | | Avoid resource-heavy classes and remove quasi-duplicated code.
* deconstructed_rom_directory: Force NSO loader to patch NSOsGravatar Zach Hilman2018-10-011-1/+3
|
* nso: Add framework to support patching of uncompressed NSOsGravatar Zach Hilman2018-10-012-2/+17
|
* nso: Replace NSOHeader padding bytes with build IDGravatar Zach Hilman2018-10-011-2/+1
|
* kernel/process: Make data member variables privateGravatar Lioncash2018-09-304-4/+4
| | | | | | | Makes the public interface consistent in terms of how accesses are done on a process object. It also makes it slightly nicer to reason about the logic of the process class, as we don't want to expose everything to external code.
* loader: Make the Load() function take a process as a regular reference, not ↵Gravatar Lioncash2018-09-2917-41/+27
| | | | | | | | | | a SharedPtr A process should never require being reference counted in this situation. If the handle to a process is freed before this function is called, it's definitely a bug with our lifetime management, so we can put the requirement in place for the API that the process must be a valid instance.
* memory: Dehardcode the use of fixed memory range constantsGravatar Lioncash2018-09-244-22/+25
| | | | | | | | The locations of these can actually vary depending on the address space layout, so we shouldn't be using these when determining where to map memory or be using them as offsets for calculations. This keeps all the memory ranges flexible and malleable based off of the virtual memory manager instance state.
* process/vm_manager: Amend API to allow reading parameters from NPDM metadataGravatar Lioncash2018-09-244-25/+4
| | | | | | | | | 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.
* Added support for uncompressed NSOs (#1374)Gravatar David2018-09-211-3/+12
| | | | | | * Added support for uncompressed NSOs * Moved compressed section check to NsoHeader
* nax: Avoid re-parsing NAX data with GetFileType()Gravatar Lioncash2018-09-192-13/+19
| | | | | | | | | An instance of the NAX apploader already has an existing NAX instance in memory. Calling directly into IdentifyType() directly would re-parse the whole file again into yet another NAX instance, only to toss it away again. This gets rid of unnecessary/redundant file parsing and allocations.
* nax: Avoid unnecessary calls to AsNCA() in IdentifyType()Gravatar Lioncash2018-09-191-4/+8
| | | | | | | | | AsNCA() allocates an NCA instance every time it's called. In the current manner it's used, it's quite inefficient as it's making a redundant allocation. We can just amend the order of the conditionals to make it easier to just call it once.
* Port #4182 from Citra: "Prefix all size_t with std::"Gravatar fearlessTobi2018-09-152-2/+2
|
* kernel/thread: Include thread-related enums within the kernel namespaceGravatar Lioncash2018-09-132-2/+3
| | | | | | Previously, these were sitting outside of the Kernel namespace, which doesn't really make sense, given they're related to the Thread class which is within the Kernel namespace.
* bktr: Fix bucket overlap errorGravatar Zach Hilman2018-09-041-2/+2
|
* drd: Parse title ID from program metadataGravatar Zach Hilman2018-09-041-1/+8
|
* patch_manager: Centralize Control-type NCA parsingGravatar Zach Hilman2018-09-042-33/+8
|
* game_list: Fix version display on non-NAND titlesGravatar Zach Hilman2018-09-041-1/+10
|
* bktr: Implement IVFC offset shiftingGravatar Zach Hilman2018-09-043-0/+16
| | | | Fixes base game read errors
* bktr: Fix missing includes and optimize styleGravatar Zach Hilman2018-09-045-5/+5
|
* loader: Add BKTR-specific error messages and codesGravatar Zach Hilman2018-09-042-7/+24
|
* loader: Ignore patches on NRO and DRDGravatar Zach Hilman2018-09-044-0/+11
|
* patch_manager: Add usages of patches to ExeFSGravatar Zach Hilman2018-09-043-8/+30
|
* main: Only show DRD deprecation warning onceGravatar Zach Hilman2018-09-041-1/+1
|
* nsp: Comply with style and performance guidelinesGravatar Zach Hilman2018-09-042-3/+10
|
* loader: Add AppLoader for NSP filesGravatar Zach Hilman2018-09-042-0/+182
|
* card_image: Parse XCI secure partition with NSPGravatar Zach Hilman2018-09-041-4/+3
| | | | Eliminated duplicate code and adds support for Rev1+ carts
* drd: Load title ID from program metadataGravatar Zach Hilman2018-09-041-3/+1
| | | | Previously only loaded from control metadata
* loader: Add NSP file type and NSP-specific errorsGravatar Zach Hilman2018-09-042-2/+14
|
* vfs_real: Forward declare IOFileGravatar Lioncash2018-09-022-5/+6
| | | | | | Eliminates the need to rebuild some source files if the file_util header ever changes. This also uncovered some indirect inclusions, which have also been fixed.
* core/core: Replace includes with forward declarations where applicableGravatar Lioncash2018-08-314-0/+4
| | | | | | | | | | | The follow-up to e2457418dae19b889b2ad85255bb95d4cd0e4bff, which replaces most of the includes in the core header with forward declarations. This makes it so that if any of the headers the core header was previously including change, then no one will need to rebuild the bulk of the core, due to core.h being quite a prevalent inclusion. This should make turnaround for changes much faster for developers.
* kernel: Eliminate kernel global stateGravatar Lioncash2018-08-284-7/+16
| | | | | | | | | | | | | | | | | | | | | | As means to pave the way for getting rid of global state within core, This eliminates kernel global state by removing all globals. Instead this introduces a KernelCore class which acts as a kernel instance. This instance lives in the System class, which keeps its lifetime contained to the lifetime of the System class. This also forces the kernel types to actually interact with the main kernel instance itself instead of having transient kernel state placed all over several translation units, keeping everything together. It also has a nice consequence of making dependencies much more explicit. This also makes our initialization a tad bit more correct. Previously we were creating a kernel process before the actual kernel was initialized, which doesn't really make much sense. The KernelCore class itself follows the PImpl idiom, which allows keeping all the implementation details sealed away from everything else, which forces the use of the exposed API and allows us to avoid any unnecessary inclusions within the main kernel header.
* file_sys/crypto: Fix missing/unnecessary includesGravatar Zach Hilman2018-08-241-1/+0
|
* file_sys: Cut down on includes and copiesGravatar Zach Hilman2018-08-232-4/+11
|
* loader: Add new NAX-specific errors and messagesGravatar Zach Hilman2018-08-232-1/+27
|
* nax: Add AppLoader_NAX and update loader to support itGravatar Zach Hilman2018-08-234-2/+121
|
* xci: Fix error masking issueGravatar Zach Hilman2018-08-231-5/+6
| | | | Prevents NCA-related errors from being masked into MissingProgramNCA or MissingKeyFile
* service/filesystem: Use forward declarations where applicableGravatar Lioncash2018-08-202-0/+2
| | | | | | | | Avoids the need to rebuild multiple source files if the filesystem code headers change. This also gets rid of a few instances of indirect inclusions being relied upon
* Merge pull request #1075 from lioncash/includeGravatar bunnei2018-08-164-35/+22
|\ | | | | loader/{nca, xci}: Remove unnecessary includes and unused member variables