Skip to content

Commit

Permalink
cortexm: linter edits, ENABLE_DEBUG gate
Browse files Browse the repository at this point in the history
  • Loading branch information
ALTracer committed Nov 19, 2023
1 parent 95022c6 commit 66b07ab
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/target/cortexm.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ typedef struct cortexm_priv {
uint32_t demcr;
} cortexm_priv_s;

#ifdef ENABLE_DEBUG
const char *const semihosting_names[] = {
"",
"SYS_OPEN",
Expand All @@ -129,7 +130,7 @@ const char *const semihosting_names[] = {
"SYS_ISERROR",
"SYS_ISTTY",
"SYS_SEEK",
"0x0B",
"0x0b",
"SYS_FLEN",
"SYS_TMPNAM",
"SYS_REMOVE",
Expand All @@ -143,15 +144,14 @@ const char *const semihosting_names[] = {
"SYS_HEAPINFO",
"0x17",
[SEMIHOSTING_SYS_EXIT] = "SYS_EXIT",
#if 0
/* 7 reserved */
[SEMIHOSTING_SYS_EXIT_EXTENDED] = "SYS_EXIT_EXTENDED",
/* 15 reserved */
[SEMIHOSTING_SYS_ELAPSED] = "SYS_ELAPSED",
[SEMIHOSTING_SYS_TICKFREQ] = "SYS_TICKFREQ",
#endif
"" /* sentinel */
"",
};
#endif

/* Register number tables */
static const uint32_t regnum_cortex_m[CORTEXM_GENERAL_REG_COUNT] = {
Expand Down Expand Up @@ -1470,6 +1470,7 @@ static int cortexm_hostio_request(target_s *target)
target_mem_read(target, params, arm_regs[1], sizeof(params));
int32_t ret = 0;

#ifdef ENABLE_DEBUG
const char *syscall_descr = NULL;
if (syscall < ARRAY_LENGTH(semihosting_names))
syscall_descr = semihosting_names[syscall];
Expand All @@ -1478,6 +1479,7 @@ static int cortexm_hostio_request(target_s *target)

DEBUG_INFO("syscall %12s (%" PRIx32 " %" PRIx32 " %" PRIx32 " %" PRIx32 ")\n", syscall_descr, params[0], params[1],
params[2], params[3]);
#endif
switch (syscall) {
#if PC_HOSTED == 1

Expand Down

0 comments on commit 66b07ab

Please sign in to comment.