diff options
-rw-r--r-- | chip/ish/power_mgt.c | 6 | ||||
-rw-r--r-- | chip/it83xx/clock.c | 4 | ||||
-rw-r--r-- | chip/lm4/clock.c | 4 | ||||
-rw-r--r-- | chip/mchp/clock.c | 4 | ||||
-rw-r--r-- | chip/mec1322/clock.c | 4 | ||||
-rw-r--r-- | chip/mt_scp/memmap.c | 4 | ||||
-rw-r--r-- | chip/npcx/clock.c | 4 | ||||
-rw-r--r-- | chip/stm32/clock-stm32f0.c | 4 | ||||
-rw-r--r-- | chip/stm32/clock-stm32h7.c | 4 | ||||
-rw-r--r-- | common/btle_ll.c | 2 | ||||
-rw-r--r-- | common/physical_presence.c | 2 | ||||
-rw-r--r-- | common/printf.c | 20 | ||||
-rw-r--r-- | common/timer.c | 10 | ||||
-rw-r--r-- | core/cortex-m/task.c | 8 | ||||
-rw-r--r-- | core/cortex-m0/task.c | 8 | ||||
-rw-r--r-- | core/minute-ia/task.c | 11 | ||||
-rw-r--r-- | core/nds32/task.c | 8 | ||||
-rw-r--r-- | cts/hook/dut.c | 4 | ||||
-rw-r--r-- | driver/touchpad_st.c | 6 | ||||
-rw-r--r-- | include/printf.h | 5 | ||||
-rw-r--r-- | power/common.c | 2 |
21 files changed, 74 insertions, 50 deletions
diff --git a/chip/ish/power_mgt.c b/chip/ish/power_mgt.c index 470dfd2573..83115a342c 100644 --- a/chip/ish/power_mgt.c +++ b/chip/ish/power_mgt.c @@ -606,8 +606,8 @@ static void print_stats(const char *name, const struct pm_stat *stat) { if (stat->count) ccprintf(" %s:\n" - " counts: %lu\n" - " time: %.6lus\n", + " counts: %llu\n" + " time: %.6llus\n", name, stat->count, stat->total_time_us); } @@ -619,7 +619,7 @@ static int command_idle_stats(int argc, char **argv) struct ish_aon_share *aon_share = pm_ctx.aon_share; ccprintf("Aontask exists: %s\n", pm_ctx.aon_valid ? "Yes" : "No"); - ccprintf("Total time on: %.6lus\n", get_time().val); + ccprintf("Total time on: %.6llus\n", get_time().val); ccprintf("Idle sleep:\n"); print_stats("D0i0", &pm_stats.d0i0); diff --git a/chip/it83xx/clock.c b/chip/it83xx/clock.c index ff63330551..b3771adcb5 100644 --- a/chip/it83xx/clock.c +++ b/chip/it83xx/clock.c @@ -603,9 +603,9 @@ static int command_idle_stats(int argc, char **argv) ccprintf("Num idle calls that doze: %d\n", idle_doze_cnt); ccprintf("Num idle calls that sleep: %d\n", idle_sleep_cnt); - ccprintf("Total Time spent in sleep(sec): %.6ld(s)\n", + ccprintf("Total Time spent in sleep(sec): %.6lld(s)\n", total_idle_sleep_time_us); - ccprintf("Total time on: %.6lds\n\n", ts.val); + ccprintf("Total time on: %.6llds\n\n", ts.val); return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(idlestats, command_idle_stats, diff --git a/chip/lm4/clock.c b/chip/lm4/clock.c index deb03839b6..39800c9034 100644 --- a/chip/lm4/clock.c +++ b/chip/lm4/clock.c @@ -692,9 +692,9 @@ static int command_idle_stats(int argc, char **argv) ccprintf("Num idle calls that sleep: %d\n", idle_sleep_cnt); ccprintf("Num idle calls that deep-sleep: %d\n", idle_dsleep_cnt); - ccprintf("Time spent in deep-sleep: %.6lds\n", + ccprintf("Time spent in deep-sleep: %.6llds\n", idle_dsleep_time_us); - ccprintf("Total time on: %.6lds\n", ts.val); + ccprintf("Total time on: %.6llds\n", ts.val); ccprintf("Deep-sleep closest to wake deadline: %dus\n", dsleep_recovery_margin_us); diff --git a/chip/mchp/clock.c b/chip/mchp/clock.c index 6046eee7fb..ad8c47d38e 100644 --- a/chip/mchp/clock.c +++ b/chip/mchp/clock.c @@ -697,9 +697,9 @@ static int command_idle_stats(int argc, char **argv) ccprintf("Num idle calls that deep-sleep: %d\n", idle_dsleep_cnt); - ccprintf("Total Time spent in deep-sleep(sec): %.6ld(s)\n", + ccprintf("Total Time spent in deep-sleep(sec): %.6lld(s)\n", total_idle_dsleep_time_us); - ccprintf("Total time on: %.6lds\n\n", + ccprintf("Total time on: %.6llds\n\n", ts.val); #ifdef CONFIG_MCHP_DEEP_SLP_DEBUG diff --git a/chip/mec1322/clock.c b/chip/mec1322/clock.c index 4e5d245a59..ce07284891 100644 --- a/chip/mec1322/clock.c +++ b/chip/mec1322/clock.c @@ -426,9 +426,9 @@ static int command_idle_stats(int argc, char **argv) ccprintf("Num idle calls that sleep: %d\n", idle_sleep_cnt); ccprintf("Num idle calls that deep-sleep: %d\n", idle_dsleep_cnt); - ccprintf("Total Time spent in deep-sleep(sec): %.6ld(s)\n", + ccprintf("Total Time spent in deep-sleep(sec): %.6lld(s)\n", total_idle_dsleep_time_us); - ccprintf("Total time on: %.6lds\n\n", ts.val); + ccprintf("Total time on: %.6llds\n\n", ts.val); return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(idlestats, command_idle_stats, diff --git a/chip/mt_scp/memmap.c b/chip/mt_scp/memmap.c index 03470d3e68..5926ae791e 100644 --- a/chip/mt_scp/memmap.c +++ b/chip/mt_scp/memmap.c @@ -197,8 +197,8 @@ static int command_cacheinfo(int argc, char **argv) uint64_t access = ((uint64_t)SCP_CACHE_CCNT0U(c) << 32) | SCP_CACHE_CCNT0L(c); - ccprintf("%ccache hit count: %lu\n", cache_name[c], hit); - ccprintf("%ccache access count: %lu\n", cache_name[c], access); + ccprintf("%ccache hit count: %llu\n", cache_name[c], hit); + ccprintf("%ccache access count: %llu\n", cache_name[c], access); } return EC_SUCCESS; diff --git a/chip/npcx/clock.c b/chip/npcx/clock.c index ca92cbb2a7..6bb5d4962e 100644 --- a/chip/npcx/clock.c +++ b/chip/npcx/clock.c @@ -439,9 +439,9 @@ static int command_idle_stats(int argc, char **argv) ccprintf("Num idle calls that sleep: %d\n", idle_sleep_cnt); ccprintf("Num idle calls that deep-sleep: %d\n", idle_dsleep_cnt); - ccprintf("Time spent in deep-sleep: %.6lds\n", + ccprintf("Time spent in deep-sleep: %.6llds\n", idle_dsleep_time_us); - ccprintf("Total time on: %.6lds\n", ts.val); + ccprintf("Total time on: %.6llds\n", ts.val); return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(idlestats, command_idle_stats, diff --git a/chip/stm32/clock-stm32f0.c b/chip/stm32/clock-stm32f0.c index f4cd863fb1..98afba9100 100644 --- a/chip/stm32/clock-stm32f0.c +++ b/chip/stm32/clock-stm32f0.c @@ -492,9 +492,9 @@ static int command_idle_stats(int argc, char **argv) ccprintf("Num idle calls that sleep: %d\n", idle_sleep_cnt); ccprintf("Num idle calls that deep-sleep: %d\n", idle_dsleep_cnt); - ccprintf("Time spent in deep-sleep: %.6lds\n", + ccprintf("Time spent in deep-sleep: %.6llds\n", idle_dsleep_time_us); - ccprintf("Total time on: %.6lds\n", ts.val); + ccprintf("Total time on: %.6llds\n", ts.val); ccprintf("Deep-sleep closest to wake deadline: %dus\n", dsleep_recovery_margin_us); diff --git a/chip/stm32/clock-stm32h7.c b/chip/stm32/clock-stm32h7.c index 44d6e2e55a..a3ebb9aa36 100644 --- a/chip/stm32/clock-stm32h7.c +++ b/chip/stm32/clock-stm32h7.c @@ -369,9 +369,9 @@ static int command_idle_stats(int argc, char **argv) ccprintf("Num idle calls that sleep: %d\n", idle_sleep_cnt); ccprintf("Num idle calls that deep-sleep: %d\n", idle_dsleep_cnt); - ccprintf("Time spent in deep-sleep: %.6lds\n", + ccprintf("Time spent in deep-sleep: %.6llds\n", idle_dsleep_time_us); - ccprintf("Total time on: %.6lds\n", ts.val); + ccprintf("Total time on: %.6llds\n", ts.val); ccprintf("Deep-sleep closest to wake deadline: %dus\n", dsleep_recovery_margin_us); diff --git a/common/btle_ll.c b/common/btle_ll.c index 3557c9710d..ef081b9526 100644 --- a/common/btle_ll.c +++ b/common/btle_ll.c @@ -644,7 +644,7 @@ void print_connection_state(void) CPRINTF("interval(hex): %x\n", conn_params.interval); CPRINTF("latency(hex): %x\n", conn_params.latency); CPRINTF("timeout(hex): %x\n", conn_params.timeout); - CPRINTF("channel_map(hex): %lx\n", conn_params.channel_map); + CPRINTF("channel_map(hex): %llx\n", conn_params.channel_map); CPRINTF("hop(hex): %x\n", conn_params.hop_increment); CPRINTF("SCA(hex): %x\n", conn_params.sleep_clock_accuracy); CPRINTF("transmitWindowOffset: %d\n", conn_params.transmitWindowOffset); diff --git a/common/physical_presence.c b/common/physical_presence.c index 896f1a8850..8da7c8d360 100644 --- a/common/physical_presence.c +++ b/common/physical_presence.c @@ -142,7 +142,7 @@ static void physical_detect_check_press(void) mutex_lock(&pp_mutex); - CPRINTS("PP press dt=%.6ld", dt); + CPRINTS("PP press dt=%.6lld", dt); /* If we no longer care about presses, ignore them */ if (!pp_detect_in_progress()) diff --git a/common/printf.c b/common/printf.c index 3c7bc5feca..68f66815b9 100644 --- a/common/printf.c +++ b/common/printf.c @@ -226,10 +226,30 @@ int vfnprintf(int (*addchar)(void *context, int c), void *context, /* * Handle length: * %l - long + * %ll - long long * %z - size_t */ if (c == 'l') { + + /* + * For just this commit, allow both %l and %ll + * to be 64-bit. This is obviously wrong, but + * enables this change to be cherry-picked + * into firmware branches without changing + * semantics for any existing printf calls. + * This is removed in the subsequent commit on + * master. + */ flags |= PF_64BIT; + if (sizeof(long) == sizeof(uint64_t)) + flags |= PF_64BIT; + + c = *format++; + if (c == 'l') { + flags |= PF_64BIT; + c = *format++; + } + } else if (c == 'z') { if (sizeof(size_t) == sizeof(uint64_t)) flags |= PF_64BIT; diff --git a/common/timer.c b/common/timer.c index ef960b0627..843588f980 100644 --- a/common/timer.c +++ b/common/timer.c @@ -236,15 +236,15 @@ void timer_print_info(void) __hw_clock_event_get(); int tskid; - ccprintf("Time: 0x%016lx us, %11.6ld s\n" - "Deadline: 0x%016lx -> %11.6ld s from now\n" + ccprintf("Time: 0x%016llx us, %11.6lld s\n" + "Deadline: 0x%016llx -> %11.6lld s from now\n" "Active timers:\n", t.val, t.val, deadline, deadline - t.val); cflush(); for (tskid = 0; tskid < TASK_ID_COUNT; tskid++) { if (timer_running & BIT(tskid)) { - ccprintf(" Tsk %2d 0x%016lx -> %11.6ld\n", tskid, + ccprintf(" Tsk %2d 0x%016llx -> %11.6lld\n", tskid, timer_deadline[tskid].val, timer_deadline[tskid].val - t.val); cflush(); @@ -342,7 +342,7 @@ static int command_force_time(int argc, char **argv) if (*e) return EC_ERROR_PARAM2; - ccprintf("Time: 0x%016lx = %.6ld s\n", new.val, new.val); + ccprintf("Time: 0x%016llx = %.6lld s\n", new.val, new.val); force_time(new); return EC_SUCCESS; @@ -356,7 +356,7 @@ DECLARE_CONSOLE_COMMAND(forcetime, command_force_time, static int command_get_time(int argc, char **argv) { timestamp_t ts = get_time(); - ccprintf("Time: 0x%016lx = %.6ld s\n", ts.val, ts.val); + ccprintf("Time: 0x%016llx = %.6lld s\n", ts.val, ts.val); return EC_SUCCESS; } diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index b9f9738e67..98fa84452f 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -933,7 +933,7 @@ void task_print_list(void) sp++) stackused -= sizeof(uint32_t); - ccprintf("%4d %c %-16s %08x %11.6ld %3d/%3d\n", i, is_ready, + ccprintf("%4d %c %-16s %08x %11.6lld %3d/%3d\n", i, is_ready, task_names[i], tasks[i].events, tasks[i].runtime, stackused, tasks_init[i].stack_size); cflush(); @@ -961,10 +961,10 @@ int command_task_info(int argc, char **argv) ccprintf("Service calls: %11d\n", svc_calls); ccprintf("Total exceptions: %11d\n", total + svc_calls); ccprintf("Task switches: %11d\n", task_switches); - ccprintf("Task switching started: %11.6ld s\n", task_start_time); - ccprintf("Time in tasks: %11.6ld s\n", + ccprintf("Task switching started: %11.6lld s\n", task_start_time); + ccprintf("Time in tasks: %11.6lld s\n", get_time().val - task_start_time); - ccprintf("Time in exceptions: %11.6ld s\n", exc_total_time); + ccprintf("Time in exceptions: %11.6lld s\n", exc_total_time); #endif return EC_SUCCESS; diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c index d9f0e85c40..ead2bff49f 100644 --- a/core/cortex-m0/task.c +++ b/core/cortex-m0/task.c @@ -566,7 +566,7 @@ void task_print_list(void) sp++) stackused -= sizeof(uint32_t); - ccprintf("%4d %c %-16s %08x %11.6ld %3d/%3d\n", i, is_ready, + ccprintf("%4d %c %-16s %08x %11.6lld %3d/%3d\n", i, is_ready, task_names[i], tasks[i].events, tasks[i].runtime, stackused, tasks_init[i].stack_size); cflush(); @@ -594,10 +594,10 @@ int command_task_info(int argc, char **argv) ccprintf("Service calls: %11d\n", svc_calls); ccprintf("Total exceptions: %11d\n", total + svc_calls); ccprintf("Task switches: %11d\n", task_switches); - ccprintf("Task switching started: %11.6ld s\n", task_start_time); - ccprintf("Time in tasks: %11.6ld s\n", + ccprintf("Task switching started: %11.6lld s\n", task_start_time); + ccprintf("Time in tasks: %11.6lld s\n", get_time().val - task_start_time); - ccprintf("Time in exceptions: %11.6ld s\n", exc_total_time); + ccprintf("Time in exceptions: %11.6lld s\n", exc_total_time); #endif return EC_SUCCESS; diff --git a/core/minute-ia/task.c b/core/minute-ia/task.c index 5675d32992..6628e41daa 100644 --- a/core/minute-ia/task.c +++ b/core/minute-ia/task.c @@ -528,12 +528,12 @@ void task_print_list(void) if (IS_ENABLED(CONFIG_FPU)) { char use_fpu = tasks[i].use_fpu ? 'Y' : 'N'; - ccprintf("%4d %c %-16s %08x %11.6ld %3d/%3d %c\n", + ccprintf("%4d %c %-16s %08x %11.6lld %3d/%3d %c\n", i, is_ready, task_get_name(i), tasks[i].events, tasks[i].runtime, stackused, tasks_init[i].stack_size, use_fpu); } else { - ccprintf("%4d %c %-16s %08x %11.6ld %3d/%3d\n", + ccprintf("%4d %c %-16s %08x %11.6lld %3d/%3d\n", i, is_ready, task_get_name(i), tasks[i].events, tasks[i].runtime, stackused, tasks_init[i].stack_size); @@ -562,11 +562,12 @@ int command_task_info(int argc, char **argv) ccprintf("Service calls: %11d\n", svc_calls); ccprintf("Total exceptions: %11d\n", total + svc_calls); ccprintf("Task switches: %11d\n", task_switches); - ccprintf("Task switching started: %11.6ld s\n", + ccprintf("Task switching started: %11.6lld s\n", task_start_time); - ccprintf("Time in tasks: %11.6ld s\n", + ccprintf("Time in tasks: %11.6lld s\n", get_time().val - task_start_time); - ccprintf("Time in exceptions: %11.6ld s\n", exc_total_time); + ccprintf("Time in exceptions: %11.6lld s\n", + exc_total_time); } return EC_SUCCESS; diff --git a/core/nds32/task.c b/core/nds32/task.c index 389b20ba38..f86ef61ea1 100644 --- a/core/nds32/task.c +++ b/core/nds32/task.c @@ -696,7 +696,7 @@ void task_print_list(void) sp++) stackused -= sizeof(uint32_t); - ccprintf("%4d %c %-16s %08x %11.6ld %3d/%3d\n", i, is_ready, + ccprintf("%4d %c %-16s %08x %11.6lld %3d/%3d\n", i, is_ready, task_names[i], tasks[i].events, tasks[i].runtime, stackused, tasks_init[i].stack_size); cflush(); @@ -725,10 +725,10 @@ int command_task_info(int argc, char **argv) ccprintf("Service calls: %11d\n", svc_calls); ccprintf("Total exceptions: %11d\n", total + svc_calls); ccprintf("Task switches: %11d\n", task_switches); - ccprintf("Task switching started: %11.6ld s\n", task_start_time); - ccprintf("Time in tasks: %11.6ld s\n", + ccprintf("Task switching started: %11.6lld s\n", task_start_time); + ccprintf("Time in tasks: %11.6lld s\n", get_time().val - task_start_time); - ccprintf("Time in exceptions: %11.6ld s\n", exc_total_time); + ccprintf("Time in exceptions: %11.6lld s\n", exc_total_time); #endif return EC_SUCCESS; diff --git a/cts/hook/dut.c b/cts/hook/dut.c index 41c7068114..f3a52ddaf4 100644 --- a/cts/hook/dut.c +++ b/cts/hook/dut.c @@ -91,14 +91,14 @@ static enum cts_rc test_ticks(void) error_pct = (interval - HOOK_TICK_INTERVAL) * 100 / HOOK_TICK_INTERVAL; if (error_pct < -10 || 10 < error_pct) { - CPRINTS("tick error=%d%% interval=%ld", error_pct, interval); + CPRINTS("tick error=%d%% interval=%lld", error_pct, interval); return CTS_RC_FAILURE; } interval = second_time[1].val - second_time[0].val; error_pct = (interval - SECOND) * 100 / SECOND; if (error_pct < -10 || 10 < error_pct) { - CPRINTS("second error=%d%% interval=%ld", error_pct, interval); + CPRINTS("second error=%d%% interval=%lld", error_pct, interval); return CTS_RC_FAILURE; } diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c index d3381bd92c..a49ab2d7e2 100644 --- a/driver/touchpad_st.c +++ b/driver/touchpad_st.c @@ -544,8 +544,10 @@ static int st_tp_read_system_info(int reload) ST_TP_SHOW(chip0_ver); ST_TP_SHOW(scr_tx_len); ST_TP_SHOW(scr_rx_len); - ST_TP_SHOW(release_info); +#define ST_TP_SHOW64(attr) CPRINTS(#attr ": %04llx", system_info.attr) + ST_TP_SHOW64(release_info); #undef ST_TP_SHOW +#undef ST_TP_SHOW64 return ret; } @@ -1753,7 +1755,7 @@ static int st_tp_usb_set_interface(usb_uint alternate_setting, if (alternate_setting == 1) { if ((system_info.release_info & 0xFF) < ST_TP_MIN_HEATMAP_VERSION) { - CPRINTS("release version %04x doesn't support heatmap", + CPRINTS("release version %04llx doesn't support heatmap", system_info.release_info); /* Heatmap mode is not supported in this version. */ return -1; diff --git a/include/printf.h b/include/printf.h index a5243c79b4..9ae284cecc 100644 --- a/include/printf.h +++ b/include/printf.h @@ -35,8 +35,9 @@ * useful for printing times, voltages, and currents. * * Length may be: - * - 'z' = integer is sizeof(size_t) - * - 'l' = integer is 64-bit instead of native 32-bit + * - 'l' = integer is 64-bit instead of native 32-bit + * - 'll' = integer is 64-bit + * - 'z' = integer is sizeof(size_t) * * Type may be: * - 'c' - character diff --git a/power/common.c b/power/common.c index 977d46a72f..e309944b95 100644 --- a/power/common.c +++ b/power/common.c @@ -639,7 +639,7 @@ static void siglog_deferred(void) for (i = 0; i < siglog_entries; i++) { if (i) tdiff.val = siglog[i].time.val - siglog[i-1].time.val; - CPRINTF(" %.6ld +%.6ld %s => %d\n", + CPRINTF(" %.6lld +%.6lld %s => %d\n", siglog[i].time.val, tdiff.val, power_signal_get_name(siglog[i].signal), siglog[i].level); |