mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 11:22:45 +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
				
			
		|  | @ -13,10 +13,9 @@ | |||
| 
 | ||||
| namespace Kernel { | ||||
| 
 | ||||
| StorageDevice::StorageDevice(const StorageController& controller, int major, int minor, size_t sector_size, u64 max_addressable_block, NonnullOwnPtr<KString> device_name) | ||||
| StorageDevice::StorageDevice(int major, int minor, size_t sector_size, u64 max_addressable_block, NonnullOwnPtr<KString> device_name) | ||||
|     : BlockDevice(major, minor, sector_size) | ||||
|     , m_storage_controller(controller) | ||||
|     , m_storage_device_name(move(device_name)) | ||||
|     , m_early_storage_device_name(move(device_name)) | ||||
|     , m_max_addressable_block(max_addressable_block) | ||||
| { | ||||
| } | ||||
|  | @ -26,11 +25,6 @@ StringView StorageDevice::class_name() const | |||
|     return "StorageDevice"sv; | ||||
| } | ||||
| 
 | ||||
| NonnullRefPtr<StorageController> StorageDevice::controller() const | ||||
| { | ||||
|     return m_storage_controller; | ||||
| } | ||||
| 
 | ||||
| KResultOr<size_t> StorageDevice::read(OpenFileDescription&, u64 offset, UserOrKernelBuffer& outbuf, size_t len) | ||||
| { | ||||
|     unsigned index = offset / block_size(); | ||||
|  | @ -183,9 +177,9 @@ KResultOr<size_t> StorageDevice::write(OpenFileDescription&, u64 offset, const U | |||
|     return pos + remaining; | ||||
| } | ||||
| 
 | ||||
| StringView StorageDevice::storage_name() const | ||||
| StringView StorageDevice::early_storage_name() const | ||||
| { | ||||
|     return m_storage_device_name->view(); | ||||
|     return m_early_storage_device_name->view(); | ||||
| } | ||||
| 
 | ||||
| bool StorageDevice::can_write(const OpenFileDescription&, size_t offset) const | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Liav A
						Liav A