File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
uefi-test-runner/src/proto/console Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ pub fn test(image: Handle, st: &mut SystemTable<Boot>) {
66 stdout:: test ( st. stdout ( ) ) ;
77
88 let bt = st. boot_services ( ) ;
9- serial:: test ( bt) ;
9+ serial:: test ( image , bt) ;
1010 gop:: test ( image, bt) ;
1111 pointer:: test ( image, bt) ;
1212}
Original file line number Diff line number Diff line change 11use uefi:: proto:: console:: serial:: { ControlBits , Serial } ;
2- use uefi:: table:: boot:: BootServices ;
2+ use uefi:: table:: boot:: { BootServices , OpenProtocolAttributes , OpenProtocolParams } ;
3+ use uefi:: Handle ;
34
4- pub fn test ( bt : & BootServices ) {
5+ pub fn test ( image : Handle , bt : & BootServices ) {
56 info ! ( "Running serial protocol test" ) ;
6- if let Ok ( serial) = bt. locate_protocol :: < Serial > ( ) {
7+ if let Ok ( handle) = bt. get_handle_for_protocol :: < Serial > ( ) {
8+ let mut serial = bt
9+ . open_protocol :: < Serial > (
10+ OpenProtocolParams {
11+ handle,
12+ agent : image,
13+ controller : None ,
14+ } ,
15+ // For this test, don't open in exclusive mode. That
16+ // would break the connection between stdout and the
17+ // serial device.
18+ OpenProtocolAttributes :: GetProtocol ,
19+ )
20+ . expect ( "failed to open serial protocol" ) ;
721 // BUG: there are multiple failures in the serial tests on AArch64
822 if cfg ! ( target_arch = "aarch64" ) {
923 return ;
1024 }
1125
12- let serial = unsafe { & mut * serial. get ( ) } ;
13-
1426 let old_ctrl_bits = serial
1527 . get_control_bits ( )
1628 . expect ( "Failed to get device control bits" ) ;
You can’t perform that action at this time.
0 commit comments