Fixed ZDE build - missing header file
[ZeXOS.git] / kernel / include / dev.h
blobbd441d0813fc6d5441108c9a839333091f675704
1 /*
2 * ZeX/OS
3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
4 * Copyright (C) 2009 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef _DEV_H
22 #define _DEV_H
24 #define DEFAULT_MAX_DEVNLENGTH 15
25 #define DEFAULT_MAX_DESCLENGTH 20
27 #define DEV_ACT_INIT 0x1
28 #define DEV_ACT_READ 0x2
29 #define DEV_ACT_WRITE 0x4
30 #define DEV_ACT_RESET 0x8
31 #define DEV_ACT_STOP 0x10
32 #define DEV_ACT_MOUNT 0x20
33 #define DEV_ACT_PLAY 0x20
34 #define DEV_ACT_UPDATE 0x40
35 #define DEV_ACT_UMOUNT 0x80
37 #define DEV_ATTR_BLOCK 0x1
38 #define DEV_ATTR_CHAR 0x2
39 #define DEV_ATTR_SPECIAL 0x4
40 #define DEV_ATTR_NET 0x8
41 #define DEV_ATTR_SOUND 0x10
43 typedef bool (dev_handler_t) (unsigned act, ...);
45 /* Device structure */
46 typedef struct dev_context {
47 struct dev_context *next, *prev;
49 char devname[DEFAULT_MAX_DEVNLENGTH];
50 char desc[DEFAULT_MAX_DESCLENGTH];
51 unsigned attrib;
52 dev_handler_t *handler;
53 } dev_t;
55 typedef struct {
56 void *iomem;
57 unsigned iolen;
58 } dev_flags_t;
60 /* externs */
61 extern void dev_display ();
62 extern dev_t *dev_find (char *devname);
63 extern bool dev_handler (dev_t *dev, unsigned act, ...);
64 extern dev_t *dev_register (char *devname, char *desc, unsigned attrib, dev_handler_t *handler);
65 extern unsigned int init_dev ();
67 #endif