File tree 2 files changed +18
-6
lines changed
uefi-test-runner/src/proto/console
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>) {
6
6
stdout:: test ( st. stdout ( ) ) ;
7
7
8
8
let bt = st. boot_services ( ) ;
9
- serial:: test ( bt) ;
9
+ serial:: test ( image , bt) ;
10
10
gop:: test ( image, bt) ;
11
11
pointer:: test ( image, bt) ;
12
12
}
Original file line number Diff line number Diff line change 1
1
use uefi:: proto:: console:: serial:: { ControlBits , Serial } ;
2
- use uefi:: table:: boot:: BootServices ;
2
+ use uefi:: table:: boot:: { BootServices , OpenProtocolAttributes , OpenProtocolParams } ;
3
+ use uefi:: Handle ;
3
4
4
- pub fn test ( bt : & BootServices ) {
5
+ pub fn test ( image : Handle , bt : & BootServices ) {
5
6
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" ) ;
7
21
// BUG: there are multiple failures in the serial tests on AArch64
8
22
if cfg ! ( target_arch = "aarch64" ) {
9
23
return ;
10
24
}
11
25
12
- let serial = unsafe { & mut * serial. get ( ) } ;
13
-
14
26
let old_ctrl_bits = serial
15
27
. get_control_bits ( )
16
28
. expect ( "Failed to get device control bits" ) ;
You can’t perform that action at this time.
0 commit comments