-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Document where APIs can be called from using doxygen #21061
Comments
We need the possibility to make the statement depending on parameters. |
Are threads and ISRs the only calling contexts that matter? What about userspace vs kernel, and pre-kernel init levels? Does or will Zephyr support multiple privilege levels? @alexanderwachter true, and hopefully that would be specified for all ISR-callable blocking (yielding) APIs. I have no issues with something like this as part of a solution to #18970, but it doesn't eliminate the need for #20959. |
This was just an example, initialization, userspace and supervisor modes are other contexts that can be added to this tag.
This RFC is not trying eliminate anything, having the terminology well defined is a good thing indeed. Need to see this in the final form though and submitted to the right location in the documentation so we can move forward with this. |
API meeting: Agreement on name: Function properties
|
API meeting 19th May:
|
This is dependent on #18970, or at least needs to be coordinated with it. |
Similar ideas are used by ChibiOS/RT but with simpler (imo) Doxygen ALIASES: https://github.com/ChibiOS/ChibiOS/blob/master/doc/rt/Doxyfile_chm#L241 Looking here you can see the different classes being used: https://github.com/ChibiOS/ChibiOS/blob/master/os/rt/src/chmtx.c there's http://chibiforge.org/doc/20.3/full_rm/group__mutexes.html#ga01630802b66eae988109e8a78147e988 |
yes and I like those, however, how do you get those to show in sphinx? |
ChibiOS/RT does not use Sphinx at all. I see your point and I will check out how to do it properly. The main reason for my suggestion was that I find it hard to enforce the correctness of the parameters passed to |
@nashif #29483 should already render \xrefitem, so this issue can move forward. It looks like this: breathe-doc/breathe#589 (comment) I also have a PR which is already functional to build all cross-reference pages, which with a bit more polishing should eventually land on Breathe: breathe-doc/breathe#593 |
@carlescufi Could you assign this to me or can I do it? |
Introduction
Right now we have no standard way for documenting what APIs can be called from where and if they for example are allowed to be called from thread context or ISR context or if they can be used during initialization of the system for example.
Problem description
Documentation of the above is spread around the project either in the implementation itself or in the API docs or in the guides, but there is no 1 single place where we reliably and consistently document this.
Proposed change
Use a custom tag in doxygen to document the context from which an API can be called from
Detailed RFC
Add a new alias to doxygen (@allowed_from) and use it consistently to document from what contexts APIs are allowed to be called.
Proposed change (Detailed)
for example:
will allow us to do this:
which will result in:
instead of what we have now:
The above will also generate 1 single page with all the information:
Dependencies
Doxygen changes
Concerns and Unresolved Questions
How do we enforce this for example?
Alternatives
Alternative is to create some table or adhoc documentation that will always be out of sync. If we make this a requirement for any new API, then we can always rely on the autogenerated doxygen documentation.
The text was updated successfully, but these errors were encountered: