Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/ukstore: Introduce the ukstore library #275

Closed
wants to merge 3 commits into from

Conversation

craciunoiuc
Copy link
Member

These commits introduce a new internal library to Unikraft, ukstore.
The role of this new library is to provide a standard way of passing
information getters/setters from one place to another.

The function pointers are stored in entries and entries are stored in
folders. These are structured in two different ways, statically and
dynamically. The static ones are used for information that does not
change at runtime. The dynamic ones can be added and deleted at runtime
and they are structured differently (section array of folders vs. list
of folders).

To generate sections per library the AWK tool is used together with
the build system. This library has a dependency only to nolibc.

In order to work, this, already merged, commit is needed: 9d6d855

This library is needed for the porting of Prometheus and other tracks
in the future.

This version isn't final, but it should be ready for USoC21.

Signed-off-by: Cezar Craciunoiu cezar.craciunoiu@gmail.com

The `ukstore` library has a dependency to `nolib`/`newlib` and to
`ukdebug`. As such they need to be selected to work.

The symbols exported will be provided by the `store.c` file.

The Makefile contains rules to build all files and generate files.
The Makefile first generates a list of all available libraries and
then generates two headers and a linker script to create and access
sections for each available library.

Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
This commit adds the possibility to register entries and folders at
runtime. Each library will register folders to itself. Entries can
be registered to the folders afterwards if the name is known.

The entries contain the getters/setters used in passing information.
Overall, the dynamic API provides calls to register, free and call
entries.

All calls are wrapped in macros, meaning that unchecking the library
will not break existing builds. The dynamic version calls of the
library should still be enclosed in ifdefs to ensure that everything
works correctly.

Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
This commit introduces a method to allocate static elements in library
sections. Each library has its own section generated at build.
This type of entries do not take up time and are not modified.
Also, these entries do not use folders (the folder is the section).

These will be used to pass system information getters/setters
throughout the system in an easy-enough manner. Interaction with this
type of entries is done through the same API as the dynamic ones.

Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
@razvand razvand closed this Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ⛔️ Wontmerge
Development

Successfully merging this pull request may close these issues.

None yet

2 participants