1- use core:: cell:: UnsafeCell ;
21use uefi:: proto:: Protocol ;
32use uefi:: table:: boot:: { BootServices , SearchType } ;
43use uefi:: { Handle , Result } ;
@@ -9,11 +8,6 @@ use crate::alloc::vec::Vec;
98pub trait BootServicesExt {
109 /// Returns all the handles implementing a certain protocol.
1110 fn find_handles < P : Protocol > ( & self ) -> Result < Vec < Handle > > ;
12-
13- /// Returns a protocol implementation, if present on the system.
14- ///
15- /// The caveats of `BootServices::handle_protocol()` also apply here.
16- fn find_protocol < P : Protocol > ( & self ) -> Result < & UnsafeCell < P > > ;
1711}
1812
1913impl BootServicesExt for BootServices {
@@ -44,23 +38,4 @@ impl BootServicesExt for BootServices {
4438 . into_with_val ( || buffer)
4539 . map ( |completion| completion. with_status ( status2) )
4640 }
47-
48- fn find_protocol < P : Protocol > ( & self ) -> Result < & UnsafeCell < P > > {
49- // Retrieve all handles implementing this.
50- let ( status1, handles) = self . find_handles :: < P > ( ) ?. split ( ) ;
51-
52- // There should be at least one, otherwise find_handles would have
53- // aborted with a NOT_FOUND error.
54- let handle = * handles. first ( ) . unwrap ( ) ;
55-
56- // Similarly, if the search is implemented properly, trying to open
57- // the first output handle should always succeed
58- // FIXME: Consider using the EFI 1.1 LocateProtocol API instead
59- let ( status2, protocol) = self . handle_protocol :: < P > ( handle) ?. split ( ) ;
60-
61- // Emit output, with warnings
62- status1
63- . into_with_val ( || protocol)
64- . map ( |completion| completion. with_status ( status2) )
65- }
6641}
0 commit comments