All checks were successful
Build documentation / build-and-deploy (push) Successful in 55s
25 lines
671 B
C
25 lines
671 B
C
#ifndef _KERNEL_DEVICE_DEVICE_H
|
|
#define _KERNEL_DEVICE_DEVICE_H
|
|
|
|
#include <libk/rbtree.h>
|
|
#include <sync/spin_lock.h>
|
|
|
|
typedef int (*device_op_func_t) (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
|