Open
Conversation
Using our own version will allow to support systems/toolchains that have "byteorder.h" in different locations. Signed-off-by: Ederson de Souza <[email protected]>
Besides adding the `zephyr` directory with modules files, this patch leverages "compiler.h" to provide missing bits for Zephyr support: - Define `EUCLEAN`; - Define `SSIZE_MAX`; - Use Zephyr functions for byte ordering operations; - Define `static_assert` as Zephyr's `BUILD_ASSERT` when needed. Note that support mainly focuses on libpldm enconding/decoding capabilities. As "instance-db" and "transport" are dependent on Linux filesystem and networking capabilities, they are not supported at this moment. Signed-off-by: Ederson de Souza <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support to directly use libpldm from Zephyr. Not all of libpldm is currently supported: focus is on the encoding/decoding bits. Transport and instance-db rely on Linux stuff and is left out for now.
Changes
This patch basically leverages the
compiler.hfiles to add missing bits when building on top of Zephyr, likeEUCLEANandSSIZE_MAX. It also uses, for Zephyr, its versions of "byteorder.h" functions.On top of that, it adds the necessary files to build libpldm as a Zephyr module. They are contained inside the
zephyrdirectory.Why change things on the library? Why not keep changes on Zephyr?
The simple answer is that it creates technical debt. It is not uncommon for libraries to have some "glue" to support different operating systems. And it's not different for Zephyr - indeed, here are three examples of libraries which have support for Zephyr on their upstreams:
Please review - I'm happy to get comments, questions, suggestions, etc =D