Files
mop3/kernel/device/device.h
kamkow1 690e09339e
All checks were successful
Build documentation / build-and-deploy (push) Successful in 1m55s
procgroup capabilities
2026-02-14 20:48:38 +01:00

26 lines
713 B
C

#ifndef _KERNEL_DEVICE_DEVICE_H
#define _KERNEL_DEVICE_DEVICE_H
#include <libk/rbtree.h>
#include <proc/proc.h>
#include <sync/spin_lock.h>
typedef int (*device_op_func_t) (struct proc* proc, void* a1, void* a2, void* a3, void* a4);
struct device {
int id;
device_op_func_t ops[32];
spin_lock_t lock;
struct rb_node_link device_tree_link;
bool (*init) (void* arg);
void (*fini) (void);
};
struct device* device_create (int id, device_op_func_t* ops, size_t ops_len,
bool (*init) (void* arg), void (*fini) (void), void* arg);
struct device* device_find (int id);
void device_delete (struct device* device);
void devices_init (void);
#endif // _KERNEL_DEVICE_DEVICE_H