mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 15:50:18 +00:00
chore(doc): document media loader safety
This commit is contained in:
@@ -51,6 +51,11 @@ impl MediaLoaderHandle {
|
|||||||
/// The next call will pass a buffer of the right size, and we should copy
|
/// The next call will pass a buffer of the right size, and we should copy
|
||||||
/// data into that buffer, checking whether it is safe to copy based on
|
/// data into that buffer, checking whether it is safe to copy based on
|
||||||
/// the buffer size.
|
/// the buffer size.
|
||||||
|
///
|
||||||
|
/// SAFETY: `this.address` and `this.length` are set by leaking a Box<[u8]>, so we can
|
||||||
|
/// be sure their pointers are valid when this is called. The caller must call this function
|
||||||
|
/// while inside UEFI boot services to ensure pointers are valid. Copying to `buffer` is
|
||||||
|
/// assumed valid because the caller must ensure `buffer` is valid by function contract.
|
||||||
unsafe extern "efiapi" fn load_file(
|
unsafe extern "efiapi" fn load_file(
|
||||||
this: *mut MediaLoaderProtocol,
|
this: *mut MediaLoaderProtocol,
|
||||||
file_path: *const DevicePathProtocol,
|
file_path: *const DevicePathProtocol,
|
||||||
|
|||||||
Reference in New Issue
Block a user