summaryrefslogtreecommitdiff
path: root/src/core (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | scheduler: Only work steal higher priority threads from other coresGravatar Zach Hilman2018-12-033-35/+24
| | | | | | |
| * | | | | | svc: Avoid performance-degrading unnecessary rescheduleGravatar Zach Hilman2018-12-022-8/+6
| | | | | | |
| * | | | | | scheduler: Add explanations for YieldWith and WithoutLoadBalancingGravatar Zach Hilman2018-11-225-77/+139
| | | | | | |
| * | | | | | svc: Implement yield types 0 and -1Gravatar Zach Hilman2018-11-185-2/+114
| | | | | | |
* | | | | | | Merge pull request #1899 from lioncash/stateGravatar bunnei2018-12-147-84/+188
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | vm_manager/svc: Modify MemoryState enum, and correct error handling for svcQueryMemory
| * | | | | | | svc: Enable svcQueryProcessMemoryGravatar Lioncash2018-12-122-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svcQueryProcessMemory is trivial to implement, given all the behavior necessary for it is present, it just needs a handler for it.
| * | | | | | | svc: Write out the complete MemoryInfo structure in QueryProcessMemoryGravatar Lioncash2018-12-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the previous change, the memory writing was moved into the service function itself, however it still had a problem, in that the entire MemoryInfo structure wasn't being written out, only the first 32 bytes of it were being written out. We still need to write out the trailing two reference count members and zero out the padding bits. Not doing this can result in wrong behavior in userland code in the following scenario: MemoryInfo info; // Put on the stack, not quaranteed to be zeroed out. svcQueryMemory(&info, ...); if (info.device_refcount == ...) // Whoops, uninitialized read. This can also cause the wrong thing to happen if the user code uses std::memcmp to compare the struct, with another one (questionable, but allowed), as the padding bits are not guaranteed to be a deterministic value. Note that the kernel itself also fully zeroes out the structure before writing it out including the padding bits.
| * | | | | | | svc: Handle memory writing explicitly within QueryProcessMemoryGravatar Lioncash2018-12-122-26/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moves the memory writes directly into QueryProcessMemory instead of letting the wrapper function do it. It would be inaccurate to allow the handler to do it because there's cases where memory shouldn't even be written to. For example, if the given process handle is invalid. HOWEVER, if the memory writing is within the wrapper, then we have no control over if these memory writes occur, meaning in an error case, 68 bytes of memory randomly get trashed with zeroes, 64 of those being written to wherever the memory info address points to, and the remaining 4 being written wherever the page info address points to. One solution in this case would be to just conditionally check within the handler itself, but this is kind of smelly, given the handler shouldn't be performing conditional behavior itself, it's a behavior of the managed function. In other words, if you remove the handler from the equation entirely, does the function still retain its proper behavior? In this case, no. Now, we don't potentially trash memory from this function if an invalid query is performed.
| * | | | | | | vm_manager: Correct ordering of last two struct members of MemoryInfoGravatar Lioncash2018-12-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These should be swapped.
| * | | | | | | vm_manager: Amend the returned values for invalid memory queries in ↵Gravatar Lioncash2018-12-122-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QueryMemory() The kernel returns a memory info instance with the base address set to the end of the address space, and the size of said block as 0 - address_space_end, it doesn't set both of said members to zero.
| * | | | | | | vm_manager: Migrate memory querying to the VMManager interfaceGravatar Lioncash2018-12-124-18/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gets rid of the need to directly access the managed VMAs outside of the memory manager itself just for querying memory.
| * | | | | | | vm_manager: Migrate MemoryInfo and PageInfo to vm_manager.hGravatar Lioncash2018-12-123-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gets the two structures out of an unrelated header and places them with the rest of the memory management code. This also corrects the structures. PageInfo appears to only contain a 32-bit flags member, and the extra padding word in MemoryInfo isn't necessary.
| * | | | | | | vm_manager: Amend MemoryState enum membersGravatar Lioncash2018-12-125-28/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends the MemoryState enum to use the same values like the actual kernel does. Also provides the necessary operators to operate on them. This will be necessary in the future for implementing svcSetMemoryAttribute, as memory block state is checked before applying the attribute.
* | | | | | | | Merge pull request #1900 from lioncash/wrapperGravatar bunnei2018-12-141-1/+1
|\ \ \ \ \ \ \ \ | |_|_|/ / / / / |/| | | | | | | svc_wrap: Correct register index for a wrapper specialization
| * | | | | | | svc_wrap: Correct register index for a wrapper specializationGravatar Lioncash2018-12-121-1/+1
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This would result in svcSetMemoryAttribute getting the wrong value for its third parameter. This is currently fine, given the service function is stubbed, however this will be unstubbed in a future change, so this needs to change.
* | | | | | | Fix Process object leak on emulation stopGravatar Jens Schmer2018-12-123-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Process object kept itself alive indefinitely because its handle_table contains a SharedMemory object which owns a reference to the same Process object, creating a circular ownership scenario. Break that up by storing only a non-owning pointer in the SharedMemory object.
* | | | | | | Merge pull request #1891 from DarkLordZach/istorage-getsizeGravatar Mat M2018-12-121-2/+15
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | fsp_srv: Implement IStorage::GetSize
| * | | | | | | fsp_srv: Implement IStorage::GetSizeGravatar Zach Hilman2018-12-101-2/+15
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | Takes no input and returns the size as a u64. Needed by Katamari Damacy Reroll to boot.
* | | | | | | patch_manager: Prevent use of a dangling pointer within PatchRomFSGravatar Lioncash2018-12-111-4/+3
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fmt::format() returns a std::string instance by value, so calling .c_str() on it here is equivalent to doing: auto* ptr = std::string{}.c_str(); The data being pointed to isn't guaranteed to actually be valid anymore after that expression ends. Instead, we can just take the string as is, and provide the necessary formatting parameters.
* | | | | | Merge pull request #1846 from lioncash/dirGravatar bunnei2018-12-101-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | file_sys/directory: Amend path buffer size for directory entries
| * | | | | | file_sys/directory: Amend path buffer size for directory entriesGravatar Lioncash2018-12-021-2/+2
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | The path buffer is actually 0x301 (769) characters in length, with the extra character being intended for the null-terminator.
* | | | | | Merge pull request #1819 from DarkLordZach/disable-addonsGravatar bunnei2018-12-1011-14/+102
|\ \ \ \ \ \ | | | | | | | | | | | | | | patch_manager: Add support for disabling patches
| * | | | | | loader: Add support for reading the name of game's developerGravatar Zach Hilman2018-12-035-0/+26
| | | | | | |
| * | | | | | aoc_u: Obey disabled add-ons list when listing DLCGravatar Zach Hilman2018-12-031-0/+12
| | | | | | |
| * | | | | | patch_manager: Obey disabled add-ons list when patching gameGravatar Zach Hilman2018-12-032-11/+50
| | | | | | |
| * | | | | | core: Make GetGameFileFromPath function externally accessibleGravatar Zach Hilman2018-12-032-3/+9
| | | | | | |
| * | | | | | settings: Store list of disabled add-ons per title IDGravatar Zach Hilman2018-12-031-0/+5
| | |_|_|/ / | |/| | | |
* | | | | | Merge pull request #1887 from FearlessTobi/port-4476Gravatar bunnei2018-12-101-8/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | Port citra-emu/citra#4476: "web_service: move telemetry condition from TelemetrySession constructor to destructor"
| * | | | | | web_service: move telemetry condition from TelemetrySession constructor to ↵Gravatar fearlessTobi2018-12-081-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | destructor Fixes an issue where Testcases couldn't be sent when Telemetry was disabled, because both things are tied closely together in the backend.
* | | | | | | Merge pull request #1883 from lioncash/log-fspGravatar bunnei2018-12-101-1/+10
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | service/fsp_srv: Correct returned value in GetGlobalAccessLogMode()
| * | | | | | | service/fsp_srv: Correct returned value in GetGlobalAccessLogMode()Gravatar Lioncash2018-12-091-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based off RE, the backing code only ever seems to use 0-2 as the range of values 1 being a generic log enable, with 2 indicating logging should go to the SD card. These are used as a set of flags internally. Given we only care about receiving the log in general, we can just always signify that we want logging in general.
* | | | | | | | Merge pull request #1885 from lioncash/data_idGravatar bunnei2018-12-101-1/+3
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | file_sys/save_data_factory: Update SaveDataSpaceId enum
| * | | | | | | | file_sys/save_data_factory: Update SaveDataSpaceId enumGravatar Lioncash2018-12-071-1/+3
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends it with missing values deduced from RE (ProperSystem being from SwitchBrew for naming) (SdCardUser wasn't that difficult to discern given it's used alongside SdCardSystem when creating the save data indexer, based off the usage of the string "saveDataIxrDbSd" nearby).
* | | | | | | | Merge pull request #1872 from lioncash/proc-infoGravatar Hexagon122018-12-101-0/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | kernel/process: Set ideal core from metadata
| * | | | | | | | kernel/process: Set ideal core from metadataGravatar Lioncash2018-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A very trivial change. If metadata is available, the process should use it to retrieve the desired core for the process to run on.
* | | | | | | | | Merge pull request #1880 from DarkLordZach/cache-storageGravatar Hexagon122018-12-101-1/+7
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | savedata_factory: Add CacheStorage and delete TemporaryStorage on boot
| * | | | | | | | | savedata_factory: Add support for CacheStorageGravatar Zach Hilman2018-12-071-0/+2
| | | | | | | | | |
| * | | | | | | | | savedata_factory: Delete TemporaryStorage on startupGravatar Zach Hilman2018-12-061-1/+5
| | |_|_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | Mimics hardware behavior.
* | | | | | | | | Merge pull request #1876 from lioncash/vmaGravatar bunnei2018-12-105-28/+41
|\ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / |/| | | | | | | | vm_manager: Make vma_map private
| * | | | | | | | memory: Convert ASSERT into a DEBUG_ASSERT within GetPointerFromVMA()Gravatar Lioncash2018-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given memory should always be expected to be valid during normal execution, this should be a debug assertion, rather than a check in regular builds.
| * | | | | | | | vm_manager: Make vma_map privateGravatar Lioncash2018-12-065-28/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was only ever public so that code could check whether or not a handle was valid or not. Instead of exposing the object directly and allowing external code to potentially mess with the map contents, we just provide a member function that allows checking whether or not a handle is valid. This makes all member variables of the VMManager class private except for the page table.
* | | | | | | | | Merge pull request #1864 from lioncash/nrrGravatar bunnei2018-12-071-4/+5
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | service/ldr: Amend layouts of NRO and NRR headers
| * | | | | | | | | service/ldr: Amend layout of the NRO headerGravatar Lioncash2018-12-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first word is just a padding byte, it's not an actual entry instruction. Also renames the rest of the entries according to SwitchBrew.
| * | | | | | | | | service/ldr: Corrent padding within the NRR header layoutGravatar Lioncash2018-12-051-1/+2
| | |_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The padding after the magic signature value should be 12 bytes rather than 28 bytes. The other 16 should be placed after the title ID pattern.
* | | | | | | | | Merge pull request #1874 from lioncash/bindingsGravatar bunnei2018-12-072-19/+8
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | hle/service, hle/sm: Minor cleanup
| * | | | | | | | | hle/service: Replace log + UNIMPLEMENTED with UNIMPLEMENTED_MSGGravatar Lioncash2018-12-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Combines the two into one, shortening the amount of code here.
| * | | | | | | | | hle/service: Remove unnecessary using declarationsGravatar Lioncash2018-12-061-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only one usage of the specified objects made use of the lack of namespacing. Given the low usage, we can just remove these.
| * | | | | | | | | hle/service, hle/sm: Compress usages of MakeResult()Gravatar Lioncash2018-12-062-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These auto-deduce the result based off its arguments, so there's no need to do that work for the compiler, plus, the function return value itself already indicates what we're returning.
| * | | | | | | | | hle/service, hle/sm: Use structured bindings where applicableGravatar Lioncash2018-12-062-9/+3
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gets rid of the need to keep the variables separate from their actual initialization spots.
* | | | | | | | | Merge pull request #1873 from lioncash/constGravatar bunnei2018-12-0710-10/+10
|\ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / |/| | | | | | | | loaders: Make GetFileType() a const qualified member function