diff options
Diffstat (limited to 'Kernel/Devices')
-rw-r--r-- | Kernel/Devices/Device.h | 1 | ||||
-rw-r--r-- | Kernel/Devices/FullDevice.cpp | 3 | ||||
-rw-r--r-- | Kernel/Devices/NullDevice.cpp | 3 | ||||
-rw-r--r-- | Kernel/Devices/RandomDevice.cpp | 5 | ||||
-rw-r--r-- | Kernel/Devices/ZeroDevice.cpp | 5 |
5 files changed, 6 insertions, 11 deletions
diff --git a/Kernel/Devices/Device.h b/Kernel/Devices/Device.h index 27e31bad8d..2e1c291d1f 100644 --- a/Kernel/Devices/Device.h +++ b/Kernel/Devices/Device.h @@ -2,7 +2,6 @@ #include <AK/Retainable.h> #include <AK/Types.h> -#include "Limits.h" #include "FileDescriptor.h" class Process; diff --git a/Kernel/Devices/FullDevice.cpp b/Kernel/Devices/FullDevice.cpp index 6d7acfadc7..2b9ad32b4a 100644 --- a/Kernel/Devices/FullDevice.cpp +++ b/Kernel/Devices/FullDevice.cpp @@ -1,5 +1,4 @@ #include "FullDevice.h" -#include "Limits.h" #include <LibC/errno_numbers.h> #include <AK/StdLibExtras.h> #include <AK/kstdio.h> @@ -20,7 +19,7 @@ bool FullDevice::can_read(Process&) const ssize_t FullDevice::read(Process&, byte* buffer, ssize_t size) { - ssize_t count = min(GoodBufferSize, size); + ssize_t count = min(PAGE_SIZE, size); memset(buffer, 0, (size_t)count); return count; } diff --git a/Kernel/Devices/NullDevice.cpp b/Kernel/Devices/NullDevice.cpp index cfb73450e1..eae5a2e037 100644 --- a/Kernel/Devices/NullDevice.cpp +++ b/Kernel/Devices/NullDevice.cpp @@ -1,5 +1,4 @@ #include "NullDevice.h" -#include "Limits.h" #include <AK/StdLibExtras.h> #include <AK/kstdio.h> @@ -33,6 +32,6 @@ ssize_t NullDevice::read(Process&, byte*, ssize_t) ssize_t NullDevice::write(Process&, const byte*, ssize_t buffer_size) { - return min(GoodBufferSize, buffer_size); + return min(PAGE_SIZE, buffer_size); } diff --git a/Kernel/Devices/RandomDevice.cpp b/Kernel/Devices/RandomDevice.cpp index 7f4face5cb..b09a0b63c5 100644 --- a/Kernel/Devices/RandomDevice.cpp +++ b/Kernel/Devices/RandomDevice.cpp @@ -1,5 +1,4 @@ #include "RandomDevice.h" -#include "Limits.h" #include <AK/StdLibExtras.h> RandomDevice::RandomDevice() @@ -42,7 +41,7 @@ bool RandomDevice::can_read(Process&) const ssize_t RandomDevice::read(Process&, byte* buffer, ssize_t size) { const int range = 'z' - 'a'; - ssize_t nread = min(size, GoodBufferSize); + ssize_t nread = min(size, PAGE_SIZE); for (ssize_t i = 0; i < nread; ++i) { dword r = random_value() % range; buffer[i] = (byte)('a' + r); @@ -53,6 +52,6 @@ ssize_t RandomDevice::read(Process&, byte* buffer, ssize_t size) ssize_t RandomDevice::write(Process&, const byte*, ssize_t size) { // FIXME: Use input for entropy? I guess that could be a neat feature? - return min(GoodBufferSize, size); + return min(PAGE_SIZE, size); } diff --git a/Kernel/Devices/ZeroDevice.cpp b/Kernel/Devices/ZeroDevice.cpp index 3527e85b55..be9ef67529 100644 --- a/Kernel/Devices/ZeroDevice.cpp +++ b/Kernel/Devices/ZeroDevice.cpp @@ -1,5 +1,4 @@ #include "ZeroDevice.h" -#include "Limits.h" #include <AK/StdLibExtras.h> #include <AK/kstdio.h> @@ -19,13 +18,13 @@ bool ZeroDevice::can_read(Process&) const ssize_t ZeroDevice::read(Process&, byte* buffer, ssize_t size) { - ssize_t count = min(GoodBufferSize, size); + ssize_t count = min(PAGE_SIZE, size); memset(buffer, 0, (size_t)count); return count; } ssize_t ZeroDevice::write(Process&, const byte*, ssize_t size) { - return min(GoodBufferSize, size); + return min(PAGE_SIZE, size); } |