Luna/kernel/src/fs/devices/DeviceRegistry.h
apio 32d2e0e6b7
All checks were successful
continuous-integration/drone/push Build is passing
kernel: Remove register_special_device()'s name parameter
This is now duplicate information that can be queried using device->device_path().
2023-06-16 21:46:51 +02:00

31 lines
705 B
C++

#pragma once
#include "fs/VFS.h"
#include "fs/devices/Device.h"
#include <luna/SharedPtr.h>
#include <sys/types.h>
namespace DeviceRegistry
{
enum DeviceMajorTypes : u32
{
Null = 0,
Console = 1,
Memory = 2,
Framebuffer = 3,
Disk = 4,
DiskPartition = 5,
};
Result<SharedPtr<Device>> fetch_special_device(u32 major, u32 minor);
Result<void> register_special_device(u32 major, u32 minor, SharedPtr<Device> device, mode_t mode = 0666);
Result<void> init();
// Used for file systems (like tmpfs) that do not have a host device.
dev_t next_null_device_id();
Result<SharedPtr<VFS::FileSystem>> create_devfs_instance();
}