Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Merge pull request #1303 from lioncash/error | bunnei | 2018-09-12 | 1 | -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 given | Lioncash | 2018-09-12 | 1 | -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 ID | Lioncash | 2018-09-12 | 1 | -2/+2 |
| | | |||||
* | | svc: Do nothing if svcOutputDebugString() is given a length of zero | Lioncash | 2018-09-12 | 1 | -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() | Lioncash | 2018-09-12 | 1 | -1/+1 |
|/ | | | | This should be a u64 to represent size. | ||||
* | service: Migrate global named port map to the KernelCore class | Lioncash | 2018-09-02 | 1 | -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 applicable | Lioncash | 2018-08-31 | 1 | -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 state | Lioncash | 2018-08-29 | 1 | -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() | Lioncash | 2018-08-25 | 1 | -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 parameters | Lioncash | 2018-08-15 | 1 | -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/timing | bunnei | 2018-08-13 | 1 | -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. | Subv | 2018-08-13 | 1 | -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. | Subv | 2018-08-12 | 1 | -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 applicable | Lioncash | 2018-08-02 | 1 | -1/+1 |
| | | | | Makes our immutable state explicit. | ||||
* | Merge pull request #877 from lioncash/remove | bunnei | 2018-08-01 | 1 | -1/+0 |
|\ | | | | | kernel: Remove unused object_address_table.cpp/.h | ||||
| * | kernel: Remove unused object_address_table.cpp/.h | Lioncash | 2018-07-31 | 1 | -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 includes | Lioncash | 2018-07-31 | 1 | -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/log | Mat M | 2018-07-25 | 1 | -1/+3 |
|\ | | | | | svc: Log parameters in SetMemoryAttribute() | ||||
| * | svc: Log parameters in SetMemoryAttribute() | Lioncash | 2018-07-24 | 1 | -1/+3 |
| | | | | | | | | Provides slightly more context than only logging out the address value. | ||||
* | | svc: Resolve sign comparison warnings in WaitSynchronization() | Lioncash | 2018-07-24 | 1 | -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. | Subv | 2018-07-22 | 1 | -7/+31 |
| | |||||
* | thread: Convert ThreadStatus into an enum class | Lioncash | 2018-07-20 | 1 | -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 SetThreadCoreMask | Lioncash | 2018-07-19 | 1 | -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 format | James Rowe | 2018-07-03 | 1 | -28/+25 |
| | |||||
* | Rename logging macro back to LOG_* | James Rowe | 2018-07-03 | 1 | -47/+47 |
| | |||||
* | Kernel/Arbiters: Fix casts, cleanup comments/magic numbers | Michael Scire | 2018-06-22 | 1 | -4/+4 |
| | |||||
* | Add additional missing format. | Michael Scire | 2018-06-22 | 1 | -19/+21 |
| | |||||
* | Kernel/Arbiters: Initialize arb_wait_address in thread struct. | Michael Scire | 2018-06-21 | 1 | -0/+4 |
| | |||||
* | Kernel/Arbiters: Mostly implement SignalToAddress | Michael Scire | 2018-06-21 | 1 | -1/+1 |
| | |||||
* | Kernel/Arbiters: Add stubs for 4.x SignalToAddress/WaitForAddres SVCs. | Michael Scire | 2018-06-21 | 1 | -3/+50 |
| | |||||
* | Build: Fixed some MSVC warnings in various parts of the code. | Subv | 2018-06-20 | 1 | -2/+2 |
| | |||||
* | Merge pull request #572 from Armada651/user-except-stub | bunnei | 2018-06-18 | 1 | -0/+5 |
|\ | | | | | svc: Add a stub for UserExceptionContextAddr. | ||||
| * | svc: Add a stub for UserExceptionContextAddr. | Jules Blok | 2018-06-18 | 1 | -0/+5 |
| | | |||||
* | | Kernel/SVC: Support special core values -2 and -3 in svcSetThreadCoreMask. | Subv | 2018-05-31 | 1 | -1/+26 |
| | | | | | | | | Also added some proper error handling. | ||||
* | | Kernel/SVC: Signal the highest priority threads first in svcSignalProcessWideKey. | Subv | 2018-05-19 | 1 | -51/+68 |
| | | |||||
* | | Kernel/Threads: Reschedule the proper core when operating on that core's threads. | Subv | 2018-05-19 | 1 | -2/+6 |
| | | |||||
* | | SVC: Removed unused WaitSynchronization1 function | Subv | 2018-05-19 | 1 | -30/+0 |
| | | |||||
* | | thread: Rename mask to affinity_masks. | bunnei | 2018-05-11 | 1 | -1/+1 |
| | | |||||
* | | threading: Reschedule only on cores that are necessary. | bunnei | 2018-05-11 | 1 | -2/+2 |
| | | |||||
* | | svc: Implement GetThreadCoreMask and SetThreadCoreMask. | bunnei | 2018-05-11 | 1 | -7/+22 |
| | | |||||
* | | svc: SignalProcessWideKey should apply to all cores. | bunnei | 2018-05-11 | 1 | -43/+50 |
| | | |||||
* | | svc: Implement GetCurrentProcessorNumber. | bunnei | 2018-05-11 | 1 | -2/+2 |
| | | |||||
* | | core: Implement multicore support. | bunnei | 2018-05-11 | 1 | -21/+22 |
| | | |||||
* | | general: Make formatting of logged hex values more straightforward | Lioncash | 2018-05-02 | 1 | -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 functions | Lioncash | 2018-04-30 | 1 | -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-compatible | Lioncash | 2018-04-27 | 1 | -1/+1 |
| | | |||||
* | | kernel: Migrate logging macros to fmt-compatible ones | Lioncash | 2018-04-26 | 1 | -69/+69 |
| | | |||||
* | | Merge pull request #370 from Subv/sync_primitives | bunnei | 2018-04-23 | 1 | -107/+55 |
|\ \ | | | | | | | Kernel: Reworked the new kernel synchronization primitives. | ||||
| * | | Kernel: Implemented mutex priority inheritance. | Subv | 2018-04-23 | 1 | -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. | Subv | 2018-04-21 | 1 | -6/+0 |
| | | | |||||
| * | | Kernel: Properly implemented svcWaitProcessWideKey and svcSignalProcessWideKey | Subv | 2018-04-21 | 1 | -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. | Subv | 2018-04-21 | 1 | -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 class | Lioncash | 2018-04-21 | 1 | -2/+2 |
|/ / | | | | | | | Prevents enum identifiers from leaking into the surrounding scope. | ||||
* | | common_funcs: Remove ARRAY_SIZE macro | Lioncash | 2018-04-20 | 1 | -1/+2 |
| | | | | | | | | C++17 has non-member size() which we can just call where necessary. | ||||
* | | Various service name fixes - part 2 (rebased) (#322) | Hexagon12 | 2018-04-17 | 1 | -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. | bunnei | 2018-04-03 | 1 | -2/+14 |
| | | |||||
* | | svc: Stub GetThreadCoreMask. | bunnei | 2018-03-30 | 1 | -3/+11 |
| | | |||||
* | | More Warning cleanups | N00byKing | 2018-03-19 | 1 | -1/+1 |
| | | |||||
* | | Clean Warnings (?) | N00byKing | 2018-03-19 | 1 | -1/+1 |
| | | |||||
* | | svc: Use more correct values for GetInfo MapRegion and NewMapRegion. | bunnei | 2018-03-16 | 1 | -5/+5 |
| | | |||||
* | | MemoryState: Add additional memory states and improve naming. | bunnei | 2018-03-16 | 1 | -1/+1 |
| | | |||||
* | | core: Move process creation out of global state. | bunnei | 2018-03-14 | 1 | -18/+20 |
|/ | |||||
* | Merge pull request #215 from N00byKing/umapsharedmmry | bunnei | 2018-02-26 | 1 | -1/+12 |
|\ | | | | | UnmapSharedMemory | ||||
| * | (Hopefully) Fix MinGW Build | N00byKing | 2018-02-25 | 1 | -1/+1 |
| | | |||||
| * | Add UnmapSharedMemory | N00byKing | 2018-02-25 | 1 | -1/+12 |
| | | | | | | | | | | | | | | | | C++11 requires spaces on the Identifier Add inttypes include clang | ||||
* | | Stub more functions | mailwl | 2018-02-22 | 1 | -1/+11 |
|/ | |||||
* | kernel: Use Scheduler class for threading. | bunnei | 2018-02-18 | 1 | -2/+2 |
| | |||||
* | GetInfo: Implement IsCurrentProcessBeingDebugged. | bunnei | 2018-02-04 | 1 | -0/+3 |
| | |||||
* | WaitProcessWideKeyAtomic: Handle case where condition variable was already created. | bunnei | 2018-02-04 | 1 | -8/+15 |
| | |||||
* | svc: SharedMemory size should be 64-bits and cleanup. | bunnei | 2018-02-03 | 1 | -8/+8 |
| | |||||
* | ArbitrateLock: Assert that requesting_thread is current_thread. | bunnei | 2018-02-03 | 1 | -0/+1 |
| | |||||
* | hle: Remove Domain and SyncObject kernel objects. | bunnei | 2018-01-25 | 1 | -2/+1 |
| | |||||
* | Format: Run the new clang format on everything | James Rowe | 2018-01-21 | 1 | -4/+6 |
| | |||||
* | Added CreateSharedMemory & UNIMPLEMENTED() for non existent services. (#113) | David | 2018-01-20 | 1 | -1/+13 |
| | | | | | | | | | | | | * Added svcCreateSharedMemory * Services which are not implemented now throw UNIMPLEMENTED() * clang-format * changed perms to u32 * removed camelcase | ||||
* | svc: Fix svcGetInfo MapRegionBaseAddr. | bunnei | 2018-01-19 | 1 | -1/+1 |
| | |||||
* | svc: Rename some entries to match their analogue on SwitchBrew | Lioncash | 2018-01-18 | 1 | -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 strings | Lioncash | 2018-01-18 | 1 | -2/+2 |
| | | | | Makes the table match SwitchBrew for these entries | ||||
* | svc: Clang-format fix. | bunnei | 2018-01-17 | 1 | -6/+4 |
| | |||||
* | SVC: Correct some return values in svcGetInfo and added TitleId and PrivilegedProcessId stubs. | Subv | 2018-01-17 | 1 | -6/+21 |
| | | | | | # Conflicts: # src/core/hle/kernel/svc.cpp | ||||
* | Merge pull request #52 from ogniK5377/fsp | bunnei | 2018-01-17 | 1 | -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 fsp | David Marcec | 2018-01-16 | 1 | -1/+6 |
| | | |||||
| * | Added more svcGetInfo pairs | David Marcec | 2018-01-16 | 1 | -0/+12 |
| | | |||||
* | | clang-format | MerryMage | 2018-01-16 | 1 | -6/+4 |
|/ | |||||
* | svc: Implement svcMapSharedMemory. | bunnei | 2018-01-14 | 1 | -1/+33 |
| | |||||
* | yuzu: Update license text to be consistent across project. | bunnei | 2018-01-13 | 1 | -1/+1 |
| | |||||
* | core: Include <algorithm> where used. | bunnei | 2018-01-12 | 1 | -0/+2 |
| | |||||
* | svc: Implement GetSystemTick. | bunnei | 2018-01-12 | 1 | -2/+13 |
| | |||||
* | svc: Stub ResetSignal and CreateTransferMemory | Subv | 2018-01-11 | 1 | -3/+20 |
| | |||||
* | svc: Stub SetMemoryAttribute | Subv | 2018-01-11 | 1 | -0/+5 |
| | |||||
* | Threads: Added enum values for the Switch's 4 cpu cores and implemented svcGetInfo(AllowedCpuIdBitmask) | Subv | 2018-01-10 | 1 | -6/+11 |
| | |||||
* | SVC: Fixed WaitSynchronization with multiple handles when none is immediately ready. | Subv | 2018-01-09 | 1 | -7/+18 |
| | |||||
* | SVC: Implemented CancelSynchronization. | Subv | 2018-01-09 | 1 | -1/+17 |
| | |||||
* | SVC: Fixed WaitSynchronization with multiple handles when at least one of them is ready. | Subv | 2018-01-09 | 1 | -1/+24 |
| | |||||
* | kernel: Rename Semaphore to ConditionVariable. | bunnei | 2018-01-09 | 1 | -25/+33 |
| | |||||
* | Kernel: Actually wake up the requested number of threads in Semaphore::Release. | Subv | 2018-01-09 | 1 | -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. | Subv | 2018-01-09 | 1 | -1/+4 |
| | |||||
* | Kernel: Allow chaining WaitSynchronization calls inside a wakeup callback. | Subv | 2018-01-09 | 1 | -15/+41 |
| | |||||
* | svc: Implement svcSignalProcessWideKey. | bunnei | 2018-01-07 | 1 | -2/+21 |
| | |||||
* | svc: Implement svcWaitProcessWideKeyAtomic. | bunnei | 2018-01-06 | 1 | -1/+49 |
| | |||||
* | svc: Implement WaitSynchronization for a single handle. | bunnei | 2018-01-06 | 1 | -4/+24 |
| | |||||
* | svc: Refactor LockMutex code to use WaitSynchronization1. | bunnei | 2018-01-06 | 1 | -13/+45 |
| | |||||
* | svc: Add missing string_util include. | bunnei | 2018-01-05 | 1 | -0/+1 |
| | |||||
* | arm: Remove SkyEye/Dyncom code that is ARMv6-only. | bunnei | 2018-01-03 | 1 | -19/+9 |
| | |||||
* | svc: Remove unnecessary "svc" prefix to naming scheme. | bunnei | 2018-01-03 | 1 | -106/+106 |
| | |||||
* | hle: Move SVC code to kernel namespace. | bunnei | 2018-01-03 | 1 | -0/+612 |