-
- Notifications
You must be signed in to change notification settings - Fork 180
WIP: Use global system table pointer #905
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
WIP: Use global system table pointer #905
Conversation
d532979
to 182bec4
Compare 182bec4
to adf3c90
Compare adf3c90
to 1de3d6a
Compare b30c0b8
to e9c03c1
Compare a4b4e22
to c4fc968
Compare I'm wondering what's the right way forward here.
|
uefi/src/system.rs Outdated
| ||
/// TODO | ||
pub unsafe fn set_system_table(system_table: *mut uefi_raw::table::system::SystemTable) { | ||
SYSTEM_TABLE.store(system_table, Ordering::Release); |
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.
nit: This should use a Once
-like type in the background. It should not be possible to set this multiple times.
I think something like AtomicOnce<uefi_raw::table::system::SystemTable>
would be cool. Same for image handle.
uefi/src/system.rs Outdated
/// Return the firmware vendor string | ||
#[must_use] | ||
pub fn firmware_vendor() -> &'static CStr16 { | ||
unsafe { CStr16::from_ptr(system_table().as_mut().firmware_vendor.cast()) } |
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 did you decide to use functions here and not a new type having associated functions/methods?
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.
I left some notes here: #893 (comment)
Since there's no longer any struct or lifetime involved, I think these functions are similar to https://doc.rust-lang.org/std/env/#functions; no point attaching them to an empty struct.
Once I find a spare bit of time I'll re-familiarize myself with the content of this PR, make some updates, and remove the draft marker. |
515a508
to 19db510
Compare I realized I was probably trying to do too much in one PR, so I've opened a simpler one to start things off: #1156 |
19db510
to 4589fd0
Compare 4589fd0
to 5006182
Compare This will allow some code to be shared with the upcoming `uefi::boot` module.
The initial version here just provides functions for getting and setting the system time. Later commits will add functions to get/set variables, handle update capsules, etc. Also added some tests for the new code in the test runner (note that there were no existing tests for the time-related functions of `RuntimeServices`).
5006182
to 0f33a5c
Compare 0f33a5c
to 6b67b86
Compare Is there any reason to keep this MR open, @nicholasbishop ? |
Nope, at this point it has served its purpose. |
For #893
Checklist