Commit graph

92 commits

Author SHA1 Message Date
Liam
1c3a93e7c4 service: refactor server architecture
Converts services to have their own processes
2023-02-21 12:19:25 -05:00
Liam
c68577384a general: rename CurrentProcess to ApplicationProcess 2023-02-13 19:03:12 -05:00
Liam
affd5c32f9 kernel/svc_types: refresh 2022-11-09 19:05:08 -05:00
Liam
2e56a382a9 kernel: invert session request handling flow 2022-10-31 17:44:06 -04:00
Morph
5c4c90385f ipc_helpers: Ignore GCC compiler warnings only on GCC
Clang and ICC for whatever reason also defines __GNUC__. Exclude them from this check.
2022-10-22 15:02:04 -04:00
Liam
c0ae56548e kernel: remove most SessionRequestManager handling from KServerSession 2022-10-19 16:31:12 -04:00
Liam
545875eaa1 k_server_session: preliminary support for userspace server sessions 2022-10-11 18:40:40 -04:00
Andrea Pappacoda
6a2efdda2f chore: make yuzu REUSE compliant
[REUSE] is a specification that aims at making file copyright
information consistent, so that it can be both human and machine
readable. It basically requires that all files have a header containing
copyright and licensing information. When this isn't possible, like
when dealing with binary assets, generated files or embedded third-party
dependencies, it is permitted to insert copyright information in the
`.reuse/dep5` file.

Oh, and it also requires that all the licenses used in the project are
present in the `LICENSES` folder, that's why the diff is so huge.
This can be done automatically with `reuse download --all`.

The `reuse` tool also contains a handy subcommand that analyzes the
project and tells whether or not the project is (still) compliant,
`reuse lint`.

Following REUSE has a few advantages over the current approach:

- Copyright information is easy to access for users / downstream
- Files like `dist/license.md` do not need to exist anymore, as
  `.reuse/dep5` is used instead
- `reuse lint` makes it easy to ensure that copyright information of
  files like binary assets / images is always accurate and up to date

To add copyright information of files that didn't have it I looked up
who committed what and when, for each file. As yuzu contributors do not
have to sign a CLA or similar I couldn't assume that copyright ownership
was of the "yuzu Emulator Project", so I used the name and/or email of
the commit author instead.

[REUSE]: https://reuse.software

Follow-up to b2eb103829
2022-07-27 12:53:49 +02:00
german77
c7890ebccc core: Replace all instances of ResultCode with Result 2022-06-26 20:21:37 -05:00
bunnei
8421193857 core: hle: kernel: Use weak_ptr where possible for SessionRequestHandler and SessionRequestManager. 2022-03-14 18:14:53 -07:00
Morph
4c1b4cc486 hle: ipc_helpers: Ignore -Wclass-memaccess
This warning is triggered by GCC when copying into non-trivially default constructible types, as it uses the more restrictive std::is_trivial (which includes std::is_trivially_default_constructible) to determine whether memcpy is safe instead of std::is_trivially_copyable.
2022-02-05 13:56:20 -05:00
Morph
52fa30ab7d service: Reduce header include overhead 2021-10-07 13:32:21 -04:00
bunnei
42957785f0 hle: hle_helpers: Skip data payload offset checks on TIPC requests.
- TIPC does not use this.
2021-06-24 18:39:43 -07:00
bunnei
14f50729e2 hle: kernel: hle_ipc: Simplify incoming/outgoing move/copy/domain objects. 2021-05-20 21:41:52 -07:00
bunnei
6e3c9d2b06 hle: kernel: Implement CloneCurrentObject and improve session management. 2021-05-20 21:41:49 -07:00
bunnei
7b1c7a5e6a Revert "WORKAROUND: temp. disable session resource limits while we work out issues"
This reverts commit 627eaf8c0e.
2021-05-20 21:40:30 -07:00
Lioncash
eeae5217ba core: Make variable shadowing a compile-time error
Now that we have most of core free of shadowing, we can enable the
warning as an error to catch anything that may be remaining and also
eliminate this class of logic bug entirely.
2021-05-16 03:43:16 -04:00
bunnei
006a51c86b hle: kernel: hle_ipc: Fix outgoing IPC response size calculation. 2021-05-11 12:27:43 -07:00
bunnei
627eaf8c0e WORKAROUND: temp. disable session resource limits while we work out issues 2021-05-11 10:51:39 -07:00
bunnei
a21dff4980 core: hle: ipc_helpers: Fix cast on raw_data_size calculation. 2021-05-10 20:34:38 -07:00
bunnei
66c7c7e5ab hle: ipc_helpers: Reserve session resource when we create a KSession. 2021-05-10 15:42:46 -07:00
bunnei
ae86003503 hle: ipc_helpers: Update IPC response generation for TIPC. 2021-05-10 15:05:10 -07:00
Lioncash
e019da0487 kernel: Eliminate variable shadowing
Now that the large kernel refactor is merged, we can eliminate the
remaining variable shadowing cases.
2021-05-08 12:33:26 -04:00
bunnei
796dddf78f hle: kernel: Remove deprecated Object class. 2021-05-05 16:40:52 -07:00
bunnei
d6844cf75f hle: kernel: Migrate KPort, KClientPort, and KServerPort to KAutoObject. 2021-05-05 16:40:52 -07:00
bunnei
9f1abd8188 hle: kernel: Migrate KClientPort to KAutoObject. 2021-05-05 16:40:52 -07:00
bunnei
83b96b7264 hle: kernel: Migrate KSession, KClientSession, and KServerSession to KAutoObject. 2021-05-05 16:40:51 -07:00
bunnei
6a42358706 hle: ipc_helpers: Add methods for copy/move references. 2021-05-05 16:40:51 -07:00
bunnei
8b224f05c9 hle: kernel: Refactor IPC interfaces to not use std::shared_ptr. 2021-05-05 16:40:50 -07:00
comex
63994da5c3 hle: Type check ResponseBuilder::Push arguments, and fix use in vi.cpp
- Add a type check so that calling Push with an invalid type produces a
  compile error rather than a linker error.

- vi.cpp was calling Push with a variable of type `std::size_t`.
  There's no explicit overload for `size_t`, but there is one for `u64`,
  which on most platforms is the same type as `size_t`.  On macOS,
  however, it isn't: both types are 64 bits, but `size_t` is `unsigned
  long` and `u64` is `unsigned long long`.  Regardless, it makes more
  sense to explicitly use `u64` here instead of `size_t`.
2020-12-06 18:59:22 -05:00
Lioncash
e7fe020ace ipc_helpers: Remove usage of the global system instance
Resolves numerous deprecation warnings throughout the codebase due to
inclusion of this header. Now building core should be significantly less
noisy (and also relying on less global state).

This also uncovered quite a few modules that were relying on indirect
includes, which have also been fixed.
2020-11-08 15:58:11 -05:00
bunnei
deb3536936 Revert "core: Fix clang build" 2020-10-20 19:07:39 -07:00
Lioncash
18636013c9 core: Fix clang build
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.

Fixes #4795
2020-10-17 19:50:39 -04:00
Lioncash
16de0a6a96 core/CMakeLists: Make some warnings errors
Makes our error coverage a little more consistent across the board by
applying it to Linux side of things as well. This also makes it more
consistent with the warning settings in other libraries in the project.

This also updates httplib to 0.7.9, as there are several warning
cleanups made that allow us to enable several warnings as errors.
2020-10-13 13:16:49 -04:00
Lioncash
43ef4a7305 ipc_helpers: Only allow trivially copyable objects with PushRaw() and PopRaw()
It's undefined behavior to use non-trivially copyable objects with
std::memcpy, so we can add asserts to catch usages of these at
compile-time.
2020-08-05 14:08:28 -04:00
bunnei
4a4516868c kernel: Implement a more accurate IPC dispatch. 2019-11-28 12:01:53 -05:00
bunnei
5cb0f276fe kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154)
* 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.
2019-11-24 20:15:51 -05:00
Lioncash
f768365cd5 ipc_helpers: Amend floating-point type in Pop<double> specialization
Currently, this overload isn't used, so this wasn't actually hit in any
code, only the float overload is used.
2019-05-18 22:05:33 -04:00
Lioncash
bfbadb38be kernel/server_session: Return a std::pair from CreateSessionPair()
Keeps the return type consistent with the function name. While we're at
it, we can also reduce the amount of boilerplate involved with handling
these by using structured bindings.
2019-04-06 01:42:03 -04:00
Lioncash
e6f8a5c934 ipc_helpers: Allow pushing and popping floating-point values
Certain values that are passed through the IPC buffer are actually
floating point values, not solely integral values.
2019-03-16 14:05:03 -04:00
bunnei
4bd4f3980b Merge pull request #2223 from lioncash/error
core/hle/result: Tidy up the base error code result header.
2019-03-13 14:43:14 -04:00
bunnei
060115895b Merge pull request #2166 from lioncash/vi-init-service
service/vi: Unstub GetDisplayService
2019-03-13 10:01:54 -04:00
Lioncash
fc7bc644cc core/hle/result: Relocate IPC error code to ipc_helpers
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.
2019-03-10 18:23:42 -04:00
Lioncash
922f4d460e kernel/hle_ipc: Convert std::shared_ptr IPC header instances to std::optional
There's no real need to use a shared lifetime here, since we don't
actually expose them to anything else. This is also kind of an
unnecessary use of the heap given the objects themselves are so small;
small enough, in fact that changing over to optionals actually reduces
the overall size of the HLERequestContext struct (818 bytes to 808
bytes).
2019-03-07 23:34:37 -05:00
Lioncash
93b02f28d8 core/ipc_helper: Allow popping all signed value types with RequestParser
There's no real reason this shouldn't be allowed, given some values sent
via a request can be signed. This also makes it less annoying to work
with popping enum values, given an enum class with no type specifier
will work out of the box now.

It's also kind of an oversight to allow popping s64 values, but nothing
else.
2019-02-26 18:10:36 -05:00
Lioncash
ce50c06bfc hle/ipc_helpers: Fix clang-format warnings 2019-01-29 21:11:04 -05:00
Lioncash
7a8e2f3538 hle/ipc_helpers: Allow pushing signed values
This is kind of a large hole in the API, given we allow popping signed
values. This fixes that.
2019-01-29 13:09:32 -05:00
Lioncash
2935c16688 core/kernel: Remove unnecessary inclusions
Gets rid of a few unnecessary header dependencies in some source files.
2018-12-31 19:04:16 -05:00
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.
2018-10-29 23:28:04 -04:00
David Marcec
a3b424c3c7 Removed MakeBuilder as it's not needed anymore 2018-09-19 15:13:56 +10:00