@@ -115,7 +115,6 @@ int storage_device_ahci_block_read(void* dev, uint64_t start, uint32_t bytes, un
115115 if (!sd ) {
116116 return 0 ;
117117 }
118- dprintf ("storage_device_ahci_block_read bytes=%d\n" , bytes );
119118 uint32_t divided_length = bytes / sd -> block_size ;
120119 ahci_hba_mem_t * abar = (ahci_hba_mem_t * )sd -> opaque2 ;
121120 ahci_hba_port_t * port = & abar -> ports [sd -> opaque1 ];
@@ -129,8 +128,6 @@ int storage_device_ahci_block_read(void* dev, uint64_t start, uint32_t bytes, un
129128
130129 size_t max_per_read = AHCI_DEV_SATAPI ? 1 : 16 ;
131130
132- dprintf ("divided length: %d\n" , divided_length );
133-
134131 if (divided_length < max_per_read ) {
135132 return check_type (port ) == AHCI_DEV_SATAPI ? ahci_atapi_read (port , start , divided_length , (uint16_t * )buffer , abar ) : ahci_read (port , start , divided_length , (uint16_t * )buffer , abar );
136133 }
@@ -296,7 +293,7 @@ bool ahci_read(ahci_hba_port_t *port, uint64_t start, uint32_t count, uint16_t *
296293 spin ++ ;
297294 }
298295 if (spin == 1000000 ) {
299- dprintf ("Port hung (start %llx count %llx )\n" , start , count );
296+ dprintf ("Port hung (start %lx count %x )\n" , start , count );
300297 return false;
301298 }
302299
@@ -309,14 +306,14 @@ bool ahci_read(ahci_hba_port_t *port, uint64_t start, uint32_t count, uint16_t *
309306 if ((port -> ci & (1 <<slot )) == 0 )
310307 break ;
311308 if (port -> is & HBA_PxIS_TFES ) { // Task file error
312- dprintf ("Read disk error (start %llx count %llx )\n" , start , count );
309+ dprintf ("Read disk error (start %lx count %x )\n" , start , count );
313310 return false;
314311 }
315312 }
316313
317314 // Check again
318315 if (port -> is & HBA_PxIS_TFES ) {
319- dprintf ("Read disk error (start %llx count %llx )\n" , start , count );
316+ dprintf ("Read disk error (start %lx count %x )\n" , start , count );
320317 return false;
321318 }
322319
@@ -414,8 +411,6 @@ bool ahci_atapi_read(ahci_hba_port_t *port, uint64_t start, uint32_t count, uint
414411 return false;
415412 }
416413
417- dprintf ("ahci_atapi_read %d %d %016x\n" , start , count , buf );
418-
419414 ahci_hba_cmd_header_t * cmdheader = (ahci_hba_cmd_header_t * )(uint64_t )(port -> clb );
420415 cmdheader += slot ;
421416
@@ -463,7 +458,7 @@ bool ahci_atapi_read(ahci_hba_port_t *port, uint64_t start, uint32_t count, uint
463458 };
464459
465460 if (spin == 1000000 ) {
466- dprintf ("Port hung [atapi] (start %llx count %llx )\n" , start , count );
461+ dprintf ("Port hung [atapi] (start %lx count %x )\n" , start , count );
467462 return false;
468463 }
469464
@@ -472,13 +467,13 @@ bool ahci_atapi_read(ahci_hba_port_t *port, uint64_t start, uint32_t count, uint
472467 while (true) {
473468 if ((port -> ci & (1 <<slot )) == 0 ) break ;
474469 if (port -> is & HBA_PxIS_TFES ) {
475- dprintf ("Read disk error [atapi] (start %llx count %llx )\n" , start , count );
470+ dprintf ("Read disk error [atapi] (start %lx count %x )\n" , start , count );
476471 return false;
477472 }
478473 }
479474
480475 if (port -> is & HBA_PxIS_TFES ) {
481- dprintf ("Read disk error [atapi] (start %llx count %llx )\n" , start , count );
476+ dprintf ("Read disk error [atapi] (start %lx count %x )\n" , start , count );
482477 return false;
483478 }
484479
@@ -548,7 +543,7 @@ bool ahci_write(ahci_hba_port_t *port, uint64_t start, uint32_t count, char *buf
548543 spin ++ ;
549544 }
550545 if (spin == 1000000 ) {
551- dprintf ("Port hung [write] (start %llx count %llx )\n" , start , count );
546+ dprintf ("Port hung [write] (start %lx count %x )\n" , start , count );
552547 return false;
553548 }
554549
@@ -559,14 +554,14 @@ bool ahci_write(ahci_hba_port_t *port, uint64_t start, uint32_t count, char *buf
559554 if ((port -> ci & (1 <<slot )) == 0 )
560555 break ;
561556 if (port -> is & HBA_PxIS_TFES ) { // Task file error
562- dprintf ("Write disk error (start %llx count %llx )\n" , start , count );
557+ dprintf ("Write disk error (start %lx count %x )\n" , start , count );
563558 return false;
564559 }
565560 }
566561
567562 // Check again
568563 if (port -> is & HBA_PxIS_TFES ) {
569- dprintf ("Write disk error (start %llx count %llx )\n" , start , count );
564+ dprintf ("Write disk error (start %lx count %x )\n" , start , count );
570565 return false;
571566 }
572567
@@ -595,7 +590,7 @@ void init_ahci()
595590
596591 ahci_base = pci_mem_base (ahci_base );
597592 uint32_t irq_num = pci_setup_interrupt ("AHCI" , ahci_device , logical_cpu_id (), ahci_handler , ahci_base );
598- dprintf ("AHCI base MMIO: %08x INT %d\n" , ahci_base , irq_num );
593+ dprintf ("AHCI base MMIO: %lx INT %d\n" , ahci_base , irq_num );
599594
600595 probe_port ((ahci_hba_mem_t * )ahci_base , ahci_device );
601596}
0 commit comments