| 1 | /* @title: Registry */ |
|---|---|
| 2 | #pragma once |
| 3 | #include <log.h> |
| 4 | #include <stdint.h> |
| 5 | |
| 6 | struct block_device; |
| 7 | void registry_register(struct block_device *disk); |
| 8 | void registry_unregister(struct block_device *disk); |
| 9 | struct block_device *registry_get_by_name(const char *name); |
| 10 | struct block_device *registry_get_by_index(uint64_t index); |
| 11 | uint64_t registry_get_disk_cnt(void); |
| 12 | void registry_setup(); |
| 13 | void registry_mkname(struct block_device *disk, const char *prefix, |
| 14 | uint64_t counter); |
| 15 | |
| 16 | #define k_print_register(name) \ |
| 17 | log_msg(LOG_INFO, "Registering " ANSI_GREEN "%s" ANSI_RESET, name) |
| 18 |