-
Notifications
You must be signed in to change notification settings - Fork 89
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
libtock: Rewrite and standardize API #370
Conversation
I like this idea |
c7d056a
to
2ffda98
Compare
Note: I don't know where to put crc. In the kernel syscalls its under "Cryptography", but that seems not right. |
I've gone through and updated temperature and button to match the guide I wrote. |
@bradjc this looks great and does an excellent job formalizing the convention in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This represents a significant improvement to libtock-c and I strongly support it.
I read through all of the guide and I'm for it. We can bikeshed some names for a bit, but the plan it lays out resonates with me.
0ec8cf6
to
a756600
Compare
Couple things:
|
I am in support of this.
Could you provide some more context with this. I'm not sure I follow with what this would be / how it would look. |
One other thought for the guide file: There are some kernel assumptions regarding allow buffers. Although this is documented in the TRDs, I think we should provide a streamlined summary of how these buffers should and should not be used in this guide. For instance (copied from the the syscall TRD):
Expecting users to call the Regardless, we should codify the expected convention and use in simple terms for this guide. |
What about putting all header files in This is what zephyr does: https://github.com/zephyrproject-rtos/zephyr/tree/main/include/zephyr |
The current method of including headers causes conflicts with other libraries. For example So putting it under libtock would be a great idea (the categories also help fix this issue) |
While working on the redesign: is this the time to approach how to handle multiple instantiations of a single syscall driver? Came up again in tock/tock#3867 This could be handled with a struct for each driver that encapsulates its instantiated syscall number. Or it could be handled in the build system possibly, allowing us to include duplicate copies of a C file with a different Or we could keep punting on it as an orthogonal problem that mostly occurs for downstream users (who could just make a duplicate C file with a different name if they wanted to). |
In these approaches, how would we default to what we have now? It seems like either we would have to add additional code in the app to choose the driver numbers, or apps could configure themselves in a makefile and completely change what they are doing with no changes to code. Neither seems desirable. |
a46280f
to
c57a4c8
Compare
We need to figure out an allow buffer management strategy. What layer is responsible for un-allowing the buffer? Are buffers passed back in callbacks? Or should users of the library hold their own copy of the pointer to the buffer? |
The unit test framework stores state. Where do we put it? |
Three more issues that have come up:
|
I would also like to revisit what goes in |
Moved _write to libtock-sys since a libtock-only app should not be able to compile `printf()`.
This makes `#include <libtock/tock.h>` work.
I'm ready to merge this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is massive, and in pretty good shape / clean at the moment. I think we should merge this, and then if there's anything missing we can clean it up with patches later. I can't see this getting much better than it is in the short term.
Pushed a tag for users who would like to defer updating to the new API here: https://github.com/tock/libtock-c/releases/tag/2.x-legacy-api — merging! |
Rewrite libtock-c with a standardized format. See the guide.md file.
Progress
Apps