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
6fd19f05
There was an error fetching the commit references. Please try again later.
Commit
6fd19f05
authored
7 years ago
by
bunnei
Browse files
Options
Downloads
Patches
Plain Diff
hle_ipc: Add GetReadBufferSize and check write buffer size.
parent
516a9572
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/kernel/hle_ipc.cpp
+7
-0
7 additions, 0 deletions
src/core/hle/kernel/hle_ipc.cpp
src/core/hle/kernel/hle_ipc.h
+3
-0
3 additions, 0 deletions
src/core/hle/kernel/hle_ipc.h
with
10 additions
and
0 deletions
src/core/hle/kernel/hle_ipc.cpp
+
7
−
0
View file @
6fd19f05
...
@@ -229,6 +229,8 @@ std::vector<u8> HLERequestContext::ReadBuffer() const {
...
@@ -229,6 +229,8 @@ std::vector<u8> HLERequestContext::ReadBuffer() const {
size_t
HLERequestContext
::
WriteBuffer
(
const
void
*
buffer
,
const
size_t
size
)
const
{
size_t
HLERequestContext
::
WriteBuffer
(
const
void
*
buffer
,
const
size_t
size
)
const
{
const
bool
is_buffer_b
{
BufferDescriptorB
().
size
()
&&
BufferDescriptorB
()[
0
].
Size
()};
const
bool
is_buffer_b
{
BufferDescriptorB
().
size
()
&&
BufferDescriptorB
()[
0
].
Size
()};
ASSERT_MSG
(
size
<=
GetWriteBufferSize
(),
"Size %d is too big"
,
size
);
if
(
is_buffer_b
)
{
if
(
is_buffer_b
)
{
Memory
::
WriteBlock
(
BufferDescriptorB
()[
0
].
Address
(),
buffer
,
size
);
Memory
::
WriteBlock
(
BufferDescriptorB
()[
0
].
Address
(),
buffer
,
size
);
}
else
{
}
else
{
...
@@ -242,6 +244,11 @@ size_t HLERequestContext::WriteBuffer(const std::vector<u8>& buffer) const {
...
@@ -242,6 +244,11 @@ size_t HLERequestContext::WriteBuffer(const std::vector<u8>& buffer) const {
return
WriteBuffer
(
buffer
.
data
(),
buffer
.
size
());
return
WriteBuffer
(
buffer
.
data
(),
buffer
.
size
());
}
}
size_t
HLERequestContext
::
GetReadBufferSize
()
const
{
const
bool
is_buffer_a
{
BufferDescriptorA
().
size
()
&&
BufferDescriptorA
()[
0
].
Size
()};
return
is_buffer_a
?
BufferDescriptorA
()[
0
].
Size
()
:
BufferDescriptorX
()[
0
].
Size
();
}
size_t
HLERequestContext
::
GetWriteBufferSize
()
const
{
size_t
HLERequestContext
::
GetWriteBufferSize
()
const
{
const
bool
is_buffer_b
{
BufferDescriptorB
().
size
()
&&
BufferDescriptorB
()[
0
].
Size
()};
const
bool
is_buffer_b
{
BufferDescriptorB
().
size
()
&&
BufferDescriptorB
()[
0
].
Size
()};
return
is_buffer_b
?
BufferDescriptorB
()[
0
].
Size
()
:
BufferDescriptorC
()[
0
].
Size
();
return
is_buffer_b
?
BufferDescriptorB
()[
0
].
Size
()
:
BufferDescriptorC
()[
0
].
Size
();
...
...
This diff is collapsed.
Click to expand it.
src/core/hle/kernel/hle_ipc.h
+
3
−
0
View file @
6fd19f05
...
@@ -152,6 +152,9 @@ public:
...
@@ -152,6 +152,9 @@ public:
/// Helper function to write a buffer using the appropriate buffer descriptor
/// Helper function to write a buffer using the appropriate buffer descriptor
size_t
WriteBuffer
(
const
std
::
vector
<
u8
>&
buffer
)
const
;
size_t
WriteBuffer
(
const
std
::
vector
<
u8
>&
buffer
)
const
;
/// Helper function to get the size of the input buffer
size_t
GetReadBufferSize
()
const
;
/// Helper function to get the size of the output buffer
/// Helper function to get the size of the output buffer
size_t
GetWriteBufferSize
()
const
;
size_t
GetWriteBufferSize
()
const
;
...
...
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