~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Minix Cross Reference
Minix/fs/mytable.c


  1 /* This file contains the table used to map system call numbers onto the
  2  * routines that perform them.
  3  */
  4 
  5 #define _TABLE
  6 
  7 #include "fs.h"
  8 #include <minix/callnr.h>
  9 #include <minix/com.h>
 10 #include "buf.h"
 11 #include "dev.h"
 12 #include "file.h"
 13 #include "fproc.h"
 14 #include "inode.h"
 15 #include "lock.h"
 16 #include "super.h"
 17 
 18 PUBLIC _PROTOTYPE (int (*call_vector[NCALLS]), (void) ) = {
 19         no_sys,         /*  0 = unused  */
 20         do_exit,        /*  1 = exit    */
 21         do_fork,        /*  2 = fork    */
 22         do_read,        /*  3 = read    */
 23         do_write,       /*  4 = write   */
 24         do_open,        /*  5 = open    */
 25         do_close,       /*  6 = close   */
 26         no_sys,         /*  7 = wait    */
 27         do_creat,       /*  8 = creat   */
 28         do_link,        /*  9 = link    */
 29         do_unlink,      /* 10 = unlink  */
 30         no_sys,         /* 11 = waitpid */
 31         do_chdir,       /* 12 = chdir   */
 32         do_time,        /* 13 = time    */
 33         do_mknod,       /* 14 = mknod   */
 34         do_chmod,       /* 15 = chmod   */
 35         do_chown,       /* 16 = chown   */
 36         no_sys,         /* 17 = break   */
 37         do_stat,        /* 18 = stat    */
 38         do_lseek,       /* 19 = lseek   */
 39         no_sys,         /* 20 = getpid  */
 40         do_mount,       /* 21 = mount   */
 41         do_umount,      /* 22 = umount  */
 42         do_set,         /* 23 = setuid  */
 43         no_sys,         /* 24 = getuid  */
 44         do_stime,       /* 25 = stime   */
 45         no_sys,         /* 26 = ptrace  */
 46         no_sys,         /* 27 = alarm   */
 47         do_fstat,       /* 28 = fstat   */
 48         no_sys,         /* 29 = pause   */
 49         do_utime,       /* 30 = utime   */
 50         no_sys,         /* 31 = (stty)  */
 51         no_sys,         /* 32 = (gtty)  */
 52         do_access,      /* 33 = access  */
 53         no_sys,         /* 34 = (nice)  */
 54         no_sys,         /* 35 = (ftime) */
 55         do_sync,        /* 36 = sync    */
 56         no_sys,         /* 37 = kill    */
 57         do_rename,      /* 38 = rename  */
 58         do_mkdir,       /* 39 = mkdir   */
 59         do_unlink,      /* 40 = rmdir   */
 60         do_dup,         /* 41 = dup     */
 61         do_pipe,        /* 42 = pipe    */
 62         do_tims,        /* 43 = times   */
 63         no_sys,         /* 44 = (prof)  */
 64         no_sys,         /* 45 = unused  */
 65         do_set,         /* 46 = setgid  */
 66         no_sys,         /* 47 = getgid  */
 67         no_sys,         /* 48 = (signal)*/
 68         no_sys,         /* 49 = unused  */
 69         no_sys,         /* 50 = unused  */
 70         no_sys,         /* 51 = (acct)  */
 71         no_sys,         /* 52 = (phys)  */
 72         no_sys,         /* 53 = (lock)  */
 73         do_ioctl,       /* 54 = ioctl   */
 74         do_fcntl,       /* 55 = fcntl   */
 75         no_sys,         /* 56 = (mpx)   */
 76         no_sys,         /* 57 = unused  */
 77         no_sys,         /* 58 = unused  */
 78         do_exec,        /* 59 = execve  */
 79         do_umask,       /* 60 = umask   */
 80         do_chroot,      /* 61 = chroot  */
 81         do_setsid,      /* 62 = setsid  */
 82         no_sys,         /* 63 = getpgrp */
 83 
 84         no_sys,         /* 64 = KSIG: signals originating in the kernel */
 85         do_unpause,     /* 65 = UNPAUSE */
 86         no_sys,         /* 66 = unused  */
 87         do_revive,      /* 67 = REVIVE  */
 88         no_sys,         /* 68 = TASK_REPLY      */
 89         no_sys,         /* 69 = unused */
 90         no_sys,         /* 70 = unused */
 91         no_sys,         /* 71 = SIGACTION */
 92         no_sys,         /* 72 = SIGSUSPEND */
 93         no_sys,         /* 73 = SIGPENDING */
 94         no_sys,         /* 74 = SIGPROCMASK */
 95         no_sys,         /* 75 = SIGRETURN */
 96         no_sys,         /* 76 = REBOOT */
 97 };
 98 
 99 
100 /* Some devices may or may not be there in the next table. */
101 #define DT(enable, open, rw, close, task) \
102         { (enable ? (open) : no_dev), (enable ? (rw) : no_dev), \
103           (enable ? (close) : no_dev), (enable ? (task) : 0) },
104 
105 /* The order of the entries here determines the mapping between major device
106  * numbers and tasks.  The first entry (major device 0) is not used.  The
107  * next entry is major device 1, etc.  Character and block devices can be
108  * intermixed at random.  If this ordering is changed, the devices in h/boot.h
109  * must be changed to correspond to the new values.  Note that the major
110  * device numbers used in /dev are NOT the same as the task numbers used
111  * inside the kernel (as defined in h/com.h).  Also note that if /dev/mem
112  * is changed from 1, NULL_MAJOR must be changed in <include/minix/com.h>.
113  */
114 PUBLIC struct dmap dmap[] = {
115 /*  ?   Open       Read/Write   Close       Task #      Device  File
116     -   ----       ----------   -----       -------     ------  ----       */
117   DT(1, no_dev,    no_dev,      no_dev,     0)           /* 0 = not used   */
118   DT(1, dev_opcl,  call_task,   dev_opcl,   MEM)         /* 1 = /dev/mem   */
119   DT(1, dev_opcl,  call_task,   dev_opcl,   FLOPPY)      /* 2 = /dev/fd0   */
120   DT(ENABLE_WINI,
121         dev_opcl,  call_task,   dev_opcl,   WINCHESTER)  /* 3 = /dev/hd0   */
122   DT(1, tty_open,  call_task,   dev_opcl,   TTY)         /* 4 = /dev/tty00 */
123   DT(1, ctty_open, call_ctty,   ctty_close, TTY)         /* 5 = /dev/tty   */
124   DT(1, dev_opcl,  call_task,   dev_opcl,    PRINTER)     /* 6 = /dev/lp    */
125 
126 #if (MACHINE == IBM_PC)
127   DT(ENABLE_NETWORKING,
128         net_open,  call_task,   dev_opcl,   INET_PROC_NR)/* 7 = /dev/ip    */
129   DT(ENABLE_CDROM,
130         dev_opcl,  call_task,   dev_opcl,   CDROM)       /* 8 = /dev/cd0   */
131   DT(0, 0,         0,           0,          0)           /* 9 = not used   */
132   DT(ENABLE_SCSI,
133         dev_opcl,  call_task,   dev_opcl,   SCSI)        /*10 = /dev/sd0   */
134   DT(0, 0,         0,           0,          0)           /*11 = not used   */
135   DT(0, 0,         0,           0,          0)           /*12 = not used   */
136   DT(ENABLE_AUDIO,
137         dev_opcl,  call_task,   dev_opcl,   AUDIO)       /*13 = /dev/audio */
138   DT(ENABLE_AUDIO,
139         dev_opcl,  call_task,   dev_opcl,   MIXER)       /*14 = /dev/mixer */
140 #endif /* IBM_PC */
141 
142 #if (MACHINE == SUN)
143   DT(ENABLE_NETWORKING,
144         net_open,  call_task,   dev_opcl,   INET_PROC_NR)/* 7 = /dev/ip    */
145 #endif
146   
147 #if (MACHINE == ATARI)
148   DT(ENABLE_SCSI,
149         dev_opcl,  call_task,   dev_opcl,   SCSI)        /* 7 = /dev/hdscsi0 */
150 #endif
151 };
152 
153 PUBLIC int max_major = sizeof(dmap)/sizeof(struct dmap);
154 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.