mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:42:43 +00:00 
			
		
		
		
	 b91c49364d
			
		
	
	
		b91c49364d
		
	
	
	
	
		
			
			This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
		
			
				
	
	
		
			46 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <AK/Memory.h>
 | |
| #include <AK/StringView.h>
 | |
| #include <Kernel/FileSystem/FileDescription.h>
 | |
| #include <Kernel/Storage/AHCIController.h>
 | |
| #include <Kernel/Storage/IDEChannel.h>
 | |
| #include <Kernel/Storage/SATADiskDevice.h>
 | |
| 
 | |
| namespace Kernel {
 | |
| 
 | |
| NonnullRefPtr<SATADiskDevice> SATADiskDevice::create(const AHCIController& controller, const AHCIPort& port, size_t sector_size, u64 max_addressable_block)
 | |
| {
 | |
|     return adopt_ref(*new SATADiskDevice(controller, port, sector_size, max_addressable_block));
 | |
| }
 | |
| 
 | |
| SATADiskDevice::SATADiskDevice(const AHCIController& controller, const AHCIPort& port, size_t sector_size, u64 max_addressable_block)
 | |
|     : StorageDevice(controller, sector_size, max_addressable_block)
 | |
|     , m_port(port)
 | |
| {
 | |
| }
 | |
| 
 | |
| SATADiskDevice::~SATADiskDevice()
 | |
| {
 | |
| }
 | |
| 
 | |
| const char* SATADiskDevice::class_name() const
 | |
| {
 | |
|     return "SATADiskDevice";
 | |
| }
 | |
| 
 | |
| void SATADiskDevice::start_request(AsyncBlockDeviceRequest& request)
 | |
| {
 | |
|     m_port->start_request(request);
 | |
| }
 | |
| 
 | |
| String SATADiskDevice::device_name() const
 | |
| {
 | |
|     return String::formatted("hd{:c}", 'a' + minor());
 | |
| }
 | |
| 
 | |
| }
 |