Add awareness of halt group cause. (#472)

Change-Id: I7f7b967ccaa3d1ff05a7e7d0c2a7ba4fa7d68ac0
riscv
Tim Newsome 2020-05-06 08:42:38 -07:00 committed by GitHub
parent e6e281197f
commit 55dd7e83ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -92,6 +92,7 @@ static int riscv013_test_compliance(struct target *target);
#define CSR_DCSR_CAUSE_DEBUGINT 3 #define CSR_DCSR_CAUSE_DEBUGINT 3
#define CSR_DCSR_CAUSE_STEP 4 #define CSR_DCSR_CAUSE_STEP 4
#define CSR_DCSR_CAUSE_HALT 5 #define CSR_DCSR_CAUSE_HALT 5
#define CSR_DCSR_CAUSE_GROUP 6
#define RISCV013_INFO(r) riscv013_info_t *r = get_info(target) #define RISCV013_INFO(r) riscv013_info_t *r = get_info(target)
@ -3878,6 +3879,8 @@ static enum riscv_halt_reason riscv013_halt_reason(struct target *target)
case CSR_DCSR_CAUSE_DEBUGINT: case CSR_DCSR_CAUSE_DEBUGINT:
case CSR_DCSR_CAUSE_HALT: case CSR_DCSR_CAUSE_HALT:
return RISCV_HALT_INTERRUPT; return RISCV_HALT_INTERRUPT;
case CSR_DCSR_CAUSE_GROUP:
return RISCV_HALT_GROUP;
} }
LOG_ERROR("Unknown DCSR cause field: %x", (int)get_field(dcsr, CSR_DCSR_CAUSE)); LOG_ERROR("Unknown DCSR cause field: %x", (int)get_field(dcsr, CSR_DCSR_CAUSE));

View File

@ -1931,6 +1931,7 @@ int set_debug_reason(struct target *target, int hartid)
target->debug_reason = DBG_REASON_WATCHPOINT; target->debug_reason = DBG_REASON_WATCHPOINT;
break; break;
case RISCV_HALT_INTERRUPT: case RISCV_HALT_INTERRUPT:
case RISCV_HALT_GROUP:
target->debug_reason = DBG_REASON_DBGRQ; target->debug_reason = DBG_REASON_DBGRQ;
break; break;
case RISCV_HALT_SINGLESTEP: case RISCV_HALT_SINGLESTEP:

View File

@ -40,6 +40,7 @@ enum riscv_halt_reason {
RISCV_HALT_SINGLESTEP, RISCV_HALT_SINGLESTEP,
RISCV_HALT_TRIGGER, RISCV_HALT_TRIGGER,
RISCV_HALT_UNKNOWN, RISCV_HALT_UNKNOWN,
RISCV_HALT_GROUP,
RISCV_HALT_ERROR RISCV_HALT_ERROR
}; };