QDNix
Quick’n’dirty *NIX
device.h
1 #ifndef _DEV_DEVICE_H
2 # define _DEV_DEVICE_H 1
3 
4 # include <dev/tty/serial/serial.h>
5 
6 struct device;
7 struct driver;
8 
9 typedef enum {
10  DEVICE_CPU,
11  DEVICE_TTY,
12  DEVICE_NET,
13  DEVICE_DISK,
14  DEVICE_AUDIO,
15  DEVICE_VIDEO,
16  DEVICE_BUS,
17  DEVICE_NULL
18 } DeviceClass;
19 
20 typedef struct device {
21  DeviceClass class;
22  char name[16];
23  union {
24  SerialDevice serial;
25  } drivers;
26  struct device *next;
27  struct device *child;
28 } Device;
29 
30 typedef struct {
31  const char *name;
32  Device **devs;
33  DeviceClass class;
34 } Driver;
35 
36 
37 #endif /* !_DEV_DEVICE_H */
Definition: device.h:20
Definition: device.h:30