-
-
Notifications
You must be signed in to change notification settings - Fork 177
EFI Shell Interface: CurDir Functions #1740
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
EFI Shell Interface: CurDir Functions #1740
Conversation
This commit implements wrappers for the following EFI Shell Protocol functions: set_cur_dir() and get_cur_dir().
This commit includes tests for the following EFI Shell Protocol functions: get_cur_dir() and set_cur_dir().
…h standard convention
4bef474
to
873e382
Compare
Hi Philipp. Thanks for catching these! It looks like when rebasing the commits, although I removed references to the other PR from the commit messages I neglected to do so from the code in all but the most recent commit. I've addressed it now and will also do so shortly for #1679. |
uefi/src/proto/shell/mod.rs
Outdated
@@ -2,12 +2,64 @@ | |||
|
|||
//! EFI Shell Protocol v2.2 | |||
|
|||
use crate::proto::unsafe_protocol; | |||
use uefi_macros::unsafe_protocol; |
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.
We're not entirely consistent in this project, but I'd prefer to use crate::proto::unsafe_protocol
.
uefi/src/proto/shell/mod.rs
Outdated
/// * `Some(cwd)` - CStr16 containing the current working directory | ||
/// * `None` - Could not retrieve current directory | ||
#[must_use] | ||
pub fn current_dir(&self, file_system_mapping: Option<&CStr16>) -> Option<&CStr16> { |
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.
This should return Result
. That does mean we need to pick an error code. I think Status::NOT_FOUND
should work fine.
uefi/src/proto/shell/mod.rs
Outdated
#[unsafe_protocol(ShellProtocol::GUID)] | ||
pub struct Shell(ShellProtocol); | ||
impl Shell { | ||
/// Returns the current directory on the specified device |
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: period at end of sentence.
uefi/src/proto/shell/mod.rs
Outdated
/// # Arguments | ||
/// | ||
/// * `file_system` - Pointer to the file system's mapped name. | ||
/// * `directory` - Points to the directory on the device specified by |
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.
Drop the Pointer
/Points to
. E.g. file_system
- File system's mapped name.`
938b425
to
3b60964
Compare
3b60964
to
175340a
Compare
Co-authored-by: Nicholas Bishop <nbishop@nbishop.net>
175340a
to
18953be
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.
Lgtm, thanks :)
This PR implements the wrappers for the
GetCurDir
andSetCurDir
EFI Shell Protocol functions as part of the effort to address #448 .Checklist