mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:52:45 +00:00 
			
		
		
		
	Kernel: Add bar_address_mask to mask the last 4 bits of a BAR address
Create a bar_address_mask constant to mask the last 4 bits of a BAR address instead of hand coding the mask all over the kernel.
This commit is contained in:
		
							parent
							
								
									20d517f1da
								
							
						
					
					
						commit
						83b87a5ade
					
				
					 8 changed files with 14 additions and 15 deletions
				
			
		|  | @ -40,7 +40,7 @@ UNMAP_AFTER_INIT ErrorOr<void> NVMeController::initialize(bool is_queue_polled) | |||
| 
 | ||||
|     PCI::enable_memory_space(device_identifier()); | ||||
|     PCI::enable_bus_mastering(device_identifier()); | ||||
|     m_bar = PCI::get_BAR0(device_identifier()) & BAR_ADDR_MASK; | ||||
|     m_bar = PCI::get_BAR0(device_identifier()) & PCI::bar_address_mask; | ||||
|     static_assert(sizeof(ControllerRegister) == REG_SQ0TDBL_START); | ||||
|     static_assert(sizeof(NVMeSubmission) == (1 << SQ_WIDTH)); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Pankaj Raghav
						Pankaj Raghav