source: branches/minix3-book/include/minix/dmap.h@ 25

Last change on this file since 25 was 4, checked in by Mattia Monga, 14 years ago

Importazione sorgenti libro

File size: 2.4 KB
RevLine 
[4]1#ifndef _DMAP_H
2#define _DMAP_H
3
4#include <minix/sys_config.h>
5#include <minix/ipc.h>
6
7/*===========================================================================*
8 * Device <-> Driver Table *
9 *===========================================================================*/
10
11/* Device table. This table is indexed by major device number. It provides
12 * the link between major device numbers and the routines that process them.
13 * The table can be update dynamically. The field 'dmap_flags' describe an
14 * entry's current status and determines what control options are possible.
15 */
16#define DMAP_MUTABLE 0x01 /* mapping can be overtaken */
17#define DMAP_BUSY 0x02 /* driver busy with request */
18
19enum dev_style { STYLE_DEV, STYLE_NDEV, STYLE_TTY, STYLE_CLONE };
20
21extern struct dmap {
22 int _PROTOTYPE ((*dmap_opcl), (int, Dev_t, int, int) );
23 void _PROTOTYPE ((*dmap_io), (int, message *) );
24 int dmap_driver;
25 int dmap_flags;
26} dmap[];
27
28/*===========================================================================*
29 * Major and minor device numbers *
30 *===========================================================================*/
31
32/* Total number of different devices. */
33#define NR_DEVICES 32 /* number of (major) devices */
34
35/* Major and minor device numbers for MEMORY driver. */
36#define MEMORY_MAJOR 1 /* major device for memory devices */
37# define RAM_DEV 0 /* minor device for /dev/ram */
38# define MEM_DEV 1 /* minor device for /dev/mem */
39# define KMEM_DEV 2 /* minor device for /dev/kmem */
40# define NULL_DEV 3 /* minor device for /dev/null */
41# define BOOT_DEV 4 /* minor device for /dev/boot */
42# define ZERO_DEV 5 /* minor device for /dev/zero */
43
44#define CTRLR(n) ((n)==0 ? 3 : (8 + 2*((n)-1))) /* magic formula */
45
46/* Full device numbers that are special to the boot monitor and FS. */
47# define DEV_RAM 0x0100 /* device number of /dev/ram */
48# define DEV_BOOT 0x0104 /* device number of /dev/boot */
49
50#define FLOPPY_MAJOR 2 /* major device for floppy disks */
51#define TTY_MAJOR 4 /* major device for ttys */
52#define CTTY_MAJOR 5 /* major device for /dev/tty */
53
54#define INET_MAJOR 7 /* major device for inet */
55
56#define LOG_MAJOR 15 /* major device for log driver */
57# define IS_KLOG_DEV 0 /* minor device for /dev/klog */
58
59#endif /* _DMAP_H */
Note: See TracBrowser for help on using the repository browser.