aboutsummaryrefslogtreecommitdiff
path: root/kernel/devices/include
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/devices/include')
-rw-r--r--kernel/devices/include/devices/storage/storage_controller.hpp9
-rw-r--r--kernel/devices/include/devices/storage/storage_management.hpp4
2 files changed, 10 insertions, 3 deletions
diff --git a/kernel/devices/include/devices/storage/storage_controller.hpp b/kernel/devices/include/devices/storage/storage_controller.hpp
index 697d3c3..0518e32 100644
--- a/kernel/devices/include/devices/storage/storage_controller.hpp
+++ b/kernel/devices/include/devices/storage/storage_controller.hpp
@@ -1,7 +1,6 @@
#ifndef TEACH_OS_KERNEL_DEVICES_STORAGE_STORAGE_CONTROLLER_HPP
#define TEACH_OS_KERNEL_DEVICES_STORAGE_STORAGE_CONTROLLER_HPP
-#include "devices/block_device.hpp"
#include "devices/device.hpp"
#include <array>
@@ -44,7 +43,11 @@ namespace devices::storage
* @brief Return the number of devices managed by this controller.
* @return Number of managed devices.
*/
- auto devices_count() -> size_t;
+ auto devices_count() const -> size_t;
+
+ // TODO BA-FS26 add comment
+ // TODO BA-FS26 use kstd::vector when available
+ auto all_devices() const -> std::array<devices::device *, 1> const &;
/**
* @brief Find a managed device by major/minor numbers.
@@ -52,7 +55,7 @@ namespace devices::storage
* @param minor Device minor number.
* @return Matching block device, or nullptr if no device matches.
*/
- auto device_by_minor(size_t minor) -> device *;
+ auto device_by_minor(size_t minor) const -> device *;
protected:
size_t m_major{};
diff --git a/kernel/devices/include/devices/storage/storage_management.hpp b/kernel/devices/include/devices/storage/storage_management.hpp
index 6ca8db7..4bc7cbd 100644
--- a/kernel/devices/include/devices/storage/storage_management.hpp
+++ b/kernel/devices/include/devices/storage/storage_management.hpp
@@ -42,6 +42,10 @@ namespace devices::storage
*/
auto add_controller(storage_controller * controller) -> void;
+ // TODO BA-FS26 add comment
+ // TODO BA-FS26 use kstd::vector when available
+ auto all_controllers() const -> std::array<storage_controller *, 1> const &;
+
/**
* @brief Find a device by major/minor numbers.
* @param major Device major number.