-
Notifications
You must be signed in to change notification settings - Fork 568
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
Target hooks #1942
base: master
Are you sure you want to change the base?
Target hooks #1942
Conversation
Thanks @AndrewD, this looks good. I'll review it soon. |
extern void target_init(void) __attribute__((weak)); | ||
extern void target_boot(void) __attribute__((weak)); |
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.
why not something like:
void target_nop() {}
void target_init(void) __attribute__((weak, alias("target_nop")));
void target_boot(void) __attribute__((weak, alias("target_nop")));
to avoid having to test if function exist
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.
Yes that's another alternative I onsidered.I like the fact that the test makes it's clear that it's optional, but that's personal preference.
There doesn't appear to have been any goal to minimise code size in the bios so i opted for clarity.
For |
Yes: for example a target_boot() that can validate a dtd, copy a kernel and copy then run opensbi is one such usage. |
I would also like to rename for |
- It's a 64bit not 32bit unsigned and it caused overflow/negative cycles display.
This allows the target to supply custom target_init() and target_boot() functions, eg: # add custom target specific library to the bios: src="libtarget" src_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), src)) builder.add_software_package(src, src_dir) builder.add_software_library(src)
This allows the target to supply custom target_init() and target_boot() functions, via a library linked with the bios. eg: