diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2021-01-08 15:07:05 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-09 01:40:05 +0000 |
commit | ba9df2aa09deeae5d851c59469d782b1a7a0efe4 (patch) | |
tree | 6c7b2e8fcc6f4c6644e04a21c6d303372a10a056 /zephyr/test/hooks/CMakeLists.txt | |
parent | 61a46cf57de2a1805c5e686ead580958b9cbc667 (diff) | |
download | chrome-ec-ba9df2aa09deeae5d851c59469d782b1a7a0efe4.tar.gz |
zephyr: switch to platform/ec printf format implementation
Prior to this change, the cprints and cprintf shim implementations
used Zephyr's printk to do the output formatting.
Our EC code has some custom printf specifiers not supported by
Zephyr's printk. We've already attempted to send some of our custom
specifiers upstream, but upstream does not want them:
https://github.com/zephyrproject-rtos/zephyr/pull/28882
The logical thing to do would be to bring in the vfnprintf function
from our EC to the Zephyr build, and use that to do the output
formatting instead. That's what this CL does.
The binary cost of brining in this second printf implementation
appears to be minimal (952 bytes on volteer).
BUG=b:177065615
BRANCH=none
TEST=on posix-ec and volteer, run gettime and observe output no longer
contains %.6lld, but instead the correct system time
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I53cd4edf129223c12a2c5e7d0519623a8d07a328
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2618575
Diffstat (limited to 'zephyr/test/hooks/CMakeLists.txt')
-rw-r--r-- | zephyr/test/hooks/CMakeLists.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/zephyr/test/hooks/CMakeLists.txt b/zephyr/test/hooks/CMakeLists.txt index e44ebfe674..2236963762 100644 --- a/zephyr/test/hooks/CMakeLists.txt +++ b/zephyr/test/hooks/CMakeLists.txt @@ -23,5 +23,7 @@ zephyr_include_directories( # Include test file, test under test and console dependency target_sources(app PRIVATE hooks.c) +target_sources(app PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../../common/printf.c") target_sources(app PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../shim/src/hooks.c") target_sources(app PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../shim/src/console.c") +target_sources(app PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../shim/src/util.c") |