2023-03-18 09:10:33 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "fs/devices/Device.h"
|
|
|
|
#include <luna/SharedPtr.h>
|
2023-05-17 19:40:37 +02:00
|
|
|
#include <sys/types.h>
|
2023-03-18 09:10:33 +01:00
|
|
|
|
|
|
|
namespace DeviceRegistry
|
|
|
|
{
|
|
|
|
enum DeviceMajorTypes : u32
|
|
|
|
{
|
|
|
|
Null = 0,
|
|
|
|
Console = 1,
|
2023-04-21 18:18:15 +02:00
|
|
|
Memory = 2,
|
|
|
|
Framebuffer = 3,
|
2023-03-18 09:10:33 +01:00
|
|
|
};
|
|
|
|
|
2023-05-09 18:31:27 +02:00
|
|
|
Result<SharedPtr<Device>> fetch_special_device(u32 major, u32 minor);
|
2023-03-18 09:10:33 +01:00
|
|
|
|
2023-05-17 19:40:37 +02:00
|
|
|
Result<void> register_special_device(u32 major, u32 minor, SharedPtr<Device> device, const char* name,
|
|
|
|
mode_t mode = 0666);
|
2023-03-18 09:10:33 +01:00
|
|
|
|
|
|
|
Result<void> init();
|
|
|
|
}
|