Commit Graph

294 Commits

Author SHA1 Message Date
Lioncash
896c0f61a0 svc: Fix vma boundary check in svcQueryMemory
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.
2018-10-20 14:56:51 -04:00
bunnei
60317e6306
Merge pull request #1520 from lioncash/san
svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemory
2018-10-19 22:58:57 -04:00
Lioncash
4b5ae8dbaa svc: Check for word alignment of addresses within svcArbitrateLock/svcArbitrateUnlock
The kernel itself checks whether or not the provided addresses are word
aligned before continuing, so we should be doing the same.
2018-10-18 13:01:29 -04:00
Lioncash
d27f4a4928 common: Move Is4KBAligned() to alignment.h
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.
2018-10-18 12:57:02 -04:00
Lioncash
33830aa65a svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemory
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.
2018-10-18 02:01:21 -04:00
bunnei
6e8752881c
Merge pull request #1498 from lioncash/aslr
svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo()
2018-10-17 18:31:51 -04:00
Lioncash
5484742fda core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrs 2018-10-15 14:15:56 -04:00
Lioncash
90f8474fc1 svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo()
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.
2018-10-14 20:11:16 -04:00
bunnei
2f8ca32020
Merge pull request #1492 from lioncash/proc
svc: Implement svcGetProcessInfo
2018-10-14 14:37:58 -04:00
David Marcec
92fae7e1ab Stop all threads on svcBreak
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)
2018-10-14 18:14:51 +11:00
Lioncash
1c7a7ed79b svc: Implement svcGetProcessInfo
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.
2018-10-13 17:00:43 -04:00
bunnei
ffcda6c08e
Merge pull request #1481 from lioncash/typo
svc: Fix typos in sanitizing checks for MapMemory/UnmapMemory
2018-10-12 20:46:55 -04:00
bunnei
2946d4bdbe
Merge pull request #1467 from ogniK5377/svcbreak-type-fix
Fixed incorrect types for svcBreak
2018-10-12 12:08:08 -04:00
Lioncash
4ccf30dfaa svc: Fix typos in sanitizing checks for MapMemory/UnmapMemory 2018-10-12 01:48:26 -04:00
Lioncash
72e9cb523e svc: Add missing address range sanitizing checks to MapMemory/UnmapMemory
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.
2018-10-10 20:30:49 -04:00
Lioncash
5c0408596f kernel/thread: Use a regular pointer for the owner/current process
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).
2018-10-10 02:04:55 -04:00
David Marcec
09b6dda8f0 Use a better name than "dont_kill_application"
signal_debugger seems like a more fitting name
2018-10-10 12:27:44 +11:00
David Marcec
a4412c8e22 Fixed incorrect types for svcBreak
svcBreak reason should be a u32, not a u64.
2018-10-10 12:23:50 +11:00
David Marcec
f5631e78d1 Added bitfield instead of manually checking if the bit is set 2018-10-09 12:11:14 +11:00
David Marcec
af3ba94b2a Actual kill execution when the bit isn't set, not the other way around 2018-10-09 11:14:48 +11:00
David Marcec
c50f66a8eb svcBreak, Signalling to the debugger should not kill execution
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.
2018-10-09 11:10:30 +11:00
Lioncash
baed7e1fba kernel/thread: Make all instance variables private
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-04 00:14:15 -04:00
Lioncash
541c550753 kernel/svc: Implement svcGetThreadContext()
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-30 05:29:40 -04:00
Lioncash
cf9d6c6f52 kernel/process: Make data member variables private
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-30 02:30:01 -04:00
bunnei
f7b69d61f2
Merge pull request #1395 from lioncash/vm
process/vm_manager: Initial modifications to load NPDM metadata
2018-09-29 10:54:39 -04:00
bunnei
b67c1fdf38
Merge pull request #1393 from tech4me/svc
svc: Updated svc names
2018-09-25 10:47:12 -04:00
Lioncash
83377113bf memory: Dehardcode the use of fixed memory range constants
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.
2018-09-24 22:16:03 -04:00
Lioncash
6c6f95d071 svc: Report correct memory-related values within some of the cases in svcGetInfo()
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.
2018-09-24 22:16:03 -04:00
tech4me
d42424ace0 svc: Updated svc names 2018-09-23 17:03:38 -07:00
Lioncash
48b2eda492 svc: Move most process termination code to its own function within Process
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.
2018-09-21 06:07:41 -04:00
Lioncash
b6867602ca kernel/svc: Handle error cases for svcArbitrateLock() and svcArbitrateUnlock()
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.
2018-09-17 23:27:53 -04:00
bunnei
e6367ab955
Merge pull request #1315 from lioncash/size
kernel/svc: Handle a few error cases within memory-related functions
2018-09-17 10:11:26 -04:00
bunnei
e561afdcd5
Merge pull request #1328 from FearlessTobi/port-4192
Port #4192 from Citra: "svc: change unknown to thread in CreateThread"
2018-09-17 09:56:48 -04:00
Valentin Vanelslande
54ddb37b3c Port # #4192 from Citra: "svc: change unknown to thread in CreateThread" 2018-09-15 15:28:35 +02:00
fearlessTobi
63c2e32e20 Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
Lioncash
4f8756edd0 kernel/svc: Sanitize creation of shared memory via svcCreateSharedMemory()
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".
2018-09-13 23:07:27 -04:00
Lioncash
accd1f17e4 kernel/svc: Sanitize addresses, permissions, and sizes within svcMapSharedMemory() and svcUnmapSharedMemory()
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.
2018-09-13 23:07:23 -04:00
Lioncash
496c67fd73 kernel/svc: Sanitize addresses and sizes within svcMapMemory() and svcUnmapMemory()
The kernel checks if the addresses and given size is 4KB aligned before
continuing onwards to map the memory.
2018-09-13 21:34:54 -04:00
Lioncash
7bd2faad9a kernel/svc: Sanitize heap sizes within svcSetHeapSize()
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.
2018-09-13 21:34:48 -04:00
bunnei
79217f9870
Merge pull request #1303 from lioncash/error
kernel/errors: Amend invalid thread priority and invalid processor ID error codes
2018-09-12 12:14:51 -04:00
Lioncash
fbe462099b svc: Return ERR_INVALID_PROCESSOR_ID in CreateThread() if an invalid processor ID is given
This is what the kernel does for an out-of-range processor ID.
2018-09-12 05:20:02 -04:00
Lioncash
3c5c292592 kernel/errors: Correct error codes for invalid thread priority and invalid processor ID 2018-09-12 05:19:57 -04:00
Lioncash
9b3bc0b282 svc: Do nothing if svcOutputDebugString() is given a length of zero
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.
2018-09-12 04:51:44 -04:00
Lioncash
04d723baf9 svc: Correct parameter type for OutputDebugString()
This should be a u64 to represent size.
2018-09-12 04:49:11 -04:00
Lioncash
1242c1ec0a service: Migrate global named port map to the KernelCore class
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.
2018-09-02 12:35:30 -04:00
Lioncash
4a587b81b2 core/core: Replace includes with forward declarations where applicable
The follow-up to e2457418da, 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.
2018-08-31 16:30:14 -04:00
Lioncash
0cbcd6ec9a kernel: Eliminate kernel global state
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.
2018-08-28 22:31:51 -04:00
Lioncash
e81354ae38 svc: Return process title ID if queried in GetInfo()
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.
2018-08-25 05:02:28 -04:00
Lioncash
25d71454d1 kernel/svc: Log svcBreak parameters
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.
2018-08-14 20:54:05 -04:00
bunnei
fecffeb0dd
Merge pull request #1043 from Subv/timing
Use an approximated amortized amount of ticks when advancing timing.
2018-08-12 22:31:55 -04:00
Subv
a9877c8f65 Kernel/SVC: Don't reschedule the current core when creating a new thread.
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.
2018-08-12 20:38:37 -05:00
Subv
5224cc49c4 Kernel/Mutex: Don't duplicate threads in the mutex waiter list.
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.
2018-08-12 16:35:27 -05:00
Lioncash
c4e0c3d76c kernel/vm_manager: Use const where applicable
Makes our immutable state explicit.
2018-08-02 12:21:46 -04:00
bunnei
ff2c1b0a94
Merge pull request #877 from lioncash/remove
kernel: Remove unused object_address_table.cpp/.h
2018-07-31 20:11:39 -07:00
Lioncash
369f6e58aa kernel: Remove unused object_address_table.cpp/.h
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.
2018-07-31 11:03:08 -04:00
Lioncash
a2304fad16 kernel: Remove unnecessary includes
Removes unnecessary direct dependencies in some headers and also gets
rid of indirect dependencies that were being relied on to be included.
2018-07-31 10:15:17 -04:00
Mat M
d3fd0351a7
Merge pull request #804 from lioncash/log
svc: Log parameters in SetMemoryAttribute()
2018-07-25 14:43:24 -04:00
Lioncash
c73410bf2c svc: Resolve sign comparison warnings in WaitSynchronization()
The loop's induction variable was signed, but we were comparing against
an unsigned variable.
2018-07-24 09:55:17 -04:00
Lioncash
8e8e906432 svc: Log parameters in SetMemoryAttribute()
Provides slightly more context than only logging out the address value.
2018-07-24 09:46:46 -04:00
Subv
7841447cf0 Kernel/SVC: Perform atomic accesses in SignalProcessWideKey as per the real kernel. 2018-07-22 12:27:24 -05:00
Lioncash
dbfe82773d thread: Convert ThreadStatus into an enum class
Makes the thread status strongly typed, so implicit conversions can't
happen. It also makes it easier to catch mistakes at compile time.
2018-07-19 22:08:56 -04:00
Lioncash
b879fb84a2 svc: Correct always true assertion case in SetThreadCoreMask
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.
2018-07-19 15:46:17 -04:00
James Rowe
0d46f0df12 Update clang format 2018-07-02 21:45:47 -04:00
James Rowe
638956aa81 Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
Michael Scire
067ac434ba Kernel/Arbiters: Fix casts, cleanup comments/magic numbers 2018-06-22 00:47:59 -06:00
Michael Scire
5f8aa02584 Add additional missing format. 2018-06-21 21:09:51 -06:00
Michael Scire
8f8fe62a19 Kernel/Arbiters: Initialize arb_wait_address in thread struct. 2018-06-21 05:13:06 -06:00
Michael Scire
4f81bc4e1b Kernel/Arbiters: Mostly implement SignalToAddress 2018-06-21 04:10:11 -06:00
Michael Scire
7e191dccc1 Kernel/Arbiters: Add stubs for 4.x SignalToAddress/WaitForAddres SVCs. 2018-06-21 00:49:43 -06:00
Subv
a3d82ef5d9 Build: Fixed some MSVC warnings in various parts of the code. 2018-06-20 11:39:10 -05:00
bunnei
4ac4b308e4
Merge pull request #572 from Armada651/user-except-stub
svc: Add a stub for UserExceptionContextAddr.
2018-06-18 11:37:13 -04:00
Jules Blok
bf4e2b2f0b svc: Add a stub for UserExceptionContextAddr. 2018-06-18 09:29:11 +02:00
Subv
3957b0c34e Kernel/SVC: Support special core values -2 and -3 in svcSetThreadCoreMask.
Also added some proper error handling.
2018-05-30 21:36:29 -05:00
Subv
2a35a36251 Kernel/SVC: Signal the highest priority threads first in svcSignalProcessWideKey. 2018-05-19 16:58:30 -05:00
Subv
c74f2555b6 Kernel/Threads: Reschedule the proper core when operating on that core's threads. 2018-05-19 16:57:44 -05:00
Subv
fab3dd98fe SVC: Removed unused WaitSynchronization1 function 2018-05-19 16:56:33 -05:00
bunnei
46ec9a9bc9 thread: Rename mask to affinity_masks. 2018-05-10 19:34:53 -04:00
bunnei
8aa5d25f82 threading: Reschedule only on cores that are necessary. 2018-05-10 19:34:52 -04:00
bunnei
d6e3cd9a17 svc: Implement GetThreadCoreMask and SetThreadCoreMask. 2018-05-10 19:34:51 -04:00
bunnei
1c36f2a798 svc: SignalProcessWideKey should apply to all cores. 2018-05-10 19:34:49 -04:00
bunnei
6a890023e9 svc: Implement GetCurrentProcessorNumber. 2018-05-10 19:34:49 -04:00
bunnei
a434fdcb10 core: Implement multicore support. 2018-05-10 19:34:46 -04:00
Lioncash
7c9644646f
general: Make formatting of logged hex values more straightforward
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).
2018-05-02 09:49:36 -04:00
Lioncash
3abba08080
string_util: Remove StringFromFormat() and related functions
Given we utilize fmt, we don't need to provide our own functions for formatting anymore
2018-04-29 18:52:33 -04:00
Lioncash
8475496630
general: Convert assertion macros over to be fmt-compatible 2018-04-27 10:04:02 -04:00
Lioncash
40dee76c57
kernel: Migrate logging macros to fmt-compatible ones 2018-04-25 20:32:09 -04:00
bunnei
0214351f4f
Merge pull request #370 from Subv/sync_primitives
Kernel: Reworked the new kernel synchronization primitives.
2018-04-23 16:33:00 -04:00
Subv
46572d027d Kernel: Implemented mutex priority inheritance.
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.
2018-04-23 11:23:44 -05:00
Subv
be155f4d9d Kernel: Remove unused ConditionVariable class. 2018-04-20 21:04:33 -05:00
Subv
b18ccf9399 Kernel: Properly implemented svcWaitProcessWideKey and svcSignalProcessWideKey
They work in tandem with guest code to provide synchronization primitives along with svcArbitrateLock/Unlock
2018-04-20 21:04:27 -05:00
Subv
e81a2080eb Kernel: Corrected the implementation of svcArbitrateLock and svcArbitrateUnlock.
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.
2018-04-20 21:04:25 -05:00
Lioncash
bec05db746 resource_limit: Make ResourceTypes an enum class
Prevents enum identifiers from leaking into the surrounding scope.
2018-04-20 19:41:45 -04:00
Lioncash
d9e316e353 common_funcs: Remove ARRAY_SIZE macro
C++17 has non-member size() which we can just call where necessary.
2018-04-19 22:36:52 -04:00
Hexagon12
e52a87b98a Various service name fixes - part 2 (rebased) (#322)
* 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
2018-04-17 11:37:43 -04:00
bunnei
40bccd74d3 svc: Stub out SetThreadActivity, GetThreadContext. 2018-04-02 23:51:01 -04:00
bunnei
f6893969b3 svc: Stub GetThreadCoreMask. 2018-03-29 21:23:15 -04:00
N00byKing
0e72d0d826 More Warning cleanups 2018-03-19 17:27:04 +01:00
N00byKing
ef875d6a35 Clean Warnings (?) 2018-03-19 17:07:08 +01:00
bunnei
34a29ad051 svc: Use more correct values for GetInfo MapRegion and NewMapRegion. 2018-03-16 18:32:23 -04:00
bunnei
8be7131033 MemoryState: Add additional memory states and improve naming. 2018-03-16 18:32:21 -04:00
bunnei
7d6653268f core: Move process creation out of global state. 2018-03-14 18:42:19 -04:00
bunnei
f1beb69899
Merge pull request #215 from N00byKing/umapsharedmmry
UnmapSharedMemory
2018-02-25 21:04:24 -08:00
N00byKing
08c6ac02cf
(Hopefully) Fix MinGW Build 2018-02-25 13:40:22 +01:00
N00byKing
2b41c6e573 Add UnmapSharedMemory
C++11 requires spaces on the Identifier

Add inttypes include

clang
2018-02-25 11:38:06 +01:00
mailwl
e4f94ee30b Stub more functions 2018-02-22 17:28:15 +03:00
bunnei
ac81c02ed9 kernel: Use Scheduler class for threading. 2018-02-18 15:17:16 -05:00
bunnei
42fc437268 GetInfo: Implement IsCurrentProcessBeingDebugged. 2018-02-04 12:34:45 -05:00
bunnei
0b6b147939 WaitProcessWideKeyAtomic: Handle case where condition variable was already created. 2018-02-04 12:30:51 -05:00
bunnei
647364db8f svc: SharedMemory size should be 64-bits and cleanup. 2018-02-03 13:36:54 -05:00
bunnei
f9c9ce2005 ArbitrateLock: Assert that requesting_thread is current_thread. 2018-02-03 13:29:18 -05:00
bunnei
67758857e4 hle: Remove Domain and SyncObject kernel objects. 2018-01-24 22:18:54 -05:00
James Rowe
096be16636 Format: Run the new clang format on everything 2018-01-20 16:45:11 -07:00
David
0b6da0c1ab Added CreateSharedMemory & UNIMPLEMENTED() for non existent services. (#113)
* Added svcCreateSharedMemory

* Services which are not implemented now throw UNIMPLEMENTED()

* clang-format

* changed perms to u32

* removed camelcase
2018-01-19 19:35:25 -05:00
bunnei
e1ee8f4657 svc: Fix svcGetInfo MapRegionBaseAddr. 2018-01-18 23:44:15 -05:00
Lioncash
4497eb4528 svc: Rename some entries to match their analogue on SwitchBrew
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.
2018-01-17 20:38:23 -05:00
Lioncash
c81ed5eb33 svc: Add CreateJitMemory and MapJitMemory svc strings
Makes the table match SwitchBrew for these entries
2018-01-17 20:32:56 -05:00
bunnei
7fa32af1c7 svc: Clang-format fix. 2018-01-17 12:19:17 -05:00
Subv
bf0e20c571 SVC: Correct some return values in svcGetInfo and added TitleId and PrivilegedProcessId stubs.
# Conflicts:
#	src/core/hle/kernel/svc.cpp
2018-01-16 18:50:23 -05:00
bunnei
1aa4cdc3c8
Merge pull request #52 from ogniK5377/fsp
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
2018-01-16 18:27:48 -05:00
David Marcec
bb7221c5d5 SetThreadCoreMask stub, time to implement fsp 2018-01-16 14:23:53 -08:00
David Marcec
68143af636 Added more svcGetInfo pairs 2018-01-16 14:06:45 -08:00
MerryMage
e35644c005 clang-format 2018-01-16 18:05:21 +00:00
bunnei
974362bc12 svc: Implement svcMapSharedMemory. 2018-01-14 17:20:55 -05:00
bunnei
1247c53786 yuzu: Update license text to be consistent across project. 2018-01-13 16:22:39 -05:00
bunnei
056f987bcd core: Include <algorithm> where used. 2018-01-11 22:36:56 -05:00
bunnei
97ef21e166 svc: Implement GetSystemTick. 2018-01-11 21:59:31 -05:00
Subv
ba02f0deef svc: Stub ResetSignal and CreateTransferMemory 2018-01-10 23:27:59 -05:00
Subv
0a1278081e svc: Stub SetMemoryAttribute 2018-01-10 23:27:56 -05:00
Subv
7ad20154fc Threads: Added enum values for the Switch's 4 cpu cores and implemented svcGetInfo(AllowedCpuIdBitmask) 2018-01-10 01:01:55 -05:00
Subv
c2ee513d35 SVC: Fixed WaitSynchronization with multiple handles when none is immediately ready. 2018-01-09 15:02:43 -05:00
Subv
bc91ebacc1 SVC: Implemented CancelSynchronization. 2018-01-09 15:02:04 -05:00
Subv
8d9250fa70 SVC: Fixed WaitSynchronization with multiple handles when at least one of them is ready. 2018-01-09 11:53:50 -05:00
bunnei
4236799832 kernel: Rename Semaphore to ConditionVariable. 2018-01-08 21:41:37 -05:00
Subv
db3a525166 Kernel: Actually wake up the requested number of threads in Semaphore::Release.
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.
2018-01-08 21:12:54 -05:00
Subv
1bbe9309da Kernel: Properly keep track of mutex lock data in the guest memory. This fixes userland locking/unlocking. 2018-01-08 21:12:51 -05:00
Subv
2a3f8e8484 Kernel: Allow chaining WaitSynchronization calls inside a wakeup callback. 2018-01-08 21:12:49 -05:00
bunnei
bc8ef64804 svc: Implement svcSignalProcessWideKey. 2018-01-07 16:55:17 -05:00
bunnei
5017038ca7 svc: Implement svcWaitProcessWideKeyAtomic. 2018-01-06 16:14:12 -05:00
bunnei
0e978bdd50 svc: Implement WaitSynchronization for a single handle. 2018-01-06 14:34:32 -05:00
bunnei
57f42e5887 svc: Refactor LockMutex code to use WaitSynchronization1. 2018-01-06 14:19:28 -05:00
bunnei
0dbc8f3577 svc: Add missing string_util include. 2018-01-04 19:45:15 -05:00
bunnei
b172f0d770 arm: Remove SkyEye/Dyncom code that is ARMv6-only. 2018-01-02 22:24:12 -05:00
bunnei
81a8a57ce2 svc: Remove unnecessary "svc" prefix to naming scheme. 2018-01-02 20:47:26 -05:00
bunnei
480906fe1b hle: Move SVC code to kernel namespace. 2018-01-02 20:40:30 -05:00