summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2018-10-06Merge pull request #1332 from FearlessTobi/port-web-backendbunnei
Port web_service from Citra
2018-10-06kernel/mutex: Amend behavior of TransferMutexOwnership()Lioncash
This was the result of a typo accidentally introduced in e51d715700a35a8f14e5b804b6f7553c9a40888b. This restores the previous correct behavior. The behavior with the reference was incorrect and would cause some games to fail to boot.
2018-10-05thread: Make the scheduler pointer a regular pointerbalika011
Conceptually, it doesn't make sense for a thread to be able to persist the lifetime of a scheduler. A scheduler should be taking care of the threads; the threads should not be taking care of the scheduler. If the threads outlive the scheduler (or we simply don't actually terminate/shutdown the threads), then it should be considered a bug that we need to fix. Attributing this to balika011, as they opened #1317 to attempt to fix this in a similar way, but my refactoring of the kernel code caused quite a few conflicts.
2018-10-05Merge pull request #1439 from lioncash/threadbunnei
kernel/thread: Make all instance variables private
2018-10-04Merge pull request #1415 from DarkLordZach/ipsbunnei
file_sys: Add support for loading IPS patches
2018-10-04kernel/thread: Make all instance variables privateLioncash
Many of the member variables of the thread class aren't even used outside of the class itself, so there's no need to make those variables public. This change follows in the steps of the previous changes that made other kernel types' members private. The main motivation behind this is that the Thread class will likely change in the future as emulation becomes more accurate, and letting random bits of the emulator access data members of the Thread class directly makes it a pain to shuffle around and/or modify internals. Having all data members public like this also makes it difficult to reason about certain bits of behavior without first verifying what parts of the core actually use them. Everything being public also generally follows the tendency for changes to be introduced in completely different translation units that would otherwise be better introduced as an addition to the Thread class' public interface.
2018-10-03Merge pull request #1434 from DarkLordZach/dlc-edge-casebunnei
aoc_u: Fix edge case with DLC that causes breaks
2018-10-03Merge pull request #1433 from lioncash/fsbunnei
services/fsp_srv: Amend service function table
2018-10-03Merge pull request #1436 from lioncash/viewbunnei
submission_package: Cleanup and bug fixes
2018-10-03Merge pull request #1432 from lioncash/lblbunnei
service/lbl: Update service function table
2018-10-03Merge pull request #1435 from lioncash/xcibunnei
card_image: Ensure program_nca_status is always initialized
2018-10-03submission_package: Avoid dangling std::string_view within SetTicketKeys()Lioncash
GetName() returns a std::string by value, not by reference, so after the std::string_view is constructed, it's not well defined to actually execute any member functions of std::string_view that attempt to access the data, as the std::string has already been destroyed. Instead, we can just use a std::string and erase the last four characters.
2018-10-03submission_package: Correct location of null check within SetTicketKeys()Lioncash
If a ticket file was ever a null pointer, we'd cause a null pointer dereference, as we were calling GetExtension() on the pointer instance.
2018-10-03submission_package: Use std::string's rfind() when looking for the extension ↵Lioncash
in InitializeExeFSAndRomFS() When searching for a file extension, it's generally preferable to begin the search at the end of the string rather than the beginning, as the whole string isn't going to be walked just to check for something at the end of it.
2018-10-03submission_package: Ensure the 'extracted' member variable is always initializedLioncash
If an error occurs when constructing the PartitionFilesystem instance, the constructor would be exited early, which wouldn't initialize the extracted data member, making it possible for other code to perform an uninitialized read by calling the public IsExtractedType() member function. This prevents that.
2018-10-03submission_package: Move ExeFS and RomFS initialization to its own functionLioncash
Like the other two bits of factored out code, this can also be put within its own function. We can also modify the code so that it accepts a const reference to a std::vector of files, this way, we can deduplicate the file retrieval. Now the constructor for NSP isn't a combination of multiple behaviors in one spot. It's nice and separate.
2018-10-03submission_package: Move NCA reading code to its own functionLioncash
This too, is completely separate behavior from what is in the constructor, so we can move this to its own isolated function to keep everything self-contained.
2018-10-03submission_package: Move ticket key setting to its own functionLioncash
This behavior is entirely independent of the surrounding code, so it can be put in its own function to keep the behavior separate.
2018-10-03submission_package: Invert conditionals within NSP's constructor to reduce ↵Lioncash
nesting We can use early continues here to reduce the amount of nesting.
2018-10-02card_image: Ensure program_nca_status is always initializedLioncash
If any of the error paths before the NCA retrieval are taken, it'll result in program_nca_status being left in an inconsistent state. So we initialize it by default with a value indicating an error.
2018-10-02aoc_u: Fix edge case with DLC that causes breaksZach Hilman
In some games (Splatoon 2 and Splatoon 2 Splatfest World Premiere, notably), pass offset=0 and count=2047 into the ListAddOnContent method which should return all DLCs for the current title. The (presumably) intended behavior is to successfully return a empty array but because of a < v. <= in an if statement, a failure error code was returned causing these games to svcBreak. This fixes that if statement.
2018-10-02services/fsp_srv: Amend service function tableLioncash
Adds new functions that have been given names to the table. Information is based off what is provided on Switchbrew.
2018-10-02service/lbl: Update service function tableLioncash
Amends the lbl service table to include new names of functions that were added to Switchbrew.
2018-10-02nso: Optimize loading of IPS patchesZach Hilman
Avoid resource-heavy classes and remove quasi-duplicated code.
2018-10-02Review comments -part 4fearlessTobi
2018-10-02Address more review commentsfearlessTobi
2018-10-02Address a bunch of review commentsfearlessTobi
2018-10-02Port web_service from CitrafearlessTobi
2018-10-01deconstructed_rom_directory: Force NSO loader to patch NSOsZach Hilman
2018-10-01nso: Add framework to support patching of uncompressed NSOsZach Hilman
2018-10-01patch_manager: Add PatchNSO functionZach Hilman
While PatchExeFS operated on the entire directory, this function operates on the uncompressed NSO. Avoids copying decompression code to PatchManager.
2018-10-01patch_manager: Use strings for patch type instead of enumZach Hilman
2018-10-01file_sys: Implement function to apply IPS patchesZach Hilman
2018-10-01nso: Replace NSOHeader padding bytes with build IDZach Hilman
2018-09-30aoc_u: Extract AccumulateAOCTitleIDs to separate functionZach Hilman
2018-09-30aoc_u: Implement GetAddOnContentBaseIdZach Hilman
Command #5
2018-09-30aoc_u: Implement Count, List and Prepare AddOnContentZach Hilman
Commands #2, #3, and #7
2018-09-30romfs_factory: Read from all locations with StorageId NoneZach Hilman
Previous behavior was to assert. Seems to mirror expected game behavior.
2018-09-30patch_manager: Add DLC recognition to PatchManagerZach Hilman
2018-09-30Merge pull request #1338 from raven02/service_vibunnei
Implement ISystemDisplayService::GetDisplayMode
2018-09-30kernel/svc: Implement svcGetThreadContext()Lioncash
Now that we have all of the rearranging and proper structure sizes in place, it's fairly trivial to implement svcGetThreadContext(). In the 64-bit case we can more or less just write out the context as is, minus some minor value sanitizing. In the 32-bit case we'll need to clear out the registers that wouldn't normally be accessible from a 32-bit AArch32 exectuable (or process).
2018-09-30kernel/process: Add a data member to determine if a process is 64-bit or not.Lioncash
This will be necessary for the implementation of svcGetThreadContext(), as the kernel checks whether or not the process that owns the thread that has it context being retrieved is a 64-bit or 32-bit process. If the process is 32-bit, then the upper 15 general-purpose registers and upper 16 vector registers are cleared to zero (as AArch32 only has 15 GPRs and 16 128-bit vector registers. not 31 general-purpose registers and 32 128-bit vector registers like AArch64).
2018-09-30kernel/process: Make data member variables privateLioncash
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.
2018-09-30arm_interface: Add missing fpsr/tpidr members to the ThreadContext structLioncash
Internally within the kernel, it also includes a member variable for the floating-point status register, and TPIDR, so we should do the same here to match it. While we're at it, also fix up the size of the struct and add a static assertion to ensure it always stays the correct size.
2018-09-30Implement ISystemDisplayService::GetDisplayModeraven02
2018-09-29loader: Make the Load() function take a process as a regular reference, not ↵Lioncash
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.
2018-09-29Merge pull request #1412 from lioncash/movebunnei
kernel/object: Remove unnecessary std::move from DynamicObjectCast()
2018-09-29Merge pull request #1395 from lioncash/vmbunnei
process/vm_manager: Initial modifications to load NPDM metadata
2018-09-28kernel/object: Remove unnecessary std::move from DynamicObjectCast()Lioncash
boost::static_pointer_cast for boost::intrusive_ptr (what SharedPtr is), takes its parameter by const reference. Given that, it means that this std::move doesn't actually do anything other than obscure what the function's actual behavior is, so we can remove this. To clarify, this would only do something if the parameter was either taking its argument by value, by non-const ref, or by rvalue-reference.
2018-09-27Merge pull request #1394 from lioncash/streambunnei
stream: Preserve enum class type in GetState()