Kernel: move Device.h to its own directory

This commit is contained in:
Bananymous 2023-07-19 23:50:57 +03:00
parent 4d5b14753d
commit adbe13938e
7 changed files with 11 additions and 9 deletions

View File

@ -14,7 +14,7 @@ set(KERNEL_SOURCES
kernel/APIC.cpp kernel/APIC.cpp
kernel/CPUID.cpp kernel/CPUID.cpp
kernel/Debug.cpp kernel/Debug.cpp
kernel/Device.cpp kernel/Device/Device.cpp
kernel/Errors.cpp kernel/Errors.cpp
kernel/Font.cpp kernel/Font.cpp
kernel/FS/DevFS/FileSystem.cpp kernel/FS/DevFS/FileSystem.cpp

View File

@ -8,7 +8,6 @@ namespace Kernel
class Device : public RamInode class Device : public RamInode
{ {
public: public:
Device(mode_t, uid_t, gid_t);
virtual ~Device() = default; virtual ~Device() = default;
virtual void update() {} virtual void update() {}
@ -16,11 +15,14 @@ namespace Kernel
virtual bool is_partition() const { return false; } virtual bool is_partition() const { return false; }
virtual dev_t rdev() const override = 0; virtual dev_t rdev() const override = 0;
protected:
Device(mode_t, uid_t, gid_t);
}; };
class BlockDevice : public Device class BlockDevice : public Device
{ {
public: protected:
BlockDevice(mode_t mode, uid_t uid, gid_t gid) BlockDevice(mode_t mode, uid_t uid, gid_t gid)
: Device(Mode::IFBLK | mode, uid, gid) : Device(Mode::IFBLK | mode, uid, gid)
{ {
@ -30,7 +32,7 @@ namespace Kernel
class CharacterDevice : public Device class CharacterDevice : public Device
{ {
public: protected:
CharacterDevice(mode_t mode, uid_t uid, gid_t gid) CharacterDevice(mode_t mode, uid_t uid, gid_t gid)
: Device(Mode::IFCHR | mode, uid, gid) : Device(Mode::IFCHR | mode, uid, gid)
{ {

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <kernel/Device.h> #include <kernel/Device/Device.h>
#include <kernel/FS/RamFS/FileSystem.h> #include <kernel/FS/RamFS/FileSystem.h>
namespace Kernel namespace Kernel

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <kernel/Device.h> #include <kernel/Device/Device.h>
namespace Kernel::Input namespace Kernel::Input
{ {

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <BAN/Vector.h> #include <BAN/Vector.h>
#include <kernel/Device.h> #include <kernel/Device/Device.h>
#include <kernel/Storage/DiskCache.h> #include <kernel/Storage/DiskCache.h>
namespace Kernel namespace Kernel

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <BAN/Array.h> #include <BAN/Array.h>
#include <kernel/Device.h> #include <kernel/Device/Device.h>
#include <kernel/Input/KeyEvent.h> #include <kernel/Input/KeyEvent.h>
#include <kernel/SpinLock.h> #include <kernel/SpinLock.h>
#include <kernel/Terminal/TerminalDriver.h> #include <kernel/Terminal/TerminalDriver.h>

View File

@ -1,4 +1,4 @@
#include <kernel/Device.h> #include <kernel/Device/Device.h>
#include <kernel/FS/DevFS/FileSystem.h> #include <kernel/FS/DevFS/FileSystem.h>
namespace Kernel namespace Kernel