mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:12:45 +00:00 
			
		
		
		
	 11eee67b85
			
		
	
	
		11eee67b85
		
	
	
	
	
		
			
			Until now, our kernel has reimplemented a number of AK classes to provide automatic internal locking: - RefPtr - NonnullRefPtr - WeakPtr - Weakable This patch renames the Kernel classes so that they can coexist with the original AK classes: - RefPtr => LockRefPtr - NonnullRefPtr => NonnullLockRefPtr - WeakPtr => LockWeakPtr - Weakable => LockWeakable The goal here is to eventually get rid of the Lock* classes in favor of using external locking.
		
			
				
	
	
		
			39 lines
		
	
	
	
		
			897 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
	
		
			897 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Error.h>
 | |
| #include <AK/NonnullOwnPtr.h>
 | |
| #include <Kernel/Bus/USB/USBHub.h>
 | |
| #include <Kernel/Bus/USB/USBTransfer.h>
 | |
| #include <Kernel/Library/NonnullLockRefPtr.h>
 | |
| 
 | |
| namespace Kernel::USB {
 | |
| 
 | |
| class UHCIController;
 | |
| 
 | |
| class UHCIRootHub {
 | |
| public:
 | |
|     static ErrorOr<NonnullOwnPtr<UHCIRootHub>> try_create(NonnullLockRefPtr<UHCIController>);
 | |
| 
 | |
|     UHCIRootHub(NonnullLockRefPtr<UHCIController>);
 | |
|     ~UHCIRootHub() = default;
 | |
| 
 | |
|     ErrorOr<void> setup(Badge<UHCIController>);
 | |
| 
 | |
|     u8 device_address() const { return m_hub->address(); }
 | |
| 
 | |
|     ErrorOr<size_t> handle_control_transfer(Transfer& transfer);
 | |
| 
 | |
|     void check_for_port_updates() { m_hub->check_for_port_updates(); }
 | |
| 
 | |
| private:
 | |
|     NonnullLockRefPtr<UHCIController> m_uhci_controller;
 | |
|     LockRefPtr<Hub> m_hub;
 | |
| };
 | |
| 
 | |
| }
 |