summaryrefslogtreecommitdiff
path: root/core/cortex-m0
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2021-12-30 16:18:08 +0100
committerCommit Bot <commit-bot@chromium.org>2022-01-06 13:03:31 +0000
commitc53da4bba31391a1919c17b5b6027f2337aba714 (patch)
treec457a0306ba650b407053443f82ea5c844327003 /core/cortex-m0
parent14074729dc54d70a919896671362a46cce77ac13 (diff)
downloadchrome-ec-c53da4bba31391a1919c17b5b6027f2337aba714.tar.gz
atomic: fix printing atomic_t type
After changing the atomic_t type from long to int the print format was changed to %l, but the CrosEC print function doesn't support the 'l' format if long is 4 bytes wide. Cast the atomic_t to int and print it as a normal int variable. BUG=b:207082842 TEST=make buildall && zmake testall && make sure the 'taskinfo' work BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I8643d8b843720e3583a29d83fc143d8e103e79c4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3359425 Tested-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Patryk Duda <patrykd@google.com>
Diffstat (limited to 'core/cortex-m0')
-rw-r--r--core/cortex-m0/task.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c
index 64c5423a2b..e8aec0926e 100644
--- a/core/cortex-m0/task.c
+++ b/core/cortex-m0/task.c
@@ -579,8 +579,8 @@ void task_print_list(void)
sp++)
stackused -= sizeof(uint32_t);
- ccprintf("%4d %c %-16s %08lx %11.6lld %3d/%3d\n", i, is_ready,
- task_names[i], (long)tasks[i].events, tasks[i].runtime,
+ ccprintf("%4d %c %-16s %08x %11.6lld %3d/%3d\n", i, is_ready,
+ task_names[i], (int)tasks[i].events, tasks[i].runtime,
stackused, tasks_init[i].stack_size);
cflush();
}
@@ -623,10 +623,10 @@ DECLARE_CONSOLE_COMMAND(taskinfo, command_task_info,
static int command_task_ready(int argc, char **argv)
{
if (argc < 2) {
- ccprintf("tasks_ready: 0x%08lx\n", (long)tasks_ready);
+ ccprintf("tasks_ready: 0x%08x\n", (int)tasks_ready);
} else {
tasks_ready = strtoi(argv[1], NULL, 16);
- ccprintf("Setting tasks_ready to 0x%08lx\n", (long)tasks_ready);
+ ccprintf("Setting tasks_ready to 0x%08x\n", (int)tasks_ready);
__schedule(0, 0);
}