diff options
Diffstat (limited to 'Kernel/Devices')
-rw-r--r-- | Kernel/Devices/BXVGADevice.cpp | 12 | ||||
-rw-r--r-- | Kernel/Devices/BXVGADevice.h | 12 | ||||
-rw-r--r-- | Kernel/Devices/DebugLogDevice.cpp | 2 | ||||
-rw-r--r-- | Kernel/Devices/DebugLogDevice.h | 8 | ||||
-rw-r--r-- | Kernel/Devices/Device.cpp | 2 | ||||
-rw-r--r-- | Kernel/Devices/Device.h | 2 | ||||
-rw-r--r-- | Kernel/Devices/FullDevice.cpp | 6 | ||||
-rw-r--r-- | Kernel/Devices/FullDevice.h | 8 | ||||
-rw-r--r-- | Kernel/Devices/KeyboardDevice.cpp | 6 | ||||
-rw-r--r-- | Kernel/Devices/KeyboardDevice.h | 8 | ||||
-rw-r--r-- | Kernel/Devices/NullDevice.cpp | 6 | ||||
-rw-r--r-- | Kernel/Devices/NullDevice.h | 8 | ||||
-rw-r--r-- | Kernel/Devices/PS2MouseDevice.cpp | 6 | ||||
-rw-r--r-- | Kernel/Devices/PS2MouseDevice.h | 8 | ||||
-rw-r--r-- | Kernel/Devices/RandomDevice.cpp | 6 | ||||
-rw-r--r-- | Kernel/Devices/RandomDevice.h | 8 | ||||
-rw-r--r-- | Kernel/Devices/ZeroDevice.cpp | 6 | ||||
-rw-r--r-- | Kernel/Devices/ZeroDevice.h | 8 |
18 files changed, 61 insertions, 61 deletions
diff --git a/Kernel/Devices/BXVGADevice.cpp b/Kernel/Devices/BXVGADevice.cpp index e4b2d4c356..e8ad647c32 100644 --- a/Kernel/Devices/BXVGADevice.cpp +++ b/Kernel/Devices/BXVGADevice.cpp @@ -84,7 +84,7 @@ dword BXVGADevice::find_framebuffer_address() return framebuffer_address; } -KResultOr<Region*> BXVGADevice::mmap(Process& process, FileDescriptor&, LinearAddress preferred_laddr, size_t offset, size_t size, int prot) +KResultOr<Region*> BXVGADevice::mmap(Process& process, FileDescription&, LinearAddress preferred_laddr, size_t offset, size_t size, int prot) { ASSERT(offset == 0); ASSERT(size == framebuffer_size_in_bytes()); @@ -104,7 +104,7 @@ KResultOr<Region*> BXVGADevice::mmap(Process& process, FileDescriptor&, LinearAd return region; } -int BXVGADevice::ioctl(FileDescriptor&, unsigned request, unsigned arg) +int BXVGADevice::ioctl(FileDescription&, unsigned request, unsigned arg) { switch (request) { case BXVGA_DEV_IOCTL_SET_Y_OFFSET: @@ -124,22 +124,22 @@ int BXVGADevice::ioctl(FileDescriptor&, unsigned request, unsigned arg) }; } -bool BXVGADevice::can_read(FileDescriptor&) const +bool BXVGADevice::can_read(FileDescription&) const { ASSERT_NOT_REACHED(); } -bool BXVGADevice::can_write(FileDescriptor&) const +bool BXVGADevice::can_write(FileDescription&) const { ASSERT_NOT_REACHED(); } -ssize_t BXVGADevice::read(FileDescriptor&, byte*, ssize_t) +ssize_t BXVGADevice::read(FileDescription&, byte*, ssize_t) { ASSERT_NOT_REACHED(); } -ssize_t BXVGADevice::write(FileDescriptor&, const byte*, ssize_t) +ssize_t BXVGADevice::write(FileDescription&, const byte*, ssize_t) { ASSERT_NOT_REACHED(); } diff --git a/Kernel/Devices/BXVGADevice.h b/Kernel/Devices/BXVGADevice.h index 2270a41a9f..ac8b6f4fa8 100644 --- a/Kernel/Devices/BXVGADevice.h +++ b/Kernel/Devices/BXVGADevice.h @@ -17,18 +17,18 @@ public: void set_resolution(int width, int height); void set_y_offset(int); - virtual int ioctl(FileDescriptor&, unsigned request, unsigned arg) override; - virtual KResultOr<Region*> mmap(Process&, FileDescriptor&, LinearAddress preferred_laddr, size_t offset, size_t, int prot) override; + virtual int ioctl(FileDescription&, unsigned request, unsigned arg) override; + virtual KResultOr<Region*> mmap(Process&, FileDescription&, LinearAddress preferred_laddr, size_t offset, size_t, int prot) override; size_t framebuffer_size_in_bytes() const { return m_framebuffer_size.area() * sizeof(dword) * 2; } Size framebuffer_size() const { return m_framebuffer_size; } private: virtual const char* class_name() const override { return "BXVGA"; } - virtual bool can_read(FileDescriptor&) const override; - virtual bool can_write(FileDescriptor&) const override; - virtual ssize_t read(FileDescriptor&, byte*, ssize_t) override; - virtual ssize_t write(FileDescriptor&, const byte*, ssize_t) override; + virtual bool can_read(FileDescription&) const override; + virtual bool can_write(FileDescription&) const override; + virtual ssize_t read(FileDescription&, byte*, ssize_t) override; + virtual ssize_t write(FileDescription&, const byte*, ssize_t) override; void set_register(word index, word value); dword find_framebuffer_address(); diff --git a/Kernel/Devices/DebugLogDevice.cpp b/Kernel/Devices/DebugLogDevice.cpp index daa879ffb1..838101dda4 100644 --- a/Kernel/Devices/DebugLogDevice.cpp +++ b/Kernel/Devices/DebugLogDevice.cpp @@ -19,7 +19,7 @@ DebugLogDevice::~DebugLogDevice() { } -ssize_t DebugLogDevice::write(FileDescriptor&, const byte* data, ssize_t data_size) +ssize_t DebugLogDevice::write(FileDescription&, const byte* data, ssize_t data_size) { for (int i = 0; i < data_size; ++i) IO::out8(0xe9, data[i]); diff --git a/Kernel/Devices/DebugLogDevice.h b/Kernel/Devices/DebugLogDevice.h index 9b09205074..2ef4ade046 100644 --- a/Kernel/Devices/DebugLogDevice.h +++ b/Kernel/Devices/DebugLogDevice.h @@ -9,9 +9,9 @@ public: private: // ^CharacterDevice - virtual ssize_t read(FileDescriptor&, byte*, ssize_t) override { return 0; } - virtual ssize_t write(FileDescriptor&, const byte*, ssize_t) override; - virtual bool can_write(FileDescriptor&) const override { return true; } - virtual bool can_read(FileDescriptor&) const override { return true; } + virtual ssize_t read(FileDescription&, byte*, ssize_t) override { return 0; } + virtual ssize_t write(FileDescription&, const byte*, ssize_t) override; + virtual bool can_write(FileDescription&) const override { return true; } + virtual bool can_read(FileDescription&) const override { return true; } virtual const char* class_name() const override { return "DebugLogDevice"; } }; diff --git a/Kernel/Devices/Device.cpp b/Kernel/Devices/Device.cpp index fe3c28f01f..24a5274456 100644 --- a/Kernel/Devices/Device.cpp +++ b/Kernel/Devices/Device.cpp @@ -14,7 +14,7 @@ Device::~Device() VFS::the().unregister_device({}, *this); } -String Device::absolute_path(const FileDescriptor&) const +String Device::absolute_path(const FileDescription&) const { return String::format("device:%u,%u (%s)", m_major, m_minor, class_name()); } diff --git a/Kernel/Devices/Device.h b/Kernel/Devices/Device.h index 7c19a9fea9..3b2256cf64 100644 --- a/Kernel/Devices/Device.h +++ b/Kernel/Devices/Device.h @@ -19,7 +19,7 @@ public: unsigned major() const { return m_major; } unsigned minor() const { return m_minor; } - virtual String absolute_path(const FileDescriptor&) const override; + virtual String absolute_path(const FileDescription&) const override; uid_t uid() const { return m_uid; } uid_t gid() const { return m_gid; } diff --git a/Kernel/Devices/FullDevice.cpp b/Kernel/Devices/FullDevice.cpp index 024cd699e2..fd4403d1ce 100644 --- a/Kernel/Devices/FullDevice.cpp +++ b/Kernel/Devices/FullDevice.cpp @@ -12,19 +12,19 @@ FullDevice::~FullDevice() { } -bool FullDevice::can_read(FileDescriptor&) const +bool FullDevice::can_read(FileDescription&) const { return true; } -ssize_t FullDevice::read(FileDescriptor&, byte* buffer, ssize_t size) +ssize_t FullDevice::read(FileDescription&, byte* buffer, ssize_t size) { ssize_t count = min(PAGE_SIZE, size); memset(buffer, 0, (size_t)count); return count; } -ssize_t FullDevice::write(FileDescriptor&, const byte*, ssize_t size) +ssize_t FullDevice::write(FileDescription&, const byte*, ssize_t size) { if (size == 0) return 0; diff --git a/Kernel/Devices/FullDevice.h b/Kernel/Devices/FullDevice.h index 9974e47c4d..fa4ffcb8bc 100644 --- a/Kernel/Devices/FullDevice.h +++ b/Kernel/Devices/FullDevice.h @@ -10,9 +10,9 @@ public: private: // ^CharacterDevice - virtual ssize_t read(FileDescriptor&, byte*, ssize_t) override; - virtual ssize_t write(FileDescriptor&, const byte*, ssize_t) override; - virtual bool can_read(FileDescriptor&) const override; - virtual bool can_write(FileDescriptor&) const override { return true; } + virtual ssize_t read(FileDescription&, byte*, ssize_t) override; + virtual ssize_t write(FileDescription&, const byte*, ssize_t) override; + virtual bool can_read(FileDescription&) const override; + virtual bool can_write(FileDescription&) const override { return true; } virtual const char* class_name() const override { return "FullDevice"; } }; diff --git a/Kernel/Devices/KeyboardDevice.cpp b/Kernel/Devices/KeyboardDevice.cpp index 856fcc2fb8..7a8464e598 100644 --- a/Kernel/Devices/KeyboardDevice.cpp +++ b/Kernel/Devices/KeyboardDevice.cpp @@ -208,12 +208,12 @@ KeyboardDevice::~KeyboardDevice() { } -bool KeyboardDevice::can_read(FileDescriptor&) const +bool KeyboardDevice::can_read(FileDescription&) const { return !m_queue.is_empty(); } -ssize_t KeyboardDevice::read(FileDescriptor&, byte* buffer, ssize_t size) +ssize_t KeyboardDevice::read(FileDescription&, byte* buffer, ssize_t size) { ssize_t nread = 0; while (nread < size) { @@ -229,7 +229,7 @@ ssize_t KeyboardDevice::read(FileDescriptor&, byte* buffer, ssize_t size) return nread; } -ssize_t KeyboardDevice::write(FileDescriptor&, const byte*, ssize_t) +ssize_t KeyboardDevice::write(FileDescription&, const byte*, ssize_t) { return 0; } diff --git a/Kernel/Devices/KeyboardDevice.h b/Kernel/Devices/KeyboardDevice.h index 16f134b2a7..1edffe3869 100644 --- a/Kernel/Devices/KeyboardDevice.h +++ b/Kernel/Devices/KeyboardDevice.h @@ -23,10 +23,10 @@ public: void set_client(KeyboardClient* client) { m_client = client; } // ^CharacterDevice - virtual ssize_t read(FileDescriptor&, byte* buffer, ssize_t) override; - virtual bool can_read(FileDescriptor&) const override; - virtual ssize_t write(FileDescriptor&, const byte* buffer, ssize_t) override; - virtual bool can_write(FileDescriptor&) const override { return true; } + virtual ssize_t read(FileDescription&, byte* buffer, ssize_t) override; + virtual bool can_read(FileDescription&) const override; + virtual ssize_t write(FileDescription&, const byte* buffer, ssize_t) override; + virtual bool can_write(FileDescription&) const override { return true; } private: // ^IRQHandler diff --git a/Kernel/Devices/NullDevice.cpp b/Kernel/Devices/NullDevice.cpp index e93bd55891..c04f84e1ca 100644 --- a/Kernel/Devices/NullDevice.cpp +++ b/Kernel/Devices/NullDevice.cpp @@ -20,17 +20,17 @@ NullDevice::~NullDevice() { } -bool NullDevice::can_read(FileDescriptor&) const +bool NullDevice::can_read(FileDescription&) const { return true; } -ssize_t NullDevice::read(FileDescriptor&, byte*, ssize_t) +ssize_t NullDevice::read(FileDescription&, byte*, ssize_t) { return 0; } -ssize_t NullDevice::write(FileDescriptor&, const byte*, ssize_t buffer_size) +ssize_t NullDevice::write(FileDescription&, const byte*, ssize_t buffer_size) { return min(PAGE_SIZE, buffer_size); } diff --git a/Kernel/Devices/NullDevice.h b/Kernel/Devices/NullDevice.h index 47ba7baf5a..964565c690 100644 --- a/Kernel/Devices/NullDevice.h +++ b/Kernel/Devices/NullDevice.h @@ -12,9 +12,9 @@ public: private: // ^CharacterDevice - virtual ssize_t read(FileDescriptor&, byte*, ssize_t) override; - virtual ssize_t write(FileDescriptor&, const byte*, ssize_t) override; - virtual bool can_write(FileDescriptor&) const override { return true; } - virtual bool can_read(FileDescriptor&) const override; + virtual ssize_t read(FileDescription&, byte*, ssize_t) override; + virtual ssize_t write(FileDescription&, const byte*, ssize_t) override; + virtual bool can_write(FileDescription&) const override { return true; } + virtual bool can_read(FileDescription&) const override; virtual const char* class_name() const override { return "NullDevice"; } }; diff --git a/Kernel/Devices/PS2MouseDevice.cpp b/Kernel/Devices/PS2MouseDevice.cpp index c7d8ff54f5..a7f2fe296d 100644 --- a/Kernel/Devices/PS2MouseDevice.cpp +++ b/Kernel/Devices/PS2MouseDevice.cpp @@ -218,12 +218,12 @@ byte PS2MouseDevice::mouse_read() return IO::in8(0x60); } -bool PS2MouseDevice::can_read(FileDescriptor&) const +bool PS2MouseDevice::can_read(FileDescription&) const { return !m_queue.is_empty(); } -ssize_t PS2MouseDevice::read(FileDescriptor&, byte* buffer, ssize_t size) +ssize_t PS2MouseDevice::read(FileDescription&, byte* buffer, ssize_t size) { ssize_t nread = 0; while (nread < size) { @@ -239,7 +239,7 @@ ssize_t PS2MouseDevice::read(FileDescriptor&, byte* buffer, ssize_t size) return nread; } -ssize_t PS2MouseDevice::write(FileDescriptor&, const byte*, ssize_t) +ssize_t PS2MouseDevice::write(FileDescription&, const byte*, ssize_t) { return 0; } diff --git a/Kernel/Devices/PS2MouseDevice.h b/Kernel/Devices/PS2MouseDevice.h index de97cfe4e1..e63db8a998 100644 --- a/Kernel/Devices/PS2MouseDevice.h +++ b/Kernel/Devices/PS2MouseDevice.h @@ -14,10 +14,10 @@ public: static PS2MouseDevice& the(); // ^CharacterDevice - virtual bool can_read(FileDescriptor&) const override; - virtual ssize_t read(FileDescriptor&, byte*, ssize_t) override; - virtual ssize_t write(FileDescriptor&, const byte*, ssize_t) override; - virtual bool can_write(FileDescriptor&) const override { return true; } + virtual bool can_read(FileDescription&) const override; + virtual ssize_t read(FileDescription&, byte*, ssize_t) override; + virtual ssize_t write(FileDescription&, const byte*, ssize_t) override; + virtual bool can_write(FileDescription&) const override { return true; } private: // ^IRQHandler diff --git a/Kernel/Devices/RandomDevice.cpp b/Kernel/Devices/RandomDevice.cpp index 354212fbcd..3e3cfdd023 100644 --- a/Kernel/Devices/RandomDevice.cpp +++ b/Kernel/Devices/RandomDevice.cpp @@ -26,12 +26,12 @@ static void mysrand(unsigned seed) } #endif -bool RandomDevice::can_read(FileDescriptor&) const +bool RandomDevice::can_read(FileDescription&) const { return true; } -ssize_t RandomDevice::read(FileDescriptor&, byte* buffer, ssize_t size) +ssize_t RandomDevice::read(FileDescription&, byte* buffer, ssize_t size) { const int range = 'z' - 'a'; ssize_t nread = min(size, PAGE_SIZE); @@ -42,7 +42,7 @@ ssize_t RandomDevice::read(FileDescriptor&, byte* buffer, ssize_t size) return nread; } -ssize_t RandomDevice::write(FileDescriptor&, const byte*, ssize_t size) +ssize_t RandomDevice::write(FileDescription&, const byte*, ssize_t size) { // FIXME: Use input for entropy? I guess that could be a neat feature? return min(PAGE_SIZE, size); diff --git a/Kernel/Devices/RandomDevice.h b/Kernel/Devices/RandomDevice.h index ecce3c6bfb..4d6dce159e 100644 --- a/Kernel/Devices/RandomDevice.h +++ b/Kernel/Devices/RandomDevice.h @@ -12,9 +12,9 @@ public: private: // ^CharacterDevice - virtual ssize_t read(FileDescriptor&, byte*, ssize_t) override; - virtual ssize_t write(FileDescriptor&, const byte*, ssize_t) override; - virtual bool can_read(FileDescriptor&) const override; - virtual bool can_write(FileDescriptor&) const override { return true; } + virtual ssize_t read(FileDescription&, byte*, ssize_t) override; + virtual ssize_t write(FileDescription&, const byte*, ssize_t) override; + virtual bool can_read(FileDescription&) const override; + virtual bool can_write(FileDescription&) const override { return true; } virtual const char* class_name() const override { return "RandomDevice"; } }; diff --git a/Kernel/Devices/ZeroDevice.cpp b/Kernel/Devices/ZeroDevice.cpp index ee809045bc..aa9e98e3a8 100644 --- a/Kernel/Devices/ZeroDevice.cpp +++ b/Kernel/Devices/ZeroDevice.cpp @@ -11,19 +11,19 @@ ZeroDevice::~ZeroDevice() { } -bool ZeroDevice::can_read(FileDescriptor&) const +bool ZeroDevice::can_read(FileDescription&) const { return true; } -ssize_t ZeroDevice::read(FileDescriptor&, byte* buffer, ssize_t size) +ssize_t ZeroDevice::read(FileDescription&, byte* buffer, ssize_t size) { ssize_t count = min(PAGE_SIZE, size); memset(buffer, 0, (size_t)count); return count; } -ssize_t ZeroDevice::write(FileDescriptor&, const byte*, ssize_t size) +ssize_t ZeroDevice::write(FileDescription&, const byte*, ssize_t size) { return min(PAGE_SIZE, size); } diff --git a/Kernel/Devices/ZeroDevice.h b/Kernel/Devices/ZeroDevice.h index 930f3adec2..631fdd8965 100644 --- a/Kernel/Devices/ZeroDevice.h +++ b/Kernel/Devices/ZeroDevice.h @@ -10,9 +10,9 @@ public: private: // ^CharacterDevice - virtual ssize_t read(FileDescriptor&, byte*, ssize_t) override; - virtual ssize_t write(FileDescriptor&, const byte*, ssize_t) override; - virtual bool can_read(FileDescriptor&) const override; - virtual bool can_write(FileDescriptor&) const override { return true; } + virtual ssize_t read(FileDescription&, byte*, ssize_t) override; + virtual ssize_t write(FileDescription&, const byte*, ssize_t) override; + virtual bool can_read(FileDescription&) const override; + virtual bool can_write(FileDescription&) const override { return true; } virtual const char* class_name() const override { return "ZeroDevice"; } }; |