summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-12-22Handle RZ cases evaluating the expression instead of the register value.Rodolfo Bogado
2018-12-22complete emulation of ZeroFlagRodolfo Bogado
2018-12-21Merge pull request #1921 from ogniK5377/no-unitbunnei
Fixed uninitialized memory due to missing returns in canary
2018-12-21Merge pull request #1920 from heapo/texture_format_selectionbunnei
Texture format fixes for RGBA16UI for copies and R16U when used as depth
2018-12-21Merge pull request #1925 from lioncash/pidbunnei
kernel/{process, thread}: Amend behavior related to IDs
2018-12-21Merge pull request #1914 from lioncash/idbunnei
service/am: Unstub GetAppletResourceUserId
2018-12-19Merge pull request #1923 from ogniK5377/nfp-device-listbunnei
Device handle should not be a random id, instead it's the current npad id
2018-12-19Merge pull request #1909 from heapo/shadow_sampling_fixesbunnei
Fix arrayed texture LOD selection and depth comparison ordering
2018-12-19Merge pull request #1915 from lioncash/smbunnei
service/sm: Improve debug log for RegisterService
2018-12-19kernel/svc: Handle thread handles within GetProcessIdLioncash
If a thread handle is passed to svcGetProcessId, the kernel attempts to access the process ID via the thread's instance's owning process. Technically, this function should also be handling the kernel debug objects as well, however we currently don't handle those kernel objects yet, so I've left a note via a comment about it to remind myself when implementing it in the future.
2018-12-19Merge pull request #1907 from lioncash/attributebunnei
kernel/svc: Implement svcSetMemoryAttribute
2018-12-19svc: Implement svcSetMemoryAttributeLioncash
With all the basic backing functionality implemented, we can now unstub svcSetMemoryAttribute.
2018-12-19vm_manager: Add member function for setting memory attributes across an ↵Lioncash
address range This puts the backing functionality for svcSetMemoryAttribute in place, which will be utilized in a following change.
2018-12-19vm_manager: Add member function for checking a memory range adheres to ↵Lioncash
certain attributes, permissions and states
2018-12-18kernel/kernel: Use correct initial PID for userland Process instancesLioncash
Starts the process ID counter off at 81, which is what the kernel itself checks against internally when creating processes. It's actually supposed to panic if the PID is less than 81 for a userland process.
2018-12-18kernel/svc: Correct output parameter for svcGetThreadIdLioncash
The service call uses a 64-bit value, just like svcGetProcessId. This amends the function signature accordingly.
2018-12-18kernel/thread: Make thread_id a 64-bit valueLioncash
The kernel uses a 64-bit value for the thread ID, so we shouldn't be using a 32-bit value.
2018-12-18kernel/svc: Correct output parameter for svcGetProcessIdLioncash
svcGetProcessId's out parameter is a pointer to a 64-bit value, not a 32-bit one.
2018-12-18kernel/process: Make process_id a 64-bit valueLioncash
In the actual kernel, this is a 64-bit value, so we shouldn't be using a 32-bit type to handle it.
2018-12-19Device handle should not be a random id, instead it's the current npad idDavid Marcec
Found during hardware testing
2018-12-19hopefully fix clang format issueDavid Marcec
2018-12-19Fixed uninitialized memory due to missing returns in canaryDavid Marcec
Functions which are suppose to crash on non canary builds usually don't return anything which lead to uninitialized memory being used.
2018-12-18service/sm: Improve debug log for RegisterServiceLioncash
Now it also indicates the name and max session count. This also gives a name to the unknown bool. This indicates if the created port is supposed to be using light handles or regular handles internally. This is passed to the respective svcCreatePort parameter internally.
2018-12-18Texture format fixes: Flag RGBA16UI as GL_RGBA_INTEGER format, and interpret ↵heapo
R16U as Z16 when depth_compare is enabled.
2018-12-18Merge pull request #1913 from MerryMage/default-fpcrbunnei
kernel/thread: Set default fpcr
2018-12-18Merge pull request #1918 from MerryMage/cntfrqbunnei
arm_dynarmic: Set CNTFRQ value
2018-12-18kernel/thread: Set default fpcrMerryMage
2018-12-18arm_dynarmic: Set CNTFRQ valueMerryMage
2018-12-18Merge pull request #1917 from ReinUsesLisp/fixup-halfbunnei
shader_bytecode: Fixup half float's operator B encoding
2018-12-18Merge pull request #1889 from DarkLordZach/swkbd-state-changedbunnei
applets: Correct usage of SignalStateChanged event
2018-12-18shader_bytecode: Fixup half float's operator B encodingReinUsesLisp
2018-12-17Merge pull request #1903 from heapo/fmul_postfactorbunnei
Implement postfactor multiplication/division for fmul instructions
2018-12-17service/am: Unstub GetAppletResourceUserIdLioncash
This is supposed to return the current process' ID. (0 indicates an invalid ID for both process IDs and ARU IDs).
2018-12-17Implement postfactor multiplication/division for fmul instructionsheapo
2018-12-17Fix arrayed shadow sampler array slice/depth comparison ordering, as well as ↵heapo
invalid GLSL LOD selection.
2018-12-15vm_manager: Rename meminfo_state to stateLioncash
This is shorter and more concise. This also removes the now-innaccurate comment, as it's not returned wholesale to svcQueryMemory anymore.
2018-12-15vm_manager: Add backing functionality for memory attributesLioncash
Adds the barebones enumeration constants and functions in place to handle memory attributes, while also essentially leaving the attribute itself non-functional.
2018-12-15Merge pull request #1905 from bunnei/ignore-empty-gpu-listsbunnei
nvhost_gpu: Skip empty GPU command lists.
2018-12-15nvhost_gpu: Skip empty GPU command lists.bunnei
2018-12-15Merge pull request #1901 from jschmer/ServiceLeakbunnei
Fix Service object leak on emulation stop
2018-12-15Merge pull request #1732 from DarkLordZach/yield-typesbunnei
svc: Implement yield types 0 and -1
2018-12-14Merge pull request #1902 from lioncash/audiobunnei
audio_core: Make g_sink_details internally linked
2018-12-14Merge pull request #1899 from lioncash/statebunnei
vm_manager/svc: Modify MemoryState enum, and correct error handling for svcQueryMemory
2018-12-14Merge pull request #1871 from lioncash/movebunnei
yuzu/wait_tree: Pass QString by value and std::move in the initializer list for WaitTreeText
2018-12-14Merge pull request #1900 from lioncash/wrapperbunnei
svc_wrap: Correct register index for a wrapper specialization
2018-12-13audio_core: Make g_sink_details internally linkedLioncash
We can hide the direct array from external view and instead provide functions to retrieve the necessary info. This has the benefit of completely hiding the makeup of the SinkDetails structure from the rest of the code. Given that this makes the array hidden, we can also make the array constexpr by altering the members slightly. This gets rid of several static constructor calls related to std::vector and std::function. Now we don't have heap allocations here that need to occur before the program can even enter main(). It also has the benefit of saving a little bit of heap space, but this doesn't matter too much, since the savings in that regard are pretty tiny.
2018-12-13Fix Service object leak on emulation stopJens Schmer
Services created with the ServiceFramework base class install themselves as HleHandlers with an owning shared_ptr in the ServerPort ServiceFrameworkBase::port member variable, creating a cyclic ownership between ServiceFrameworkBase and the ServerPort, preventing deletion of the service objects. Fix that by removing the ServiceFrameworkBase::port member because that was only used to detect multiple attempts at installing a port. Instead store a flag if the port was already installed to achieve the same functionality.
2018-12-12svc: Enable svcQueryProcessMemoryLioncash
svcQueryProcessMemory is trivial to implement, given all the behavior necessary for it is present, it just needs a handler for it.
2018-12-12svc: Write out the complete MemoryInfo structure in QueryProcessMemoryLioncash
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.
2018-12-12svc: Handle memory writing explicitly within QueryProcessMemoryLioncash
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.