mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:57:44 +00:00
Kernel: Move the Storage directory to be a new directory under Devices
The Storage subsystem, like the Audio and HID subsystems, exposes Unix device files (for example, in the /dev directory). To ensure consistency across the repository, we should make the Storage subsystem to reside in the Kernel/Devices directory like the two other mentioned subsystems.
This commit is contained in:
parent
f3a58f3a5a
commit
500b7b08d6
59 changed files with 133 additions and 133 deletions
59
Kernel/Devices/Storage/ATA/AHCI/InterruptHandler.h
Normal file
59
Kernel/Devices/Storage/ATA/AHCI/InterruptHandler.h
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Copyright (c) 2021-2022, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Kernel/Devices/Device.h>
|
||||
#include <Kernel/Devices/Storage/ATA/AHCI/Controller.h>
|
||||
#include <Kernel/Devices/Storage/ATA/AHCI/Port.h>
|
||||
#include <Kernel/Devices/Storage/StorageDevice.h>
|
||||
#include <Kernel/Interrupts/PCIIRQHandler.h>
|
||||
#include <Kernel/Library/LockRefPtr.h>
|
||||
#include <Kernel/Locking/Mutex.h>
|
||||
#include <Kernel/Memory/PhysicalPage.h>
|
||||
#include <Kernel/PhysicalAddress.h>
|
||||
#include <Kernel/Random.h>
|
||||
#include <Kernel/Sections.h>
|
||||
#include <Kernel/WaitQueue.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class AsyncBlockDeviceRequest;
|
||||
|
||||
class AHCIController;
|
||||
class AHCIPort;
|
||||
class AHCIInterruptHandler final : public PCIIRQHandler {
|
||||
friend class AHCIController;
|
||||
|
||||
public:
|
||||
static ErrorOr<NonnullOwnPtr<AHCIInterruptHandler>> create(AHCIController&, u8 irq, AHCI::MaskedBitField taken_ports);
|
||||
virtual ~AHCIInterruptHandler() override;
|
||||
|
||||
virtual StringView purpose() const override { return "SATA IRQ Handler"sv; }
|
||||
|
||||
bool is_responsible_for_port_index(u32 port_index) const { return m_taken_ports.is_set_at(port_index); }
|
||||
|
||||
private:
|
||||
AHCIInterruptHandler(AHCIController&, u8 irq, AHCI::MaskedBitField taken_ports);
|
||||
|
||||
void allocate_resources_and_initialize_ports();
|
||||
|
||||
//^ IRQHandler
|
||||
virtual bool handle_irq(RegisterState const&) override;
|
||||
|
||||
enum class Direction : u8 {
|
||||
Read,
|
||||
Write,
|
||||
};
|
||||
|
||||
AHCI::MaskedBitField create_pending_ports_interrupts_bitfield() const;
|
||||
|
||||
// Data members
|
||||
NonnullLockRefPtr<AHCIController> m_parent_controller;
|
||||
AHCI::MaskedBitField m_taken_ports;
|
||||
AHCI::MaskedBitField m_pending_ports_interrupts;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue