-
Notifications
You must be signed in to change notification settings - Fork 159
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
Add basic API for a global system table #1156
Add basic API for a global system table #1156
Conversation
4ae0cd6
to
1dce0ad
Compare
1dce0ad
to
8b47a44
Compare
8b47a44
to
153aea5
Compare
This is a minimal solution to providing a global system table so that users of the API don't have to pass around references to `SystemTable` / `BootServices` / `RuntimeServices` everywhere.
This method was already unsafe in practice, since it's very hard to statically ensure that no references to boot-services data exist. Change the signature to acknowledge that reality, and update the docstring with details.
153aea5
to
c04e423
Compare
Sorry for not giving the final review sooner. |
// SAFETY: the system table is valid per the requirements of `set_system_table`. | ||
unsafe { | ||
if (*st).runtime_services.is_null() { | ||
panic!("runtime services are not active"); |
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.
strictly speaking, they are also active, but not exclusively, right?
As this is the begin of a larger refactoring: Would it make sense to make a plan on what is actually needed - or what the vision is? Do we want to track things in a ..milestone, github project board or so? @nicholasbishop |
Writing up more of a plan is a good idea, I will add it to #893 |
This is a much simpler version than #905. Just the bare minimum: add functions to set and get the global system table, set the global system table in the
entry
macro, and also makeexit_boot_services
unsafe.(I would still like to go in the direction of #905, but I think we should move a little incrementally so that we have a better chance of catching mistakes along the way.)
#893
Checklist