VFS mountpoint backing device system
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m24s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m24s
This commit is contained in:
@@ -7,20 +7,32 @@
|
||||
#include <sync/spin_lock.h>
|
||||
#include <sys/smp.h>
|
||||
|
||||
typedef bool (*device_op_func_t) (struct proc* proc, struct cpu** reschedule_cpu, int* ret,
|
||||
void* a1, void* a2, void* a3, void* a4);
|
||||
struct device;
|
||||
|
||||
struct device_op_ctx {
|
||||
struct proc* proc;
|
||||
struct cpu** reschedule_cpu;
|
||||
bool* reschedule;
|
||||
};
|
||||
|
||||
typedef int (*device_op_func_t) (struct device* device, struct device_op_ctx* op_ctx, void* a1,
|
||||
void* a2, void* a3, void* a4);
|
||||
|
||||
typedef bool (*device_init_func_t) (struct device* device, void* arg);
|
||||
typedef void (*device_fini_func_t) (struct device* device);
|
||||
|
||||
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);
|
||||
device_init_func_t init;
|
||||
device_fini_func_t fini;
|
||||
void* udata;
|
||||
};
|
||||
|
||||
struct device* device_create (int id, device_op_func_t* ops, size_t ops_len,
|
||||
bool (*init) (void* arg), void (*fini) (void), void* arg);
|
||||
device_init_func_t init, device_fini_func_t fini, void* arg);
|
||||
struct device* device_find (int id);
|
||||
void device_delete (struct device* device);
|
||||
void devices_init (void);
|
||||
|
||||
Reference in New Issue
Block a user