mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-14 23:24:26 -04:00
kern: add hardware single step extension
This commit is contained in:
parent
904ab19823
commit
4075d24e0c
10 changed files with 226 additions and 4 deletions
|
@ -186,7 +186,24 @@ namespace ams::kern::svc {
|
|||
R_UNLESS(KTargetSystem::IsDebugMode(), svc::ResultNotImplemented());
|
||||
|
||||
/* Validate the context flags. */
|
||||
R_UNLESS((context_flags | ams::svc::ThreadContextFlag_All) == ams::svc::ThreadContextFlag_All, svc::ResultInvalidEnumValue());
|
||||
#if defined(MESOSPHERE_ENABLE_HARDWARE_SINGLE_STEP)
|
||||
{
|
||||
/* Check that the flags are a subset of the allowable. */
|
||||
constexpr u32 AllFlagsMask = ams::svc::ThreadContextFlag_All | ams::svc::ThreadContextFlag_SetSingleStep | ams::svc::ThreadContextFlag_ClearSingleStep;
|
||||
R_UNLESS((context_flags | AllFlagsMask) == AllFlagsMask, svc::ResultInvalidEnumValue());
|
||||
|
||||
/* Check that thread isn't both setting and clearing single step. */
|
||||
const bool set_ss = (context_flags & ams::svc::ThreadContextFlag_SetSingleStep) != 0;
|
||||
const bool clear_ss = (context_flags & ams::svc::ThreadContextFlag_ClearSingleStep) != 0;
|
||||
|
||||
R_UNLESS(!(set_ss && clear_ss), svc::ResultInvalidEnumValue());
|
||||
}
|
||||
#else
|
||||
{
|
||||
/* Check that the flags are a subset of the allowable. */
|
||||
R_UNLESS((context_flags | ams::svc::ThreadContextFlag_All) == ams::svc::ThreadContextFlag_All, svc::ResultInvalidEnumValue());
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Copy the thread context from userspace. */
|
||||
ams::svc::ThreadContext context;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue