mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-12 22:25:37 -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
|
@ -92,6 +92,9 @@ namespace ams::kern {
|
|||
bool is_calling_svc;
|
||||
bool is_in_exception_handler;
|
||||
bool is_pinned;
|
||||
#if defined(MESOSPHERE_ENABLE_HARDWARE_SINGLE_STEP)
|
||||
bool is_single_step;
|
||||
#endif
|
||||
};
|
||||
static_assert(alignof(StackParameters) == 0x10);
|
||||
static_assert(sizeof(StackParameters) == THREAD_STACK_PARAMETERS_SIZE);
|
||||
|
@ -106,6 +109,10 @@ namespace ams::kern {
|
|||
static_assert(__builtin_offsetof(StackParameters, is_in_exception_handler) == THREAD_STACK_PARAMETERS_IS_IN_EXCEPTION_HANDLER);
|
||||
static_assert(__builtin_offsetof(StackParameters, is_pinned) == THREAD_STACK_PARAMETERS_IS_PINNED);
|
||||
|
||||
#if defined(MESOSPHERE_ENABLE_HARDWARE_SINGLE_STEP)
|
||||
static_assert(__builtin_offsetof(StackParameters, is_single_step) == THREAD_STACK_PARAMETERS_IS_SINGLE_STEP);
|
||||
#endif
|
||||
|
||||
struct QueueEntry {
|
||||
private:
|
||||
KThread *m_prev;
|
||||
|
@ -325,6 +332,25 @@ namespace ams::kern {
|
|||
return this->GetStackParameters().current_svc_id;
|
||||
}
|
||||
|
||||
#if defined(MESOSPHERE_ENABLE_HARDWARE_SINGLE_STEP)
|
||||
|
||||
ALWAYS_INLINE void SetSingleStep() {
|
||||
MESOSPHERE_ASSERT_THIS();
|
||||
this->GetStackParameters().is_single_step = true;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void ClearSingleStep() {
|
||||
MESOSPHERE_ASSERT_THIS();
|
||||
this->GetStackParameters().is_single_step = false;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE bool IsSingleStep() const {
|
||||
MESOSPHERE_ASSERT_THIS();
|
||||
return this->GetStackParameters().is_single_step;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
ALWAYS_INLINE void RegisterDpc(DpcFlag flag) {
|
||||
this->GetStackParameters().dpc_flags.fetch_or(flag);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue