1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 01:27:44 +00:00

Kernel: Add driver for interrupt controller on the Raspberry Pi

This implements the simpler IRQController class and adds a
pending_interrupts() function to the class.
This commit is contained in:
Timon Kruiper 2022-05-30 09:30:11 +02:00 committed by Linus Groh
parent f085903f62
commit 5eac2b9f33
4 changed files with 111 additions and 0 deletions

View file

@ -0,0 +1,39 @@
/*
* Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Types.h>
#include <Kernel/Arch/aarch64/IRQController.h>
namespace Kernel::RPi {
struct InterruptControllerRegisters;
// This class implements the simple Interrupt Controller found in the BCM2837. (RPi3)
// A description of this device can be found at chapter 7 (Interrupts) of the manual:
// https://github.com/raspberrypi/documentation/files/1888662/BCM2837-ARM-Peripherals.-.Revised.-.V2-1.pdf (RPi3)
class InterruptController : public IRQController {
public:
InterruptController();
private:
virtual void enable(GenericInterruptHandler const&) override;
virtual void disable(GenericInterruptHandler const&) override;
virtual void eoi(GenericInterruptHandler const&) const override;
virtual u64 pending_interrupts() const override;
virtual StringView model() const override
{
return "Raspberry Pi Interrupt Controller";
}
InterruptControllerRegisters volatile* m_registers;
};
}