David Marcec
2097ef79e3
Made svcSetHeapSize and svcCreateSharedMemory more readable
7 years ago
David Marcec
67518a57b9
Reworked svcs slightly, improved error messages in AM and fsp_srv
7 years ago
David Marcec
224dcaf1a5
Improved error messages for SVCs
7 years ago
David Marcec
5ae0d6cba2
Changed logging to be "Log before execution", Added more error logging, all services should now log on some level
7 years ago
Luke Street
7d5b774d8a
svc: Return ERR_INVALID_ENUM_VALUE from svcGetInfo
7 years ago
Zach Hilman
1a72e1681c
scheduler: Add explanations for YieldWith and WithoutLoadBalancing
7 years ago
Lioncash
f1a863e583
kernel/handle_table: Move private static functions into the cpp file
These don't depend on class state, and are effectively implementation
details, so they can go into the cpp file .
7 years ago
Lioncash
6fac9e5b31
kernel/handle_table: Restrict handle table size to 1024 entries
The previous handle table size is a holdover from Citra. The actual
handle table construct on Horizon only allows for a maximum of 1024
entries.
7 years ago
Lioncash
6c9a6a08ee
kernel/handle_table: Default destructor in the cpp file
We don't need to potentially inline the teardown logic of all of the
handle instances.
7 years ago
Lioncash
7bdf580058
kernel/process: Move <random> include to the cpp file
<random> isn't necesary directly within the header and can be placed in
the cpp file where its needed. Avoids propagating random generation
utilities via a header file.
7 years ago
Lioncash
fa7a76d1e0
kernel/resource_limit: Clean up interface
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.
7 years ago
Lioncash
0067bc137f
kernel/shared_memory: Make Map() and Unmap() take the target process by reference rather than as a pointer
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.
7 years ago
Lioncash
a356495312
kernel/shared_memory: Add a const qualified member function overload for GetPointer()
Given this doesn't mutate instance state, we can provide a
const-qualified variant as well.
7 years ago
Lioncash
ee329d2bdf
kernel/shared_memory: Use 64-bit types for offset and size in CreateForApplet
Keeps the interface consistent with the regular Create() function.
7 years ago
Lioncash
5833b84689
kernel/shared_memory: Make GetPointer() take a std::size_t instead of a u32
Makes the interface nicer to use in terms of 64-bit code, as it makes it
less likely for one to get truncation warnings (and also makes sense in
the context of the rest of the interface where 64-bit types are used for
sizes and offsets
7 years ago
Lioncash
d997cf19e0
kernel/shared_memory: Make data members private
Rather than allow unfettered access to the class internals, we hide all
members by default and create and API that other code can operate
against.
7 years ago
Zach Hilman
b1c19bc88f
svc: Implement yield types 0 and -1
7 years ago
Tobias
66be135276
svc: ResetSignal is not stubbed
https://user-images.githubusercontent.com/20753089/48677874-b8e01c80-eb7b-11e8-8043-b99faa29022c.PNG
7 years ago
Zach Hilman
efced53d38
am: Deglobalize software keyboard applet
7 years ago
Zach Hilman
87de78ce16
svc: Implement svcCreateTransferMemory
Seems to be used and created identically to SharedMemory, so just reuse that.
7 years ago
Zach Hilman
f46fd39579
ldr_ro: Add error check for memory allocation failure
7 years ago
Lioncash
99cdc2b5d1
kernel/errors: Clean up error codes
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.
7 years ago
Zach Hilman
d8ce48b5ea
process: Make MirrorMemory take state to map new memory as
Credits to Subv
7 years ago
Lioncash
992e814e2c
kernel/thread: Deduplicate scheduler switching code
The code in both places was the same verbatim, so we can extract it to a
function to deduplicate the logic.
7 years ago
Lioncash
a61ed2279c
vm_manager: Unstub GetTotalHeapUsage()
Now that we've moved all of the heap-related stuff to the VMManager
class, we can unstub this function, as the necessary members are visible
now.
7 years ago
Lioncash
1de14301c3
kernel/process: Migrate heap-related memory management out of the process class and into the vm manager
Avoids a breach of responsibilities in the interface and keeps the
direct code for memory management within the VMManager class.
7 years ago
Zach Hilman
deb5d6be60
svc: Use proper random entropy generation algorithm
7 years ago
Zach Hilman
4c0e453e08
svc: Return random seed for svcGetInfo RandomEntropy
7 years ago
David
b2a5c2529a
svcBreak now dumps information from the debug buffer passed ( #1646 )
* 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
7 years ago
Frederic Laing
a1139837f9
Implement SetMemoryPermission
7 years ago
Frederic Laing
2998453673
Stubbed SetMemoryPermission
7 years ago
Lioncash
70e4492d49
general: Remove unused boost inclusions where applicable
Cleans up unused includes and trims off some dependencies on externals.
7 years ago
Frederic L
c76f4b6aec
global: Use std::optional instead of boost::optional ( #1578 )
* get rid of boost::optional
* Remove optional references
* Use std::reference_wrapper for optional references
* Fix clang format
* Fix clang format part 2
* Adressed feedback
* Fix clang format and MacOS build
7 years ago
Lioncash
6f2cb1a437
hle_ipc: Add member function for querying the existence of a domain header
Gets rid of the need to call the getter and then check for null.
7 years ago
Lioncash
abf974f2f5
hle_ipc: Make GetDomainMessageHeader return a regular pointer
Nothing requires the shared owner ship here, so we can just return a
plain pointer.
7 years ago
Lioncash
55233bbdd2
core: Make System references const where applicable
7 years ago
Lioncash
2aa6e317d6
svc: Localize the GetInfo enum class to the function itself
Nothing from this enum is intended to be used outside of this function.
7 years ago
Lioncash
9bb7bc911f
svc: Implement svcGetInfo command 0xF0000002
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;
}
7 years ago
bunnei
bdb2835028
process: LoadModule should clear JIT instruction cache.
7 years ago
bunnei
59b8f91cb2
Kernel/Memory: Added a function to first a suitable guest address at which to allocate a region of a given size.
7 years ago
Lioncash
dd17fc6213
kernel/errors: Remove now-unused, unnecessary, error codes
Now that we've gotten the innaccurate error codes out of the way, we can
finally toss away a bunch of these, trimming down the error codes to
ones that are actually used and knocking out two TODO comments.
7 years ago
Lioncash
815d526a6a
kernel/shared_memory: Return ERR_INVALID_MEMORY_PERMISSIONS instead of ERR_INVALID_COMBINATION
This is more consistent with what the kernel does.
7 years ago
Lioncash
2438be15a9
kernel/server_port: Simplify emptiness check within ShouldWait()
7 years ago
Lioncash
1bec1b6e99
kernel/server_port: Change error case return value in Accept() to ERR_NOT_FOUND
This is what the kernel does in this instance.
7 years ago
Lioncash
1206987215
kernel/error: Remove leftover 3DS error codes
These are now entirely unused and can be removed.
7 years ago
Lioncash
fc5b2b9f14
kernel/svc: Amend returned error code for invalid priorities in CreateThread
Like with the previous change, the kernel doesn't return NOT_AUTHORIZED
here. It returns INVALID_THREAD_PRIORITY.
7 years ago
Lioncash
e71849e099
kernel/svc: Move and correct returned error code for invalid thread priorities in SetThreadPriority()
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.
7 years ago
Lioncash
ad85a2da06
kernel/error: Add error code for invalid pointers
The kernel appears to return 0xE601 for this situation. Particularly in
svcWaitSynchronization, svcReplyAndReceive, and svcGetThreadContext
7 years ago
Lioncash
7748fd0e43
kernel/error: Add error code for closed sessions
The kernel appears to return 0xF601 for this case.
7 years ago
David Marcec
1b21fca8d6
Added assertion failed, reworked logging levels
7 years ago