| Commit message (Collapse) | Author | Files | Lines |
|
Turns out this function is actually used, but within a trace log.
|
|
This is now completely unused, so it can be removed.
|
|
Removes more instances of reliance on global state.
|
|
This implements: Socket, Poll, Accept, Bind, Connect, GetPeerName,
GetSockName, Listen, Fcntl, SetSockOpt, Shutdown, Recv, RecvFrom,
Send, SendTo, Write, and Close
The implementation was done referencing: SwIPC, switchbrew, testing
with libnx and inspecting its code, general information about bsd
sockets online, and analysing official software.
Not everything from these service calls is implemented, but everything
that is not implemented will be logged in some way.
|
|
|
|
* kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects.
- See https://github.com/citra-emu/citra/pull/4710 for details.
|
|
Ports BCAT to use FSC interface
|
|
Allows centralized control over logging mechanisms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Trims out the lingering reliance on global state out of the audio code.
|
|
|
|
|
|
Allows games to log data to the SD.
|
|
Returns the process ID of the current application or 0 if no app is running.
|
|
This PR attempts to implement the shared memory provided by GetSharedMemoryNativeHandle. There is still more work to be done however that requires a rehaul of the current time module to handle clock contexts. This PR is mainly to get the basic functionality of the SharedMemory working and allow the use of addition to it whilst things get improved on.
Things to note:
Memory Barriers are used in the SharedMemory and a better solution would need to be done to implement this. Currently in this PR I’m faking the memory barriers as everything is sync and single threaded. They work by incrementing the counter and just populate the two data slots. On data reading, it will read the last added data.
Specific values in the shared memory would need to be updated periodically. This isn't included in this PR since we don't actively do this yet. In a later PR when time is refactored this should be done.
Finally, as we don't handle clock contexts. When time is refactored, we will need to update the shared memory for specific contexts. This PR does this already however since the contexts are all identical and not separated. We're just updating the same values for each context which in this case is empty.
Tiime:SetStandardUserSystemClockAutomaticCorrectionEnabled, Time:IsStandardUserSystemClockAutomaticCorrectionEnabled are also partially implemented in this PR. The reason the implementation is partial is because once again, a lack of clock contexts. This will be improved on in a future PR.
This PR closes issue #2556
|
|
Avoids using system accessor to get current process in applet code.
|
|
These keep track of running process' launch properties and control properties and allows for issuing and reading them by process and title ID.
|
|
|
|
|
|
Relocates the error code to where it's most related, similar to how all
the other error codes are. Previously we were including a non-generic
error in the main result code header.
|
|
These can just be passed regularly, now that we use fmt instead of our
old logging system.
While we're at it, make the parameters to MakeFunctionString
std::string_views.
|
|
Gets rid of the largest set of mutable global state within the core.
This also paves a way for eliminating usages of GetInstance() on the
System class as a follow-up.
Note that no behavioral changes have been made, and this simply extracts
the functionality into a class. This also has the benefit of making
dependencies on the core timing functionality explicit within the
relevant interfaces.
|
|
Services created with the ServiceFramework base class install themselves as HleHandlers with an owning shared_ptr in the ServerPort ServiceFrameworkBase::port member variable, creating a cyclic ownership between ServiceFrameworkBase and the ServerPort, preventing deletion of the service objects.
Fix that by removing the ServiceFrameworkBase::port member because that was only used to detect multiple attempts at installing a port. Instead store a flag if the port was already installed to achieve the same functionality.
|
|
Combines the two into one, shortening the amount of code here.
|
|
Only one usage of the specified objects made use of the lack of
namespacing. Given the low usage, we can just remove these.
|
|
These auto-deduce the result based off its arguments, so there's no need
to do that work for the compiler, plus, the function return value itself
already indicates what we're returning.
|
|
Gets rid of the need to keep the variables separate from their actual
initialization spots.
|
|
When yuzu is compiled in release mode this function is unused, however,
when compiled in debug mode, it's used within a LOG_TRACE statement.
This prevents erroneous compilation warnings about an unused function
(that isn't actually totally unused).
|
|
|
|
Seems to be the power controller. Listed in switchbrew under the category PTM services.
|
|
Neither of these functions alter the ownership of the provided pointer,
so we can simply make the parameters a reference rather than a direct
shared pointer alias. This way we also disallow passing incorrect memory values like
nullptr.
|
|
|
|
|
|
With the named port functionality all migrated over to the kernel,
there's no need to keep this around anymore.
|
|
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.
|
|
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.
|
|
|
|
Rather than use global state, we can simply pass the instance into the
NVFlinger instance directly.
|
|
Adds basic skeleton for the usb services based off the information provided by Switch Brew.
|
|
Adds the basic skeleton of the arp services based off the information
provided by Switch Brew.
|
|
Adds the basic skeleton for the mig:usr service based off information
provided by Switch Brew.
|
|
Adds the basic skeleton for the psc services based off the information
provided by Switch Brew.
|
|
Adds the basic skeleton for the capture services based off information
provided by Switch Brew.
|
|
Adds the basic skeleton for the remaining pcv-related services based off
information on Switch Brew.
|
|
Adds the basic skeleton for the fgm services based off the information
provided by Switch Brew.
|
|
Adds the basic skeleton of the pcie service based off information on
Switch Brew.
|
|
Adds the basic skeleton for the wlan services based off the information
on Switch Brew.
|
|
Adds the skeleton for the btm services based off the information on
Switch Brew.
|
|
Adds the basic skeleton for the ncm services based off information on
Switch Brew.
|
|
Adds the skeleton for the mii services based off information provided by
Switch Brew
|
|
Adds the skeleton of the nfc service based off the information provided
on Switch Brew.
|
|
Adds the skeleton of the lbl service based off the information provided
by Switch Brew.
|
|
Adds the skeleton for the btdrv service based off the information provided by Switch Brew
|
|
Adds the basic skeleton for the grc:c service based off the information
provided by Switch Brew.
|
|
Adds the skeleton for the nim services based off information from Switch
Brew.
|
|
Adds ldn services based off information provided by Switch Brew.
|
|
Adds the skeleton for the ldr-related services based off the information
provided on Switch Brew.
|
|
Adds the skeleton for the eupld services based off information on Switch
Brew.
|
|
Adds the basic skeleton of the erpt service based off information on
Switch Brew.
|
|
Adds the skeleton for the process management services based off
information on Switch Brew.
|
|
Adds the skeleton for the ETicket service based off the information on
Switch Brew
|
|
|
|
|
|
|
|
|
|
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).
|
|
Given we utilize fmt, we don't need to provide our own functions for formatting anymore
|
|
|
|
PCTL::CreateServiceWithoutInitialize and IParentalControlService::Initialize, required by Kirby Star Allies
|
|
|
|
|
|
|
|
Converts the service manager from a global into an instance-based
variable.
|
|
Versions prior to this didn't compile on OpenBSD due to unconditional
use of the non-standard strtod_l() function.
The fmt::MemoryWriter API has been removed in the intervening
versions, so replace its use with fmt::memory_buffer and fmt::format_to.
The library also no longer provides the fmt::fmt ALIAS, so define
it in externals/CMakeLists.txt.
|
|
service: Initialize NFP service.
Log: Add NFP service as a log subtype.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It'll be needed when we implement CreateManagedDisplayLayer.
|
|
It is now created during Service initialization and passed to all the services that need it.
|
|
|
|
* Stubs for various acc:u0 funcs needed
* Stub for GetDesiredLanguage in IApplicationFunctions
* Add set service + stubs needed for games
* Fix formatting
* Implement IProfile, IManagerForApplication, return bool in CheckAvailability, style fixes
* Remove IProfile::Get(needs more research), fix IPC response sizes
|
|
* bsd: start stubbing bsd:u and sfdnsres
* bsd: stubbed RegisterClient
* bsd: attempt to get past socket()
* bsd: fix some wrong assumptions about IPC
* bsd: fix format specifiers
* bsd: stubbed Connect()
* bsd: stubbed SendTo()
* made requested changes
* sockets: respect alphabetical order at service installation
* run clang-format
* bsd: start stubbing bsd:u and sfdnsres
* bsd: stubbed RegisterClient
* bsd: attempt to get past socket()
* bsd: fix some wrong assumptions about IPC
* bsd: fix format specifiers
* bsd: stubbed Connect()
* bsd: stubbed SendTo()
* made requested changes
* sockets: respect alphabetical order at service installation
* run clang-format
* run clang-format (2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The homebrew display test application now properly writes graphics data to the graphics buffer but we still don't have a way to compose the display layers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Replace it with std::move(result_val).Unwrap(), or Foo().Unwrap() in
case you already have an rvalue.
|
|
|
|
|
|
Copy the IPC command buffer to/from the request context before/after the
handler is invoked. This is part of a move away from using global data
for handling IPC requests.
|
|
|
|
|
|
The old "Interface" class had a few problems such as using free
functions (Which didn't allow you to write the service handler as if it
were a regular class.) which weren't very extensible. (Only received one
parameter with a pointer to the Interface object.)
The new ServiceFramework aims to solve these problems by working with
member functions and passing a generic context struct as parameter. This
struct can be extended in the future without having to update all
existing service implementations.
|
|
This has a huge fallout in terms of needing to fix other files because
all service implementations included that file.
|
|
Also enhances the GetServiceHandle implementation to be more accurate.
|
|
This will contain the implementation of the sm (Service Manager) system
module.
|
|
This allows attaching a HLE handle to a ServerPort at any point after it
is created, allowing port/session creation to be generic between HLE and
regular services.
|
|
Most of the code that works with this is or will be in the kernel, so
it's a more appropriate place for it to be.
|
|
Fix Fatal Error in Mini-Mario & Friends - amiibo Challenge
|
|
|
|
|
|
|
|
|
|
Previously there was a split where some of the services were in the
Service namespace and others were not.
|
|
|
|
|
|
Further implementation will happen in a future commit.
Fixes a regression.
|
|
|
|
Adds the two New3DS-only modules.
3dbrew was used for command information.
|
|
3dbrew was used for the command information.
|
|
HandleSyncRequest now takes care of calling the command buffer translate function before actually invoking the command handler for HLE services.
|
|
|
|
Sessions and Ports are now detached from each other.
HLE services are handled by means of a SessionRequestHandler class, Interface now inherits from this class.
The File and Directory classes are no longer kernel objects, but SessionRequestHandlers instead, bound to a ServerSession when requested.
File::OpenLinkFile now creates a new session pair and binds the File instance to it.
|
|
Pass the triggering ServerSession to the HLE command handler to differentiate which session caused the request.
|
|
Interface is now used by aggregation in ClientPort, to forward service commands to their HLE implementation if needed.
|
|
All handles obtained via srv::GetServiceHandle or svcConnectToPort are references to ClientSessions.
Service modules will wait on the counterpart of those ClientSessions (Called ServerSessions) using svcReplyAndReceive or svcWaitSynchronization[1|N], and will be awoken when a SyncRequest is performed.
HLE Interfaces are now ClientPorts which override the HandleSyncRequest virtual member function to perform command handling immediately.
|
|
|
|
This makes clang-format useful on those.
Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
|
|
|
|
|
|
Specifically, dlp::CLNT and dlp::FKCL
Moves them to their own folder like with other services.
|
|
* Update ACT_U
* Create act_a.h
* Create act_a.cpp
* Add service ACT:A
* Add ACT:A source and header
* Fix wrong header
|
|
|
|
|
|
SuspendDaemons , ResumeDaemons , OverrideDefaultDaemons
The NDM file move to /core/hle/service/ndm/ now!
|
|
Changes the log to use hex in the parameter list instead of decimal.
|
|
|
|
|
|
|
|
This reduces the time for a full recompile from 65.43s to 59.53s (~9%)
|
|
|
|
|
|
This coincidentally fixes an issue about the PTM service failing to create its SharedExtSaveData archive due to the FS service not being initialized by the time the creating code runs.
Ideally I'd like to move each process to its own folder, and have a single file per process that registers the service classes, which would be in their own files inside that folder. Then each service class would just call functions from the process to complete the commands.
|
|
err:f is a named port, not a service
|
|
|
|
Implemented FSUser::CreateExtSaveData
|
|
|
|
|
|
|
|
cfg:s, ptm:sysm, apt:s.
apt:s is almost exactly the same as apt:u as per 3dbrew
|
|
|
|
Fixes #423.
|
|
|
|
This handle manager more closely mirrors the behaviour of the CTR-OS
one. In addition object ref-counts and support for DuplicateHandle have
been added.
Note that support for DuplicateHandle is still experimental, since parts
of the kernel still use Handles internally, which will likely cause
troubles if two different handles to the same object are used to e.g.
wait on a synchronization primitive.
|
|
|
|
|
|
Moved most of the shared CFG code there, implemented a few CFG:I functions
|
|
|
|
|
|
|
|
|
|
I couldn't find any information about this service...
|
|
|
|
Apparently nothing at all is known about this service...
|
|
|
|
All service calls in the CTR OS return result codes indicating the
success or failure of the call. Previous to this commit, Citra's HLE
emulation of services and the kernel universally either ignored errors
or returned dummy -1 error codes.
This commit makes an initial effort to provide an infrastructure for
error reporting and propagation which can be use going forward to make
HLE calls accurately return errors as the original system. A few parts
of the code have been updated to use the new system where applicable.
One part of this effort is the definition of the `ResultCode` type,
which provides facilities for constructing and parsing error codes in
the structured format used by the CTR.
The `ResultVal` type builds on `ResultCode` by providing a container for
values returned by function that can report errors. It enforces that
correct error checking will be done on function returns by preventing
the use of the return value if the function returned an error code.
Currently this change is mostly internal since errors are still
suppressed on the ARM<->HLE border, as a temporary compatibility hack.
As functionality is implemented and tested this hack can be eventually
removed.
|
|
in the service's headers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FS: Added to CMakeLists.txt
|
|
|
|
|
|
|
|
- cleaned up Kernel code a bit (moved stuff into namespace, fixed whitespace issues)
- added handle types for all different CTROS handles
|
|
- various cleanups
|
|
|
|
|
|
- various cleanups/refactors to HLE services
|
|
|
|
- added function tables for service calls
- lots of refactoring
|
|
|
|
|
|
|
|
|
|
|
|
- added a manager for keeping track of services/ports
- added a memory mapped region for memory accessed by HLE
- added HLE for GetThreadCommandBuffer function
|