Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
5bc14e79
There was an error fetching the commit references. Please try again later.
Commit
5bc14e79
authored
7 years ago
by
Subv
Committed by
bunnei
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
IPC: Push domain objects as move handles when not in a domain.
parent
1aa4cdc3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/hle/ipc_helpers.h
+20
-2
20 additions, 2 deletions
src/core/hle/ipc_helpers.h
src/core/hle/kernel/hle_ipc.h
+8
-0
8 additions, 0 deletions
src/core/hle/kernel/hle_ipc.h
with
28 additions
and
2 deletions
src/core/hle/ipc_helpers.h
+
20
−
2
View file @
5bc14e79
...
@@ -9,10 +9,13 @@
...
@@ -9,10 +9,13 @@
#include
<type_traits>
#include
<type_traits>
#include
<utility>
#include
<utility>
#include
"core/hle/ipc.h"
#include
"core/hle/ipc.h"
#include
"core/hle/kernel/client_port.h"
#include
"core/hle/kernel/client_session.h"
#include
"core/hle/kernel/domain.h"
#include
"core/hle/kernel/domain.h"
#include
"core/hle/kernel/handle_table.h"
#include
"core/hle/kernel/handle_table.h"
#include
"core/hle/kernel/hle_ipc.h"
#include
"core/hle/kernel/hle_ipc.h"
#include
"core/hle/kernel/kernel.h"
#include
"core/hle/kernel/kernel.h"
#include
"core/hle/kernel/server_port.h"
namespace
IPC
{
namespace
IPC
{
...
@@ -63,13 +66,20 @@ public:
...
@@ -63,13 +66,20 @@ public:
:
RequestHelperBase
(
context
)
{
:
RequestHelperBase
(
context
)
{
memset
(
cmdbuf
,
0
,
sizeof
(
u32
)
*
IPC
::
COMMAND_BUFFER_LENGTH
);
memset
(
cmdbuf
,
0
,
sizeof
(
u32
)
*
IPC
::
COMMAND_BUFFER_LENGTH
);
context
.
ClearIncomingObjects
();
IPC
::
CommandHeader
header
{};
IPC
::
CommandHeader
header
{};
// The entire size of the raw data section in u32 units, including the 16 bytes of mandatory
// The entire size of the raw data section in u32 units, including the 16 bytes of mandatory
// padding.
// padding.
u32
raw_data_size
=
sizeof
(
IPC
::
DataPayloadHeader
)
/
4
+
4
+
normal_params_size
;
u32
raw_data_size
=
sizeof
(
IPC
::
DataPayloadHeader
)
/
4
+
4
+
normal_params_size
;
if
(
context
.
IsDomain
())
if
(
context
.
IsDomain
())
{
raw_data_size
+=
sizeof
(
DomainMessageHeader
)
/
4
+
num_domain_objects
;
raw_data_size
+=
sizeof
(
DomainMessageHeader
)
/
4
+
num_domain_objects
;
}
else
{
// If we're not in a domain, turn the domain object parameters into move handles.
num_handles_to_move
+=
num_domain_objects
;
num_domain_objects
=
0
;
}
header
.
data_size
.
Assign
(
raw_data_size
);
header
.
data_size
.
Assign
(
raw_data_size
);
if
(
num_handles_to_copy
||
num_handles_to_move
)
{
if
(
num_handles_to_copy
||
num_handles_to_move
)
{
...
@@ -100,7 +110,15 @@ public:
...
@@ -100,7 +110,15 @@ public:
template
<
class
T
,
class
...
Args
>
template
<
class
T
,
class
...
Args
>
void
PushIpcInterface
(
Args
&&
...
args
)
{
void
PushIpcInterface
(
Args
&&
...
args
)
{
context
->
AddDomainObject
(
std
::
make_shared
<
T
>
(
std
::
forward
<
Args
>
(
args
)...));
auto
iface
=
std
::
make_shared
<
T
>
(
std
::
forward
<
Args
>
(
args
)...);
if
(
context
->
IsDomain
())
{
context
->
AddDomainObject
(
std
::
move
(
iface
));
}
else
{
auto
port
=
iface
->
CreatePort
();
auto
session
=
port
->
Connect
();
ASSERT
(
session
.
Succeeded
());
context
->
AddMoveObject
(
std
::
move
(
session
).
Unwrap
());
}
}
}
// Validate on destruction, as there shouldn't be any case where we don't want it
// Validate on destruction, as there shouldn't be any case where we don't want it
...
...
This diff is collapsed.
Click to expand it.
src/core/hle/kernel/hle_ipc.h
+
8
−
0
View file @
5bc14e79
...
@@ -175,6 +175,14 @@ public:
...
@@ -175,6 +175,14 @@ public:
domain_objects
.
emplace_back
(
std
::
move
(
object
));
domain_objects
.
emplace_back
(
std
::
move
(
object
));
}
}
/// Clears the list of objects so that no lingering objects are written accidentally to the
/// response buffer.
void
ClearIncomingObjects
()
{
move_objects
.
clear
();
copy_objects
.
clear
();
domain_objects
.
clear
();
}
private
:
private
:
std
::
array
<
u32
,
IPC
::
COMMAND_BUFFER_LENGTH
>
cmd_buf
;
std
::
array
<
u32
,
IPC
::
COMMAND_BUFFER_LENGTH
>
cmd_buf
;
SharedPtr
<
Kernel
::
Domain
>
domain
;
SharedPtr
<
Kernel
::
Domain
>
domain
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment