summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1801 from ogniK5377/log-before-executebunnei2018-11-291-24/+206
|\ | | | | Changed logging to be "Log before execution", Added more error logging, all services/svc should now log on some level
| * Added comment on Main memory size for more clarityDavid Marcec2018-11-271-0/+1
| |
| * Made svcSetHeapSize and svcCreateSharedMemory more readableDavid Marcec2018-11-271-4/+4
| |
| * Reworked svcs slightly, improved error messages in AM and fsp_srvDavid Marcec2018-11-271-12/+20
| |
| * Improved error messages for SVCsDavid Marcec2018-11-261-76/+170
| |
| * Changed logging to be "Log before execution", Added more error logging, all services should now log on some levelDavid Marcec2018-11-261-11/+90
| |
* | svc: Implement svcSetResourceLimitLimitValue()Lioncash2018-11-271-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The opposite of the getter functions, this function sets the limit value for a particular ResourceLimit resource category, with the restriction that the new limit value must be equal to or greater than the current resource value. If this is violated, then ERR_INVALID_STATE is returned. e.g. Assume: current[Events] = 10; limit[Events] = 20; a call to this service function lowering the limit value to 10 would be fine, however, attempting to lower it to 9 in this case would cause an invalid state error.
* | svc: Implement svcGetResourceLimitCurrentValue()Lioncash2018-11-271-16/+49
| | | | | | | | | | | | | | | | | | | | | | | | This kernel service function is essentially the exact same as svcGetResourceLimitLimitValue(), with the only difference being that it retrieves the current value for a given resource category using the provided resource limit handle, rather than retrieving the limiting value of that resource limit instance. Given these are exactly the same and only differ on returned values, we can extract the existing code for svcGetResourceLimitLimitValue() to handle both values.
* | svc: Implement svcGetResourceLimitLimitValue()Lioncash2018-11-271-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This kernel service function retrieves the maximum allowable value for a provided resource category for a given resource limit instance. Given we already have the functionality added to the resource limit instance itself, it's sufficient to just hook it up. The error scenarios for this are: 1. If an invalid resource category type is provided, then ERR_INVALID_ENUM is returned. 2. If an invalid handle is provided, then ERR_INVALID_HANDLE is returned (bad thing goes in, bad thing goes out, as one would expect). If neither of the above error cases occur, then the out parameter is provided with the maximum limit value for the given category and success is returned.
* | svc: Implement svcCreateResourceLimit()Lioncash2018-11-271-1/+19
|/ | | | | | | | | | | | | | | This function simply creates a ResourceLimit instance and attempts to create a handle for it within the current process' handle table. If the kernal fails to either create the ResourceLimit instance or create a handle for the ResourceLimit instance, it returns a failure code (OUT_OF_RESOURCE, and HANDLE_TABLE_FULL respectively). Finally, it exits by providing the output parameter with the handle value for the ResourceLimit instance and returning that it was successful. Note: We do not return OUT_OF_RESOURCE because, if yuzu runs out of available memory, then new will currently throw. We *could* allocate the kernel instance with std::nothrow, however this would be inconsistent with how all other kernel objects are currently allocated.
* svc: Return ERR_INVALID_ENUM_VALUE from svcGetInfoLuke Street2018-11-251-1/+2
|
* Merge pull request #1734 from lioncash/sharedbunnei2018-11-211-2/+2
|\ | | | | kernel/shared_memory: Make data members private, plus minor interface changes
| * kernel/shared_memory: Make Map() and Unmap() take the target process by reference rather than as a pointerLioncash2018-11-191-2/+2
| | | | | | | | | | | | Both member functions assume the passed in target process will not be null. Instead of making this assumption implicit, we can change the functions to be references and enforce this at the type-system level.
* | Merge pull request #1667 from DarkLordZach/swkbdbunnei2018-11-201-3/+33
|\ \ | | | | | | am: Implement HLE software keyboard applet
| * | am: Deglobalize software keyboard appletZach Hilman2018-11-181-4/+4
| | |
| * | svc: Implement svcCreateTransferMemoryZach Hilman2018-11-181-3/+33
| | | | | | | | | Seems to be used and created identically to SharedMemory, so just reuse that.
* | | kernel/resource_limit: Clean up interfaceLioncash2018-11-201-11/+0
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | Cleans out the citra/3DS-specific implementation details that don't apply to the Switch. Sets the stage for implementing ResourceLimit instances properly. While we're at it, remove the erroneous checks within CreateThread() and SetThreadPriority(). While these are indeed checked in some capacity, they are not checked via a ResourceLimit instance. In the process of moving out Citra-specifics, this also replaces the system ResourceLimit instance's values with ones from the Switch.
* | Merge pull request #1728 from FearlessTobi/reset-signalMat M2018-11-181-1/+1
|\ \ | |/ |/| svc: ResetSignal is not stubbed
| * svc: ResetSignal is not stubbedTobias2018-11-181-1/+1
| | | | | | https://user-images.githubusercontent.com/20753089/48677874-b8e01c80-eb7b-11e8-8043-b99faa29022c.PNG
* | kernel/errors: Clean up error codesLioncash2018-11-161-10/+10
| | | | | | | | | | | | | | | | Similar to PR 1706, which cleans up the error codes for the filesystem code, but done for the kernel error codes. This removes the ErrCodes namespace and specifies the errors directly. This also fixes up any straggling lines of code that weren't using the named error codes where applicable.
* | Merge pull request #1638 from FreddyFunk/SetMemoryPermission-StubbedMat M2018-11-161-1/+43
|\ \ | | | | | | Implement SetMemoryPermission
| * | Implement SetMemoryPermissionFrederic Laing2018-11-061-3/+39
| | |
| * | Stubbed SetMemoryPermissionFrederic Laing2018-11-031-1/+7
| | |
* | | svc: Use proper random entropy generation algorithmZach Hilman2018-11-131-1/+10
| | |
* | | svc: Return random seed for svcGetInfo RandomEntropyZach Hilman2018-11-131-1/+2
| | |
* | | svcBreak now dumps information from the debug buffer passed (#1646)David2018-11-081-0/+28
|/ / | | | | | | | | | | | | | | * svcBreak now dumps information from the debug buffer passed info1 and info2 seem to somtimes hold an address to a buffer, this is usually 4 bytes or the size of the int and contains an error code. There's other circumstances where it can be something different so we hexdump these to examine them at a later date. * Addressed comments
* / core: Make System references const where applicableLioncash2018-10-281-1/+1
|/
* svc: Localize the GetInfo enum class to the function itselfLioncash2018-10-261-0/+31
| | | | Nothing from this enum is intended to be used outside of this function.
* svc: Implement svcGetInfo command 0xF0000002Lioncash2018-10-261-0/+30
| | | | | | | | | | This retrieves: if (curr_thread == handle_thread) { result = total_thread_ticks + (hardware_tick_count - last_context_switch_ticks); } else if (curr_thread == handle_thread && sub_id == current_core_index) { result = hardware_tick_count - last_context_switch_ticks; }
* kernel/svc: Amend returned error code for invalid priorities in CreateThreadLioncash2018-10-241-1/+1
| | | | | Like with the previous change, the kernel doesn't return NOT_AUTHORIZED here. It returns INVALID_THREAD_PRIORITY.
* kernel/svc: Move and correct returned error code for invalid thread priorities in SetThreadPriority()Lioncash2018-10-241-5/+6
| | | | | | All priority checks are supposed to occur before checking the validity of the thread handle, we're also not supposed to return ERR_NOT_AUTHORIZED here.
* Merge pull request #1551 from ogniK5377/improved-svcbreakbunnei2018-10-241-5/+51
|\ | | | | Added break types to svcBreak
| * Added assertion failed, reworked logging levelsDavid Marcec2018-10-231-16/+24
| |
| * Added break types to svcBreakDavid Marcec2018-10-231-4/+42
| | | | | | | | There seems to be more such as type 1, and 2. Unsure what these currently are but when a game hits them we can investigate and add the rest
* | Merge pull request #1540 from lioncash/handlebunnei2018-10-241-60/+60
|\ \ | |/ |/| kernel/process: Make the handle table per-process
| * kernel/process: Make the handle table per-processLioncash2018-10-201-60/+60
| | | | | | | | | | | | | | | | In the kernel, there isn't a singular handle table that everything gets tossed into or used, rather, each process gets its own handle table that it uses. This currently isn't an issue for us, since we only execute one process at the moment, but we may as well get this out of the way so it's not a headache later on.
* | svc: Fix vma boundary check in svcQueryMemoryLioncash2018-10-201-1/+1
|/ | | | | | This should be comparing against the queried process' vma_map, not the current process'. The only reason this hasn't become an issue yet is we currently only handle one process being active at any time.
* Merge pull request #1520 from lioncash/sanbunnei2018-10-201-3/+27
|\ | | | | svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemory
| * svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemoryLioncash2018-10-181-3/+27
| | | | | | | | | | | | | | | | Now that the changes clarifying the address spaces has been merged, we can wrap the checks that the kernel performs when mapping shared memory (and other forms of memory) into its own helper function and then use those within MapSharedMemory and UnmapSharedMemory to complete the sanitizing checks that are supposed to be done.
* | svc: Check for word alignment of addresses within svcArbitrateLock/svcArbitrateUnlockLioncash2018-10-181-0/+8
| | | | | | | | | | The kernel itself checks whether or not the provided addresses are word aligned before continuing, so we should be doing the same.
* | common: Move Is4KBAligned() to alignment.hLioncash2018-10-181-9/+7
|/ | | | | Aligning on 4KB pages isn't a Switch-specific thing, so this can be moved to common so it can be used with other things as well.
* Merge pull request #1498 from lioncash/aslrbunnei2018-10-181-17/+4
|\ | | | | svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo()
| * svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo()Lioncash2018-10-151-17/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | So, one thing that's puzzled me is why the kernel seemed to *not* use the direct code address ranges in some cases for some service functions. For example, in svcMapMemory, the full address space width is compared against for validity, but for svcMapSharedMemory, it compares against 0xFFE00000, 0xFF8000000, and 0x7FF8000000 as upper bounds, and uses either 0x200000 or 0x8000000 as the lower-bounds as the beginning of the compared range. Coincidentally, these exact same values are also used in svcGetInfo, and also when initializing the user address space, so this is actually retrieving the ASLR extents, not the extents of the address space in general.
* | core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrsLioncash2018-10-151-1/+1
|/
* Merge pull request #1492 from lioncash/procbunnei2018-10-141-1/+24
|\ | | | | svc: Implement svcGetProcessInfo
| * svc: Implement svcGetProcessInfoLioncash2018-10-131-1/+24
| | | | | | | | | | | | | | A fairly basic service function, which only appears to currently support retrieving the process state. This also alters the ProcessStatus enum to contain all of the values that a kernel process seems to be able of reporting with regards to state.
* | Stop all threads on svcBreakDavid Marcec2018-10-141-0/+6
|/ | | | This should help diagnose crashes easier and prevent many users thinking that a game is still running when in fact it's just an audio thread still running(this is typically not killed when svcBreak is hit since the game expects us to do this)
* Merge pull request #1481 from lioncash/typobunnei2018-10-131-3/+3
|\ | | | | svc: Fix typos in sanitizing checks for MapMemory/UnmapMemory
| * svc: Fix typos in sanitizing checks for MapMemory/UnmapMemoryLioncash2018-10-121-3/+3
| |
* | Merge pull request #1467 from ogniK5377/svcbreak-type-fixbunnei2018-10-121-4/+4
|\ \ | |/ |/| Fixed incorrect types for svcBreak
| * Use a better name than "dont_kill_application"David Marcec2018-10-101-2/+2
| | | | | | | | signal_debugger seems like a more fitting name
| * Fixed incorrect types for svcBreakDavid Marcec2018-10-101-3/+3
| | | | | | | | svcBreak reason should be a u32, not a u64.
* | svc: Add missing address range sanitizing checks to MapMemory/UnmapMemoryLioncash2018-10-111-12/+79
| | | | | | | | | | | | | | | | This adds the missing address range checking that the service functions do before attempting to map or unmap memory. Given that both service functions perform the same set of checks in the same order, we can wrap these into a function and just call it from both functions, which deduplicates a little bit of code.
* | kernel/thread: Use a regular pointer for the owner/current processLioncash2018-10-101-6/+6
|/ | | | | | | | | | | There's no real need to use a shared pointer in these cases, and only makes object management more fragile in terms of how easy it would be to introduce cycles. Instead, just do the simple thing of using a regular pointer. Much of this is just a hold-over from citra anyways. It also doesn't make sense from a behavioral point of view for a process' thread to prolong the lifetime of the process itself (the process is supposed to own the thread, not the other way around).
* Added bitfield instead of manually checking if the bit is setDavid Marcec2018-10-091-4/+12
|
* Actual kill execution when the bit isn't set, not the other way aroundDavid Marcec2018-10-091-1/+1
|
* svcBreak, Signalling to the debugger should not kill executionDavid Marcec2018-10-091-5/+12
| | | | When loading NROs, svcBreak is called to signal to the debugger that a new "module" is loaded. As no debugger is technically attached we shouldn't be killing the programs execution.
* kernel/thread: Make all instance variables privateLioncash2018-10-041-57/+64
| | | | | | | | | | | | | | | | | | | | 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.
* kernel/svc: Implement svcGetThreadContext()Lioncash2018-09-301-2/+30
| | | | | | | | | 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).
* kernel/process: Make data member variables privateLioncash2018-09-301-15/+15
| | | | | | | 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.
* Merge pull request #1395 from lioncash/vmbunnei2018-09-291-15/+30
|\ | | | | process/vm_manager: Initial modifications to load NPDM metadata
| * memory: Dehardcode the use of fixed memory range constantsLioncash2018-09-251-1/+2
| | | | | | | | | | | | | | | | 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.
| * svc: Report correct memory-related values within some of the cases in svcGetInfo()Lioncash2018-09-251-14/+28
| | | | | | | | | | | | Previously, these were reporting hardcoded values, but given the regions can change depending on the requested address spaces, these need to report the values that the memory manager contains.
* | Merge pull request #1393 from tech4me/svcbunnei2018-09-251-7/+7
|\ \ | |/ |/| svc: Updated svc names
| * svc: Updated svc namestech4me2018-09-241-7/+7
| |
* | svc: Move most process termination code to its own function within ProcessLioncash2018-09-211-27/+5
|/ | | | | Reduces the use of Process class members externally and keeps most code related to tearing down a process with the rest of the process code.
* kernel/svc: Handle error cases for svcArbitrateLock() and svcArbitrateUnlock()Lioncash2018-09-181-0/+8
| | | | | | | | | | | | | | | The kernel does the equivalent of the following check before proceeding: if (address + 0x8000000000 < 0x7FFFE00000) { return ERR_INVALID_MEMORY_STATE; } which is essentially what our IsKernelVirtualAddress() function does. So we should also be checking for this. The kernel also checks if the given input addresses are 4-byte aligned, however our Mutex::TryAcquire() and Mutex::Release() functions already handle this, so we don't need to add code for this case.
* Merge pull request #1315 from lioncash/sizebunnei2018-09-171-19/+72
|\ | | | | kernel/svc: Handle a few error cases within memory-related functions
| * kernel/svc: Sanitize creation of shared memory via svcCreateSharedMemory()Lioncash2018-09-141-2/+18
| | | | | | | | | | | | | | | | | | | | The kernel caps the size limit of shared memory to 8589930496 bytes (or (1GB - 512 bytes) * 8), so approximately 8GB, where every GB has a 512 byte sector taken off of it. It also ensures the shared memory is created with either read or read/write permissions for both permission types passed in, allowing the remote permissions to also be set as "don't care".
| * kernel/svc: Sanitize addresses, permissions, and sizes within svcMapSharedMemory() and svcUnmapSharedMemory()Lioncash2018-09-141-17/+25
| | | | | | | | | | | | | | | | Part of the checking done by the kernel is to check if the given address and size are 4KB aligned, as well as checking if the size isn't zero. It also only allows mapping shared memory as readable or read/write, but nothing else, and so we shouldn't allow mapping as anything else either.
| * kernel/svc: Sanitize addresses and sizes within svcMapMemory() and svcUnmapMemory()Lioncash2018-09-141-0/+23
| | | | | | | | | | The kernel checks if the addresses and given size is 4KB aligned before continuing onwards to map the memory.
| * kernel/svc: Sanitize heap sizes within svcSetHeapSize()Lioncash2018-09-141-0/+6
| | | | | | | | | | The kernel checks if the given size is a multiple of 2MB and <= to 4GB before going ahead and attempting to allocate that much memory.
* | Merge pull request #1328 from FearlessTobi/port-4192bunnei2018-09-171-1/+1
|\ \ | | | | | | Port #4192 from Citra: "svc: change unknown to thread in CreateThread"
| * | Port # #4192 from Citra: "svc: change unknown to thread in CreateThread"Valentin Vanelslande2018-09-151-1/+1
| |/
* / Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-13/+14
|/
* Merge pull request #1303 from lioncash/errorbunnei2018-09-121-4/+4
|\ | | | | kernel/errors: Amend invalid thread priority and invalid processor ID error codes
| * svc: Return ERR_INVALID_PROCESSOR_ID in CreateThread() if an invalid processor ID is givenLioncash2018-09-121-2/+2
| | | | | | | | This is what the kernel does for an out-of-range processor ID.
| * kernel/errors: Correct error codes for invalid thread priority and invalid processor IDLioncash2018-09-121-2/+2
| |
* | svc: Do nothing if svcOutputDebugString() is given a length of zeroLioncash2018-09-121-0/+4
| | | | | | | | | | | | While unlikely, it does avoid constructing a std::string and unnecessarily calling into the memory code if a game or executable decides to be really silly about their logging.
* | svc: Correct parameter type for OutputDebugString()Lioncash2018-09-121-1/+1
|/ | | | This should be a u64 to represent size.
* service: Migrate global named port map to the KernelCore classLioncash2018-09-021-5/+7
| | | | | | Now that we have a class representing the kernel in some capacity, we now have a place to put the named port map, so we move it over and get rid of another piece of global state within the core.
* core/core: Replace includes with forward declarations where applicableLioncash2018-08-311-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 stateLioncash2018-08-291-25/+55
| | | | | | | | | | | | | | | | | | | | | | 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.
* svc: Return process title ID if queried in GetInfo()Lioncash2018-08-251-2/+1
| | | | | | We already have the variable itself set up to perform this task, so we can just return its value from the currently executing process instead of always stubbing it to zero.
* kernel/svc: Log svcBreak parametersLioncash2018-08-151-2/+5
| | | | | | Given if we hit here all is lost, we should probably be logging the break reason code and associated information to distinguish between the causes.
* Merge pull request #1043 from Subv/timingbunnei2018-08-131-1/+0
|\ | | | | Use an approximated amortized amount of ticks when advancing timing.
| * Kernel/SVC: Don't reschedule the current core when creating a new thread.Subv2018-08-131-1/+0
| | | | | | | | The current core may have nothing to do with the core where the new thread was scheduled to run. In case it's the same core, then the following PrepareReshedule call will take care of that.
* | Kernel/Mutex: Don't duplicate threads in the mutex waiter list.Subv2018-08-121-2/+1
|/ | | | | | | | | | Exit from AddMutexWaiter early if the thread is already waiting for a mutex owned by the owner thread. This accounts for the possibility of a thread that is waiting on a condition variable being awakened twice in a row. Also added more validation asserts. This should fix one of the random crashes in Breath Of The Wild.
* kernel/vm_manager: Use const where applicableLioncash2018-08-021-1/+1
| | | | Makes our immutable state explicit.
* Merge pull request #877 from lioncash/removebunnei2018-08-011-1/+0
|\ | | | | kernel: Remove unused object_address_table.cpp/.h
| * kernel: Remove unused object_address_table.cpp/.hLioncash2018-07-311-1/+0
| | | | | | | | | | | | These source files were entirely unused throughout the rest of the codebase. This also has the benefit of getting rid of a global variable as well.
* | kernel: Remove unnecessary includesLioncash2018-07-311-0/+3
|/ | | | | Removes unnecessary direct dependencies in some headers and also gets rid of indirect dependencies that were being relied on to be included.
* Merge pull request #804 from lioncash/logMat M2018-07-251-1/+3
|\ | | | | svc: Log parameters in SetMemoryAttribute()
| * svc: Log parameters in SetMemoryAttribute()Lioncash2018-07-241-1/+3
| | | | | | | | Provides slightly more context than only logging out the address value.
* | svc: Resolve sign comparison warnings in WaitSynchronization()Lioncash2018-07-241-4/+7
|/ | | | | The loop's induction variable was signed, but we were comparing against an unsigned variable.
* Kernel/SVC: Perform atomic accesses in SignalProcessWideKey as per the real kernel.Subv2018-07-221-7/+31
|
* thread: Convert ThreadStatus into an enum classLioncash2018-07-201-10/+10
| | | | | Makes the thread status strongly typed, so implicit conversions can't happen. It also makes it easier to catch mistakes at compile time.
* svc: Correct always true assertion case in SetThreadCoreMaskLioncash2018-07-191-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reason this would never be true is that ideal_processor is a u8 and THREADPROCESSORID_DEFAULT is an s32. In this case, it boils down to how arithmetic conversions are performed before performing the comparison. If an unsigned value has a lesser conversion rank (aka smaller size) than the signed type being compared, then the unsigned value is promoted to the signed value (i.e. u8 -> s32 happens before the comparison). No sign-extension occurs here either. An alternative phrasing: Say we have a variable named core and it's given a value of -2. u8 core = -2; This becomes 254 due to the lack of sign. During integral promotion to the signed type, this still remains as 254, and therefore the condition will always be true, because no matter what value the u8 is given it will never be -2 in terms of 32 bits. Now, if one type was a s32 and one was a u32, this would be entirely different, since they have the same bit width (and the signed type would be converted to unsigned instead of the other way around) but would still have its representation preserved in terms of bits, allowing the comparison to be false in some cases, as opposed to being true all the time. --- We also get rid of two signed/unsigned comparison warnings while we're at it.
* Update clang formatJames Rowe2018-07-031-28/+25
|
* Rename logging macro back to LOG_*James Rowe2018-07-031-47/+47
|
* Kernel/Arbiters: Fix casts, cleanup comments/magic numbersMichael Scire2018-06-221-4/+4
|
* Add additional missing format.Michael Scire2018-06-221-19/+21
|
* Kernel/Arbiters: Initialize arb_wait_address in thread struct.Michael Scire2018-06-211-0/+4
|
* Kernel/Arbiters: Mostly implement SignalToAddressMichael Scire2018-06-211-1/+1
|
* Kernel/Arbiters: Add stubs for 4.x SignalToAddress/WaitForAddres SVCs.Michael Scire2018-06-211-3/+50
|
* Build: Fixed some MSVC warnings in various parts of the code.Subv2018-06-201-2/+2
|
* Merge pull request #572 from Armada651/user-except-stubbunnei2018-06-181-0/+5
|\ | | | | svc: Add a stub for UserExceptionContextAddr.
| * svc: Add a stub for UserExceptionContextAddr.Jules Blok2018-06-181-0/+5
| |
* | Kernel/SVC: Support special core values -2 and -3 in svcSetThreadCoreMask.Subv2018-05-311-1/+26
| | | | | | | | Also added some proper error handling.
* | Kernel/SVC: Signal the highest priority threads first in svcSignalProcessWideKey.Subv2018-05-191-51/+68
| |
* | Kernel/Threads: Reschedule the proper core when operating on that core's threads.Subv2018-05-191-2/+6
| |
* | SVC: Removed unused WaitSynchronization1 functionSubv2018-05-191-30/+0
| |
* | thread: Rename mask to affinity_masks.bunnei2018-05-111-1/+1
| |
* | threading: Reschedule only on cores that are necessary.bunnei2018-05-111-2/+2
| |
* | svc: Implement GetThreadCoreMask and SetThreadCoreMask.bunnei2018-05-111-7/+22
| |
* | svc: SignalProcessWideKey should apply to all cores.bunnei2018-05-111-43/+50
| |
* | svc: Implement GetCurrentProcessorNumber.bunnei2018-05-111-2/+2
| |
* | core: Implement multicore support.bunnei2018-05-111-21/+22
| |
* | general: Make formatting of logged hex values more straightforwardLioncash2018-05-021-38/+39
| | | | | | | | | | | | 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).
* | string_util: Remove StringFromFormat() and related functionsLioncash2018-04-301-1/+1
| | | | | | | | Given we utilize fmt, we don't need to provide our own functions for formatting anymore
* | general: Convert assertion macros over to be fmt-compatibleLioncash2018-04-271-1/+1
| |
* | kernel: Migrate logging macros to fmt-compatible onesLioncash2018-04-261-69/+69
| |
* | Merge pull request #370 from Subv/sync_primitivesbunnei2018-04-231-107/+55
|\ \ | | | | | | Kernel: Reworked the new kernel synchronization primitives.
| * | Kernel: Implemented mutex priority inheritance.Subv2018-04-231-0/+9
| | | | | | | | | | | | | | | | | | | | | Verified with a hwtest and implemented based on reverse engineering. Thread A's priority will get bumped to the highest priority among all the threads that are waiting for a mutex that A holds. Once A releases the mutex and ownership is transferred to B, A's priority will return to normal and B's priority will be bumped.
| * | Kernel: Remove unused ConditionVariable class.Subv2018-04-211-6/+0
| | |
| * | Kernel: Properly implemented svcWaitProcessWideKey and svcSignalProcessWideKeySubv2018-04-211-83/+46
| | | | | | | | | | | | They work in tandem with guest code to provide synchronization primitives along with svcArbitrateLock/Unlock
| * | Kernel: Corrected the implementation of svcArbitrateLock and svcArbitrateUnlock.Subv2018-04-211-20/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch mutexes are no longer kernel objects, they are managed in userland and only use the kernel to handle the contention case. Mutex addresses store a special flag value (0x40000000) to notify the guest code that there are still some threads waiting for the mutex to be released. This flag is updated when a thread calls ArbitrateUnlock. TODO: * Fix svcWaitProcessWideKey * Fix svcSignalProcessWideKey * Remove the Mutex class.
* | | resource_limit: Make ResourceTypes an enum classLioncash2018-04-211-2/+2
|/ / | | | | | | Prevents enum identifiers from leaking into the surrounding scope.
* | common_funcs: Remove ARRAY_SIZE macroLioncash2018-04-201-1/+2
| | | | | | | | C++17 has non-member size() which we can just call where necessary.
* | Various service name fixes - part 2 (rebased) (#322)Hexagon122018-04-171-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Updated ACC with more service names * Updated SVC with more service names * Updated set with more service names * Updated sockets with more service names * Updated SPL with more service names * Updated time with more service names * Updated vi with more service names
* | svc: Stub out SetThreadActivity, GetThreadContext.bunnei2018-04-031-2/+14
| |
* | svc: Stub GetThreadCoreMask.bunnei2018-03-301-3/+11
| |
* | More Warning cleanupsN00byKing2018-03-191-1/+1
| |
* | Clean Warnings (?)N00byKing2018-03-191-1/+1
| |
* | svc: Use more correct values for GetInfo MapRegion and NewMapRegion.bunnei2018-03-161-5/+5
| |
* | MemoryState: Add additional memory states and improve naming.bunnei2018-03-161-1/+1
| |
* | core: Move process creation out of global state.bunnei2018-03-141-18/+20
|/
* Merge pull request #215 from N00byKing/umapsharedmmrybunnei2018-02-261-1/+12
|\ | | | | UnmapSharedMemory
| * (Hopefully) Fix MinGW BuildN00byKing2018-02-251-1/+1
| |
| * Add UnmapSharedMemoryN00byKing2018-02-251-1/+12
| | | | | | | | | | | | | | | | C++11 requires spaces on the Identifier Add inttypes include clang
* | Stub more functionsmailwl2018-02-221-1/+11
|/
* kernel: Use Scheduler class for threading.bunnei2018-02-181-2/+2
|
* GetInfo: Implement IsCurrentProcessBeingDebugged.bunnei2018-02-041-0/+3
|
* WaitProcessWideKeyAtomic: Handle case where condition variable was already created.bunnei2018-02-041-8/+15
|
* svc: SharedMemory size should be 64-bits and cleanup.bunnei2018-02-031-8/+8
|
* ArbitrateLock: Assert that requesting_thread is current_thread.bunnei2018-02-031-0/+1
|
* hle: Remove Domain and SyncObject kernel objects.bunnei2018-01-251-2/+1
|
* Format: Run the new clang format on everythingJames Rowe2018-01-211-4/+6
|
* Added CreateSharedMemory & UNIMPLEMENTED() for non existent services. (#113)David2018-01-201-1/+13
| | | | | | | | | | | | * Added svcCreateSharedMemory * Services which are not implemented now throw UNIMPLEMENTED() * clang-format * changed perms to u32 * removed camelcase
* svc: Fix svcGetInfo MapRegionBaseAddr.bunnei2018-01-191-1/+1
|
* svc: Rename some entries to match their analogue on SwitchBrewLioncash2018-01-181-7/+7
| | | | Makes the codebase a little more consistent with regards to available documentation. Also amends the duplicate case where there was a similar entry at 0x72 named ConnectToPort.
* svc: Add CreateJitMemory and MapJitMemory svc stringsLioncash2018-01-181-2/+2
| | | | Makes the table match SwitchBrew for these entries
* svc: Clang-format fix.bunnei2018-01-171-6/+4
|
* SVC: Correct some return values in svcGetInfo and added TitleId and PrivilegedProcessId stubs.Subv2018-01-171-6/+21
| | | | | # Conflicts: # src/core/hle/kernel/svc.cpp
* Merge pull request #52 from ogniK5377/fspbunnei2018-01-171-1/+18
|\ | | | | added more svcGetInfo pairs for 3.0.0+ support, Changed HEAP_SIZE and TLS_AREA_VADDR. changed mem usage & heap usage stub added, ISelfController, IApplication function stubs. Added SetThreadCoreMask
| * SetThreadCoreMask stub, time to implement fspDavid Marcec2018-01-161-1/+6
| |
| * Added more svcGetInfo pairsDavid Marcec2018-01-161-0/+12
| |
* | clang-formatMerryMage2018-01-161-6/+4
|/
* svc: Implement svcMapSharedMemory.bunnei2018-01-141-1/+33
|
* yuzu: Update license text to be consistent across project.bunnei2018-01-131-1/+1
|
* core: Include <algorithm> where used.bunnei2018-01-121-0/+2
|
* svc: Implement GetSystemTick.bunnei2018-01-121-2/+13
|
* svc: Stub ResetSignal and CreateTransferMemorySubv2018-01-111-3/+20
|
* svc: Stub SetMemoryAttributeSubv2018-01-111-0/+5
|
* Threads: Added enum values for the Switch's 4 cpu cores and implemented svcGetInfo(AllowedCpuIdBitmask)Subv2018-01-101-6/+11
|
* SVC: Fixed WaitSynchronization with multiple handles when none is immediately ready.Subv2018-01-091-7/+18
|
* SVC: Implemented CancelSynchronization.Subv2018-01-091-1/+17
|
* SVC: Fixed WaitSynchronization with multiple handles when at least one of them is ready.Subv2018-01-091-1/+24
|
* kernel: Rename Semaphore to ConditionVariable.bunnei2018-01-091-25/+33
|
* Kernel: Actually wake up the requested number of threads in Semaphore::Release.Subv2018-01-091-1/+1
| | | | | | Also properly keep track of data in guest memory, this fixes managing the semaphore from userland. It was found that Semaphores are actually Condition Variables, with Release(1) and Release(-1) being equivalent to notify_one and notify_all. We should change the name of the class to reflect this.
* Kernel: Properly keep track of mutex lock data in the guest memory. This fixes userland locking/unlocking.Subv2018-01-091-1/+4
|
* Kernel: Allow chaining WaitSynchronization calls inside a wakeup callback.Subv2018-01-091-15/+41
|
* svc: Implement svcSignalProcessWideKey.bunnei2018-01-071-2/+21
|
* svc: Implement svcWaitProcessWideKeyAtomic.bunnei2018-01-061-1/+49
|
* svc: Implement WaitSynchronization for a single handle.bunnei2018-01-061-4/+24
|
* svc: Refactor LockMutex code to use WaitSynchronization1.bunnei2018-01-061-13/+45
|
* svc: Add missing string_util include.bunnei2018-01-051-0/+1
|
* arm: Remove SkyEye/Dyncom code that is ARMv6-only.bunnei2018-01-031-19/+9
|
* svc: Remove unnecessary "svc" prefix to naming scheme.bunnei2018-01-031-106/+106
|
* hle: Move SVC code to kernel namespace.bunnei2018-01-031-0/+612