mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:02:46 +00:00 
			
		
		
		
	Kernel/Storage: Unify all ATA devices
There's basically no real difference in software between a SATA harddisk and IDE harddisk. The difference in the implementation is for the host bus adapter protocol and registers layout. Therefore, there's no point in putting a distinction in software to these devices. This change also greatly simplifies and removes stale APIs and removes unnecessary parameters in constructor calls, which tighten things further everywhere.
This commit is contained in:
		
							parent
							
								
									9f501d7e71
								
							
						
					
					
						commit
						741c871bc1
					
				
					 29 changed files with 352 additions and 276 deletions
				
			
		
							
								
								
									
										35
									
								
								Kernel/Storage/ATADevice.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								Kernel/Storage/ATADevice.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,35 @@ | |||
| /*
 | ||||
|  * Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il> | ||||
|  * | ||||
|  * SPDX-License-Identifier: BSD-2-Clause | ||||
|  */ | ||||
| 
 | ||||
| #include <AK/StringView.h> | ||||
| #include <Kernel/Sections.h> | ||||
| #include <Kernel/Storage/ATADevice.h> | ||||
| #include <Kernel/Storage/IDEChannel.h> | ||||
| #include <Kernel/Storage/IDEController.h> | ||||
| #include <Kernel/Storage/StorageManagement.h> | ||||
| 
 | ||||
| namespace Kernel { | ||||
| 
 | ||||
| ATADevice::ATADevice(const ATAController& controller, ATADevice::Address ata_address, unsigned minor_number, u16 capabilities, u16 logical_sector_size, u64 max_addressable_block, NonnullOwnPtr<KString> early_storage_name) | ||||
|     : StorageDevice(StorageManagement::major_number(), minor_number, logical_sector_size, max_addressable_block, move(early_storage_name)) | ||||
|     , m_controller(controller) | ||||
|     , m_ata_address(ata_address) | ||||
|     , m_capabilities(capabilities) | ||||
| { | ||||
| } | ||||
| 
 | ||||
| ATADevice::~ATADevice() | ||||
| { | ||||
| } | ||||
| 
 | ||||
| void ATADevice::start_request(AsyncBlockDeviceRequest& request) | ||||
| { | ||||
|     auto controller = m_controller.strong_ref(); | ||||
|     VERIFY(controller); | ||||
|     controller->start_request(*this, request); | ||||
| } | ||||
| 
 | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Liav A
						Liav A