aboutsummaryrefslogtreecommitdiff
path: root/kernel/devices/include/devices/block_device.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/devices/include/devices/block_device.hpp')
-rw-r--r--kernel/devices/include/devices/block_device.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/devices/include/devices/block_device.hpp b/kernel/devices/include/devices/block_device.hpp
index 78a2606..9bca53f 100644
--- a/kernel/devices/include/devices/block_device.hpp
+++ b/kernel/devices/include/devices/block_device.hpp
@@ -46,6 +46,28 @@ namespace devices
*/
virtual auto write_block(size_t block_index, void const * buffer) -> void = 0;
+ /**
+ * @brief Return logical block size in bytes.
+ * @return One logical block size in bytes.
+ */
+ auto block_size() const -> size_t;
+
+ /**
+ * @brief Return device capacity in bytes.
+ * @return Total number of addressable bytes.
+ */
+ auto capacity() const -> size_t;
+
+ /**
+ * @brief Override to identify block devices.
+ * @return true if this device is a block device, false otherwise.
+ */
+
+ auto is_block_device() const -> bool override
+ {
+ return true;
+ }
+
protected:
/**
* @brief Information describing the transfer window for one block index.