-
Notifications
You must be signed in to change notification settings - Fork 2k
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
core: split out library code #17652
core: split out library code #17652
Conversation
With the risk of starting bikeshedding, we could also move out the threading and scheduling code into a kernel directory and leave the library-like core bits where they are. What do you think? |
you mean doing it the other way around? keep what's now in |
Exactly, or move it to |
hm, I'd rather have the actual "core" in what would be the advantage of turning this around in this PR? (I wish we could have more than one module in a single folder, but not with the current build system) |
31a218d
to
1f688b9
Compare
+1 on the general idea, just one question: Would it make sense to move the remainder of what is now in Of course this can also be achieved by disabling the individual modules and providing the dummy implementation directly in the header (edf6019, abc30d6) but it could allow for a cleaner solution. |
Then core/ would be essentially empty, now.
what would that no_sched do? dummy implementations for the mutex/msg/thread functions? we've discussed this before (there was the idea of a single-threaded core). that does not make much sense, as, a stripped-down core (to one thread) doesn't really have much overhead here. we're talking almost no memory and a few hundred bytes of code, heavily stripped automatically by the linker. like, if mutexes and msgs are not used, they don't use up code size and negligible amounts of RAM. So, I'd suggest we cross that bridge once someone has sketched an alternative, in-tree implementation that would make this necessary. |
This is not about size alone: Riotboot does not enter thread mode, so |
Yeah, what I mean is, as long as riotboot is fine not using What I do see is that e.g., "kernel_init()" is not really a core_lib candidate. So there could be "core/" containing mostly that and maybe rmutex and scheduler independent stuff that's not pure library code, "core/sched" with the scheduling code, and "core/lib" for the auxillary libs (bitarithm, clist, ...) used by What do you think? |
The 'bootloader' implementation of But I'm not insisting on a separate core implementation, the |
yeah, that's simple.
I'm not insisting on not having a seperat core impl. for that. :) I don't know - how to move forward with this. I think moving this PR's |
Heh I just thought it would be an easy request that could make my life easier down the line - but I didn't even try do pursue that path. I'll just stick to disabling |
ae9d20d
to
b94f1ff
Compare
b94f1ff
to
b9ad818
Compare
This commit splits core into it's scheduler/IPC part and into other code that is either used or uses the scheduler, through defined APIs.
b9ad818
to
f94d72b
Compare
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.
Ack!
9dd4da0
to
343b811
Compare
343b811
to
d248b2d
Compare
And go! |
Thanks! |
Contribution description
This commit splits core into it's scheduler/IPC part and into other code
that is either used or uses the scheduler through defined APIs.
I consider this a cleanup. Some code in
core/
is actuallysys/
stuff that we just happen to keep incore/
to ensure changing it is done with care. This code is now moved tocore/lib
.Default include paths default modules have been adapted accordingly. Kconfig fixes are probably still necessary.
Why this is useful:
bootloaders don't necessarily use core/, so allowing that to not get build makes some things simpler
There's one prototype Rust reimplementation of core that works almost as drop in,
which is made possible by this PRwhich requires some way to not build the C version. The split from this PR enables that.Testing procedure
Issues/PRs references