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
22659afc
There was an error fetching the commit references. Please try again later.
Commit
22659afc
authored
7 years ago
by
bunnei
Browse files
Options
Downloads
Patches
Plain Diff
shared_memory: Minor fixes and cleanup.
parent
974362bc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/hle/kernel/shared_memory.cpp
+6
-6
6 additions, 6 deletions
src/core/hle/kernel/shared_memory.cpp
with
6 additions
and
6 deletions
src/core/hle/kernel/shared_memory.cpp
+
6
−
6
View file @
22659afc
...
@@ -106,14 +106,14 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
...
@@ -106,14 +106,14 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
// Error out if the requested permissions don't match what the creator process allows.
// Error out if the requested permissions don't match what the creator process allows.
if
(
static_cast
<
u32
>
(
permissions
)
&
~
static_cast
<
u32
>
(
own_other_permissions
))
{
if
(
static_cast
<
u32
>
(
permissions
)
&
~
static_cast
<
u32
>
(
own_other_permissions
))
{
LOG_ERROR
(
Kernel
,
"cannot map id=%u, address=0x%
08X
name=%s, permissions don't match"
,
LOG_ERROR
(
Kernel
,
"cannot map id=%u, address=0x%
llx
name=%s, permissions don't match"
,
GetObjectId
(),
address
,
name
.
c_str
());
GetObjectId
(),
address
,
name
.
c_str
());
return
ERR_INVALID_COMBINATION
;
return
ERR_INVALID_COMBINATION
;
}
}
// Heap-backed memory blocks can not be mapped with other_permissions = DontCare
// Heap-backed memory blocks can not be mapped with other_permissions = DontCare
if
(
base_address
!=
0
&&
other_permissions
==
MemoryPermission
::
DontCare
)
{
if
(
base_address
!=
0
&&
other_permissions
==
MemoryPermission
::
DontCare
)
{
LOG_ERROR
(
Kernel
,
"cannot map id=%u, address=0x%
08X
name=%s, permissions don't match"
,
LOG_ERROR
(
Kernel
,
"cannot map id=%u, address=0x%
llx
name=%s, permissions don't match"
,
GetObjectId
(),
address
,
name
.
c_str
());
GetObjectId
(),
address
,
name
.
c_str
());
return
ERR_INVALID_COMBINATION
;
return
ERR_INVALID_COMBINATION
;
}
}
...
@@ -121,7 +121,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
...
@@ -121,7 +121,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
// Error out if the provided permissions are not compatible with what the creator process needs.
// Error out if the provided permissions are not compatible with what the creator process needs.
if
(
other_permissions
!=
MemoryPermission
::
DontCare
&&
if
(
other_permissions
!=
MemoryPermission
::
DontCare
&&
static_cast
<
u32
>
(
this
->
permissions
)
&
~
static_cast
<
u32
>
(
other_permissions
))
{
static_cast
<
u32
>
(
this
->
permissions
)
&
~
static_cast
<
u32
>
(
other_permissions
))
{
LOG_ERROR
(
Kernel
,
"cannot map id=%u, address=0x%
08X
name=%s, permissions don't match"
,
LOG_ERROR
(
Kernel
,
"cannot map id=%u, address=0x%
llx
name=%s, permissions don't match"
,
GetObjectId
(),
address
,
name
.
c_str
());
GetObjectId
(),
address
,
name
.
c_str
());
return
ERR_WRONG_PERMISSION
;
return
ERR_WRONG_PERMISSION
;
}
}
...
@@ -136,8 +136,8 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
...
@@ -136,8 +136,8 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
// can not map it in its own address space unless it was created with addr=0, result 0xD900182C.
// can not map it in its own address space unless it was created with addr=0, result 0xD900182C.
if
(
address
!=
0
)
{
if
(
address
!=
0
)
{
if
(
address
<
Memory
::
HEAP_VADDR
||
address
+
size
>=
Memory
::
SHARED_MEMORY_VADDR_END
)
{
if
(
address
<
Memory
::
HEAP_VADDR
)
{
LOG_ERROR
(
Kernel
,
"cannot map id=%u, address=0x%
08X
name=%s, invalid address"
,
LOG_ERROR
(
Kernel
,
"cannot map id=%u, address=0x%
llx
name=%s, invalid address"
,
GetObjectId
(),
address
,
name
.
c_str
());
GetObjectId
(),
address
,
name
.
c_str
());
return
ERR_INVALID_ADDRESS
;
return
ERR_INVALID_ADDRESS
;
}
}
...
@@ -156,7 +156,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
...
@@ -156,7 +156,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
if
(
result
.
Failed
())
{
if
(
result
.
Failed
())
{
LOG_ERROR
(
LOG_ERROR
(
Kernel
,
Kernel
,
"cannot map id=%u, target_address=0x%
08X
name=%s, error mapping to virtual memory"
,
"cannot map id=%u, target_address=0x%
llx
name=%s, error mapping to virtual memory"
,
GetObjectId
(),
target_address
,
name
.
c_str
());
GetObjectId
(),
target_address
,
name
.
c_str
());
return
result
.
Code
();
return
result
.
Code
();
}
}
...
...
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