Nucleus
Barry Device driver interface 7864e7f (3 years, 2 months ago)diff --git a/include/nucleus/driver.h b/include/nucleus/driver.h new file mode 100644 index 0000000..53df5ec --- /dev/null +++ b/include/nucleus/driver.h @@ -0,0 +1,19 @@ +#ifndef _NUCLEUS_DRIVER_H +#define _NUCLEUS_DRIVER_H + +#include <sys/types.h> +#include <nucleus/object.h> +#include <nucleus/vfs.h> + +#define MKDEV(maj,min) ((dev_t) (((maj & 0xFFFF) << 16) | (min & 0xFFFF))) +#define MAJOR(dev) ((dev >> 16) & 0xFFFF) +#define MINOR(dev) (dev & 0xFFFF) + +typedef struct Driver Driver; + +extern ObjectType driverType; + +unsigned short register_driver(unsigned short major, FileOps *ops); +FileOps *find_driver(unsigned short major); + +#endif