-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Cleanup of init/device and kernel internal headers #93323
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
base: main
Are you sure you want to change the base?
Conversation
3fb599e
to
6f592fa
Compare
34833e7
to
61932ec
Compare
Maybe time for a |
zephyr_library_sources( | ||
init.c | ||
) | ||
zephyr_library_sources_ifdef(CONFIG_XIP |
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.
LGTM. Only code style could be improved here:
zephyr_library_sources(init.c)
zephyr_library_sources_ifdef(CONFIG_XIP xip.c)
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.
Looks good here. I particularly love the isolation of arch/common code, makes a lot of our memory setup initialization less confusing.
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.
besides a small nit looks good
kernel/boot_args.c
Outdated
@@ -2,10 +2,10 @@ | |||
* Copyright The Zephyr Project contributors | |||
*/ | |||
|
|||
#include <zephyr/sys/util.h> |
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.
just a nit, but maybe you could move this change in the previous commit
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.
LGTM 👍
Not really a kernel feature, more for architecture, which is reflected in how XIP is enabled and tested. Move it to architecture code to keep which much of the 'implementation' and usage is. Signed-off-by: Anas Nashif <[email protected]>
Move under arch, as this is not a kernel feature really. arch also matches the test idcentifier in place. Signed-off-by: Anas Nashif <[email protected]>
Move under arch, as this is not a kernel feature really. arch also matches the test idcentifier in place. Signed-off-by: Anas Nashif <[email protected]>
Move under arch, as this is not a kernel feature really. arch also matches the test idcentifier in place. Signed-off-by: Anas Nashif <[email protected]>
Cleanup init.c code and move early boot code into arch/ and make it accessible outside of the boot process/kernel. All of this code is not related to the 'kernel' and is mostly used within the architecture boot / setup process. The way it was done, some soc code was including kernel_internal.h directly, which shouldn't be done. Signed-off-by: Anas Nashif <[email protected]>
No reason for this to be part of already packed init.c. Moved to own file and build only when BOOTARGS are enabled. Signed-off-by: Anas Nashif <[email protected]>
Cleanup kconfig of bootargs and put everything in one menuconfig. Signed-off-by: Anas Nashif <[email protected]>
Move device model syscalls to device.c and decouple kernel header from device related routines. Cleanup init to have only what is needed. Signed-off-by: Anas Nashif <[email protected]>
simplify cmake file and use macros for adding files that are part of the kernel based on the configuration. Signed-off-by: Anas Nashif <[email protected]>
Do not use private API prefix and move to architecture interface as those functions are primarily used across arches and can be defined by the architecture. Signed-off-by: Anas Nashif <[email protected]>
Do not use private API prefix and move to architecture interface as those functions are primarily used across arches and can be defined by the architecture. Signed-off-by: Anas Nashif <[email protected]>
Do not use private API prefix and move to architecture interface as those functions are primarily used across arches and can be defined by the architecture. Signed-off-by: Anas Nashif <[email protected]>
Do not use private API prefix and move to architecture interface as those functions are primarily used across arches and can be defined by the architecture. Signed-off-by: Anas Nashif <[email protected]>
Declare z_interrupt_stacks as extern. Signed-off-by: Anas Nashif <[email protected]>
Declare z_cstart as extern as otherwise we will need to pull in kernel_internal.h. Signed-off-by: Anas Nashif <[email protected]>
336804f
61932ec
to
336804f
Compare
rebased |
|
@@ -18,6 +18,7 @@ | |||
|
|||
extern void z_prep_c(void); | |||
extern void esp_reset_reason_init(void); | |||
extern FUNC_NORETURN void z_cstart(void); |
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.
With how things are currently structured, declaring z_cstart() here is not necessary as it is not called within this file. However, z_prep_c() is called, which in turn calls z_cstart(). This also applies to esp32s2 and esp32s3.
Started when I noticed soc code including kernel_internal.h. Then i started finding other oddities and misplaced code.
Cleanup of init.c which was getting overloaded with too many functions used by arch and soc code and remove unrelated declarations from kernel_internal.h which were forcing some non-kernel code to include kernel_internal.h
No functional changes, only code movements and header cleanup`