Skip to content

Commit

Permalink
found the problem, haven't figured out why
Browse files Browse the repository at this point in the history
Signed-off-by: Alwin Joshy <[email protected]>
  • Loading branch information
alwin-joshy committed Feb 15, 2024
1 parent 1284103 commit 5db4d23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 4 additions & 6 deletions include/arch/arm/arch/machine/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ static inline void setHDCRTrapDebugExceptionState(bool_t enable_trapping)
{
word_t hdcr;
#ifdef CONFIG_ARCH_AARCH64
word_t hcr;
MRS("mdcr_el2", hdcr);
MRS("hcr_el2", hcr);
#else
MRC(ARM_CP15_HDCR, hdcr);
#endif
Expand All @@ -102,7 +100,7 @@ static inline void setHDCRTrapDebugExceptionState(bool_t enable_trapping)
| BIT(HDCR_DEBUG_TDOSA_SHIFT));
#ifdef CONFIG_ARCH_AARCH64
// @alwin: I think only this is necessary on aarch64 actually
hcr |= (HCR_TGE);
// hcr |= (HCR_TGE);
#endif

} else {
Expand All @@ -111,14 +109,14 @@ static inline void setHDCRTrapDebugExceptionState(bool_t enable_trapping)
| BIT(HDCR_DEBUG_TDA_SHIFT)
| BIT(HDCR_DEBUG_TDRA_SHIFT)
| BIT(HDCR_DEBUG_TDOSA_SHIFT));
}
#ifdef CONFIG_ARCH_AARCH64
// @alwin: I think only this is necessary on aarch64 actually
hcr &= ~HCR_TGE;
// hcr |= (HCR_TGE);
#endif

}
#ifdef CONFIG_ARCH_AARCH64
MSR("mdcr_el2", hdcr);
MSR("hcr_el2", hcr);
#else
MCR(ARM_CP15_HDCR, hdcr);
#endif
Expand Down
2 changes: 0 additions & 2 deletions src/arch/arm/64/machine/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
*/
bool_t configureSingleStepping(tcb_t *t, uint16_t bp_num, word_t n_instr,
bool_t is_reply) {

if (n_instr > 0) {
/* Enable single stepping */
t->tcbArch.tcbContext.breakpointState.single_step_enabled = true;
Expand All @@ -57,7 +56,6 @@ bool_t configureSingleStepping(tcb_t *t, uint16_t bp_num, word_t n_instr,

/* Guides the debug hardware initialization sequence. */
BOOT_CODE bool_t Arch_initHardwareBreakpoints(void) {

/*
* ARMv8 Architecture Reference Manual for A-profile Architecture
* D2.2: The Enable controls for each debug exception are:
Expand Down

0 comments on commit 5db4d23

Please sign in to comment.