2023-03-18 09:10:33 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "fs/devices/Device.h"
|
|
|
|
#include <luna/SharedPtr.h>
|
|
|
|
|
|
|
|
typedef Result<SharedPtr<Device>> (*device_create_func_t)(void);
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
Result<SharedPtr<Device>> create_special_device(u32 major, u32 minor);
|
|
|
|
|
|
|
|
Result<void> register_special_device(u32 major, u32 minor, device_create_func_t initializer);
|
|
|
|
|
|
|
|
Result<void> init();
|
|
|
|
}
|