mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:27:34 +00:00
Kernel: Replace IRQHandler with the new InterruptHandler class
System components that need an IRQ handling are now inheriting the InterruptHandler class. In addition to that, the initialization process of PATAChannel was changed to fit the changes. PATAChannel, E1000NetworkAdapter and RTL8139NetworkAdapter are now inheriting from PCI::Device instead of InterruptHandler directly.
This commit is contained in:
parent
1ee37245cd
commit
6c72736b26
29 changed files with 193 additions and 169 deletions
|
@ -39,6 +39,11 @@
|
|||
#include <Kernel/FileSystem/File.h>
|
||||
#include <Kernel/UnixTypes.h>
|
||||
|
||||
enum class DEVICE_TYPE {
|
||||
BLOCK_DEVICE = 1,
|
||||
CHAR_DEVICE = 2
|
||||
};
|
||||
|
||||
class Device : public File {
|
||||
public:
|
||||
virtual ~Device() override;
|
||||
|
@ -55,16 +60,17 @@ public:
|
|||
virtual bool is_device() const override { return true; }
|
||||
virtual bool is_disk_device() const { return false; }
|
||||
|
||||
virtual bool is_block_device() const override { return false; }
|
||||
virtual bool is_character_device() const override { return true; }
|
||||
|
||||
static void for_each(Function<void(Device&)>);
|
||||
static Device* get_device(unsigned major, unsigned minor);
|
||||
|
||||
protected:
|
||||
Device(unsigned major, unsigned minor);
|
||||
Device(unsigned major, unsigned minor, u8 device_type);
|
||||
void set_uid(uid_t uid) { m_uid = uid; }
|
||||
void set_gid(gid_t gid) { m_gid = gid; }
|
||||
|
||||
static HashMap<u32, Device*>& all_devices();
|
||||
|
||||
private:
|
||||
unsigned m_major { 0 };
|
||||
unsigned m_minor { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue