Skip to content

Support libpldm as Zephyr module#23

Open
edersondisouza wants to merge 2 commits intoopenbmc:mainfrom
edersondisouza:zephyr
Open

Support libpldm as Zephyr module#23
edersondisouza wants to merge 2 commits intoopenbmc:mainfrom
edersondisouza:zephyr

Conversation

@edersondisouza
Copy link

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.h files to add missing bits when building on top of Zephyr, like EUCLEAN and SSIZE_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 zephyr directory.

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

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant