-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
clean up how internal APIs are used #1655
Comments
by Inaky Perez-Gonzalez: The following shall be the standard to follow:
Rules:
|
by Inaky Perez-Gonzalez: Peter Mitsis , Andrew Boie can you guys provide some feedback on this before I take it to the mailing list? |
by Peter Mitsis: Three comments. If I am following the proposal correctly, the FILENAME_H will contain the relative path. I like the idea. When include files get moved or renamed, we will have to remember to modify FILENAME_H. The tree seems relatively stable for now, and I do not forsee this being a significant issue. However, in light of the upcoming unified kernel work, I think that it is worthwhile to get some additional feedback from Al Stephens as he is taking charge of that while Ben is away. It's minor, but for the comment associated with the closing #endif, I would prefer that it simply be /* !__FILENAME_H */. It is less wordy, and we already have precedence. Are there any expected exceptions to the "always put the extern declarations in a header file" rule? An example for consideration ... __do_global_ctors_aux(). The routines k_init.c::_main() and nano_init.c::_main() declare it inside their respective routines as ... |
by Inaky Perez-Gonzalez: (1) added notes about the subsystem thing. Allan Stephens , can you please chime in? (3)
should be in include/cpp-ctors.h. I see the case for having a place for internal kernel interfaces, another one for public interfaces. I would lay it out similar to Linux's:
but I hate this naming scheme... So then, that file could be in include/cpp/ctors.h, for example. But then, that being an internal API, drivers and apps in general would not see it. |
by Peter Mitsis: No objections from me. |
by Allan Stephens: I think the proposal makes sense, and don't have any objections to folks moving forward with it. However, since the upcoming unified kernel work will make significant changes to the internals of the "kernel" subsystem, and to some of the files under "include", it may make sense to wait for those changes to occur first and then do any remaining cleanup. Otherwise, you run the risk of making changes that then get thrown away. A few things to consider:
|
by Sharron LIU: Public APIs or header files re-org, without adding/removal any public APIs. All existing kernel tests will detect any regressions/side-effects introduced by this re-work. |
by Inaky Perez-Gonzalez: Allan Stephens I agree this makes sense to delay until after the kernel merge Sharron LIU the whole re-work itself will also affect public APIs, which is what we have to figure out how to do to minimize the impact (or make it easy to change to). |
by Sharron LIU: Inaky Perez-Gonzalez , when mentioning "the whole re-work itself will also affect public APIs" do you mean any public APIs adding/removal? |
by Inaky Perez-Gonzalez: Sharron LIU we might move things around to make it consistent; it is hard to tell from the get go what is going to be the best way around it, as there will be case-by -case decisions. As the micro/nano kernel merge might already be changing a big chunk of the Public API (Allan Stephens ?), it might be a good moment to move it all. |
by Andrew Boie: If Inaky Perez-Gonzalez is busy I can work on this one for 1.6. |
by Mark Linkmeyer: Fixing incorrect priority |
old and obsolete, wont fix |
Reported by Hirally Santiago:
Right now internal APIs are not consistently specified.
#2 is horrible. If these APIs need to change, all the prototypes need to be corrected. This is why header files exist in the first place.
Take inventory of our internal APIs and put them in headers as appropriate.
(Imported from Jira ZEP-56)
The text was updated successfully, but these errors were encountered: