@@ -7,14 +7,22 @@ fn windows_pic_debug_log(message: impl AsRef<str>) {
77 if !* VALUE . get_or_init ( || {
88 std:: env:: var ( "LIBKRUN_WINDOWS_VERBOSE_DEBUG" )
99 . or_else ( |_| std:: env:: var ( "LIBKRUN_WINDOWS_IO_DEBUG" ) )
10- . map ( |v| matches ! ( v. trim( ) . to_ascii_lowercase( ) . as_str( ) , "1" | "true" | "yes" | "on" ) )
10+ . map ( |v| {
11+ matches ! (
12+ v. trim( ) . to_ascii_lowercase( ) . as_str( ) ,
13+ "1" | "true" | "yes" | "on"
14+ )
15+ } )
1116 . unwrap_or ( false )
1217 } ) {
1318 return ;
1419 }
1520 use std:: io:: Write ;
1621
17- for path in [ r"C:\Users\18770\.a3s\libkrun-whpx-io-current.log" , "tmp_whpx_io.log" ] {
22+ for path in [
23+ r"C:\Users\18770\.a3s\libkrun-whpx-io-current.log" ,
24+ "tmp_whpx_io.log" ,
25+ ] {
1826 if let Ok ( mut file) = std:: fs:: OpenOptions :: new ( )
1927 . create ( true )
2028 . append ( true )
@@ -117,7 +125,12 @@ impl PicState {
117125 // edge becomes deliverable again.
118126 self . clear_pending_irq_without_in_service ( irq) ;
119127 }
120- log:: debug!( "PIC {}: specific EOI command 0x{:02x} irq={}" , name, value, irq) ;
128+ log:: debug!(
129+ "PIC {}: specific EOI command 0x{:02x} irq={}" ,
130+ name,
131+ value,
132+ irq
133+ ) ;
121134 windows_pic_debug_log ( format ! (
122135 "[PIC] {} eoi cmd=0x{:02x} specific=true irq={} irr=0x{:02x} in_service=0x{:02x}" ,
123136 name, value, irq, self . irr, self . in_service
@@ -139,8 +152,7 @@ impl PicState {
139152 ) ;
140153 windows_pic_debug_log ( format ! (
141154 "[PIC] {} icw2 vector_base=0x{:02x}" ,
142- name,
143- self . vector_offset
155+ name, self . vector_offset
144156 ) ) ;
145157 }
146158 InitState :: ExpectIcw3 => {
@@ -160,9 +172,7 @@ impl PicState {
160172 ) ;
161173 windows_pic_debug_log ( format ! (
162174 "[PIC] {} icw4=0x{:02x} initialized auto_eoi={}" ,
163- name,
164- value,
165- self . auto_eoi
175+ name, value, self . auto_eoi
166176 ) ) ;
167177 }
168178 InitState :: Ready => {
@@ -173,11 +183,7 @@ impl PicState {
173183 self . mask,
174184 ( self . mask & 0x01 ) != 0
175185 ) ;
176- windows_pic_debug_log ( format ! (
177- "[PIC] {} ocw1 mask=0x{:02x}" ,
178- name,
179- self . mask
180- ) ) ;
186+ windows_pic_debug_log ( format ! ( "[PIC] {} ocw1 mask=0x{:02x}" , name, self . mask) ) ;
181187 }
182188 }
183189 }
0 commit comments