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
b8be5524
There was an error fetching the commit references. Please try again later.
Commit
b8be5524
authored
6 years ago
by
Lioncash
Browse files
Options
Downloads
Patches
Plain Diff
kernel/error: Add error code for invalid memory permissions
parent
2fd45093
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/errors.h
+3
-2
3 additions, 2 deletions
src/core/hle/kernel/errors.h
src/core/hle/kernel/shared_memory.cpp
+1
-1
1 addition, 1 deletion
src/core/hle/kernel/shared_memory.cpp
with
4 additions
and
3 deletions
src/core/hle/kernel/errors.h
+
3
−
2
View file @
b8be5524
...
@@ -15,13 +15,13 @@ enum {
...
@@ -15,13 +15,13 @@ enum {
SessionClosedByRemote
=
26
,
SessionClosedByRemote
=
26
,
PortNameTooLong
=
30
,
PortNameTooLong
=
30
,
NoPendingSessions
=
35
,
NoPendingSessions
=
35
,
WrongPermission
=
46
,
InvalidBufferDescriptor
=
48
,
InvalidBufferDescriptor
=
48
,
MaxConnectionsReached
=
52
,
MaxConnectionsReached
=
52
,
// Confirmed Switch OS error codes
// Confirmed Switch OS error codes
InvalidAddress
=
102
,
InvalidAddress
=
102
,
InvalidMemoryState
=
106
,
InvalidMemoryState
=
106
,
InvalidMemoryPermissions
=
108
,
InvalidProcessorId
=
113
,
InvalidProcessorId
=
113
,
InvalidHandle
=
114
,
InvalidHandle
=
114
,
InvalidCombination
=
116
,
InvalidCombination
=
116
,
...
@@ -40,7 +40,6 @@ enum {
...
@@ -40,7 +40,6 @@ enum {
constexpr
ResultCode
ERR_OUT_OF_HANDLES
(
-
1
);
constexpr
ResultCode
ERR_OUT_OF_HANDLES
(
-
1
);
constexpr
ResultCode
ERR_SESSION_CLOSED_BY_REMOTE
(
-
1
);
constexpr
ResultCode
ERR_SESSION_CLOSED_BY_REMOTE
(
-
1
);
constexpr
ResultCode
ERR_PORT_NAME_TOO_LONG
(
-
1
);
constexpr
ResultCode
ERR_PORT_NAME_TOO_LONG
(
-
1
);
constexpr
ResultCode
ERR_WRONG_PERMISSION
(
-
1
);
constexpr
ResultCode
ERR_MAX_CONNECTIONS_REACHED
(
-
1
);
constexpr
ResultCode
ERR_MAX_CONNECTIONS_REACHED
(
-
1
);
constexpr
ResultCode
ERR_INVALID_ENUM_VALUE
(
ErrorModule
::
Kernel
,
ErrCodes
::
InvalidEnumValue
);
constexpr
ResultCode
ERR_INVALID_ENUM_VALUE
(
ErrorModule
::
Kernel
,
ErrCodes
::
InvalidEnumValue
);
constexpr
ResultCode
ERR_INVALID_ENUM_VALUE_FND
(
-
1
);
constexpr
ResultCode
ERR_INVALID_ENUM_VALUE_FND
(
-
1
);
...
@@ -50,6 +49,8 @@ constexpr ResultCode ERR_INVALID_COMBINATION_KERNEL(ErrorModule::Kernel,
...
@@ -50,6 +49,8 @@ constexpr ResultCode ERR_INVALID_COMBINATION_KERNEL(ErrorModule::Kernel,
constexpr
ResultCode
ERR_OUT_OF_MEMORY
(
-
1
);
constexpr
ResultCode
ERR_OUT_OF_MEMORY
(
-
1
);
constexpr
ResultCode
ERR_INVALID_ADDRESS
(
ErrorModule
::
Kernel
,
ErrCodes
::
InvalidAddress
);
constexpr
ResultCode
ERR_INVALID_ADDRESS
(
ErrorModule
::
Kernel
,
ErrCodes
::
InvalidAddress
);
constexpr
ResultCode
ERR_INVALID_ADDRESS_STATE
(
ErrorModule
::
Kernel
,
ErrCodes
::
InvalidMemoryState
);
constexpr
ResultCode
ERR_INVALID_ADDRESS_STATE
(
ErrorModule
::
Kernel
,
ErrCodes
::
InvalidMemoryState
);
constexpr
ResultCode
ERR_INVALID_MEMORY_PERMISSIONS
(
ErrorModule
::
Kernel
,
ErrCodes
::
InvalidMemoryPermissions
);
constexpr
ResultCode
ERR_INVALID_HANDLE
(
ErrorModule
::
Kernel
,
ErrCodes
::
InvalidHandle
);
constexpr
ResultCode
ERR_INVALID_HANDLE
(
ErrorModule
::
Kernel
,
ErrCodes
::
InvalidHandle
);
constexpr
ResultCode
ERR_INVALID_STATE
(
ErrorModule
::
Kernel
,
ErrCodes
::
InvalidState
);
constexpr
ResultCode
ERR_INVALID_STATE
(
ErrorModule
::
Kernel
,
ErrCodes
::
InvalidState
);
constexpr
ResultCode
ERR_INVALID_POINTER
(
-
1
);
constexpr
ResultCode
ERR_INVALID_POINTER
(
-
1
);
...
...
This diff is collapsed.
Click to expand it.
src/core/hle/kernel/shared_memory.cpp
+
1
−
1
View file @
b8be5524
...
@@ -101,7 +101,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
...
@@ -101,7 +101,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
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={}, address=0x{:X} name={}, permissions don't match"
,
LOG_ERROR
(
Kernel
,
"cannot map id={}, address=0x{:X} name={}, permissions don't match"
,
GetObjectId
(),
address
,
name
);
GetObjectId
(),
address
,
name
);
return
ERR_
WRONG
_PERMISSION
;
return
ERR_
INVALID_MEMORY
_PERMISSION
S
;
}
}
VAddr
target_address
=
address
;
VAddr
target_address
=
address
;
...
...
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