COMPLETE.T
资源名称:os_source.zip [点击查看]
上传用户:datang2001
上传日期:2007-02-01
资源大小:53269k
文件大小:2535k
源码类别:
操作系统开发
开发平台:
C/C++
- 04709 #endif
- 04710
- 04711 struct direct {
- 04712 ino_t d_ino;
- 04713 char d_name[DIRSIZ];
- 04714 };
- 04715
- 04716 #endif /* _DIR_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/ioctl.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 04800 /* The ioctl.h header declares device controlling operations. */
- 04801
- 04802 #ifndef _IOCTL_H
- 04803 #define _IOCTL_H
- 04804
- 04805 #if _EM_WSIZE >= 4
- 04806 /* Ioctls have the command encoded in the low-order word, and the size
- 04807 * of the parameter in the high-order word. The 3 high bits of the high-
- 04808 * order word are used to encode the in/out/void status of the parameter.
- 04809 */
- 04810
- 04811 #define _IOCPARM_MASK 0x1FFF
- 04812 #define _IOC_VOID 0x20000000
- 04813 #define _IOCTYPE_MASK 0xFFFF
- 04814 #define _IOC_IN 0x40000000
- .Op 51 include/sys/ioctl.h
- 04815 #define _IOC_OUT 0x80000000
- 04816 #define _IOC_INOUT (_IOC_IN | _IOC_OUT)
- 04817
- 04818 #define _IO(x,y) ((x << 8) | y | _IOC_VOID)
- 04819 #define _IOR(x,y,t) ((x << 8) | y | ((sizeof(t) & _IOCPARM_MASK) << 16) |
- 04820 _IOC_OUT)
- 04821 #define _IOW(x,y,t) ((x << 8) | y | ((sizeof(t) & _IOCPARM_MASK) << 16) |
- 04822 _IOC_IN)
- 04823 #define _IORW(x,y,t) ((x << 8) | y | ((sizeof(t) & _IOCPARM_MASK) << 16) |
- 04824 _IOC_INOUT)
- 04825 #else
- 04826 /* No fancy encoding on a 16-bit machine. */
- 04827
- 04828 #define _IO(x,y) ((x << 8) | y)
- 04829 #define _IOR(x,y,t) _IO(x,y)
- 04830 #define _IOW(x,y,t) _IO(x,y)
- 04831 #define _IORW(x,y,t) _IO(x,y)
- 04832 #endif
- 04833
- 04834
- 04835 /* Terminal ioctls. */
- 04836 #define TCGETS _IOR('T', 8, struct termios) /* tcgetattr */
- 04837 #define TCSETS _IOW('T', 9, struct termios) /* tcsetattr, TCSANOW */
- 04838 #define TCSETSW _IOW('T', 10, struct termios) /* tcsetattr, TCSADRAIN */
- 04839 #define TCSETSF _IOW('T', 11, struct termios) /* tcsetattr, TCSAFLUSH */
- 04840 #define TCSBRK _IOW('T', 12, int) /* tcsendbreak */
- 04841 #define TCDRAIN _IO ('T', 13) /* tcdrain */
- 04842 #define TCFLOW _IOW('T', 14, int) /* tcflow */
- 04843 #define TCFLSH _IOW('T', 15, int) /* tcflush */
- 04844 #define TIOCGWINSZ _IOR('T', 16, struct winsize)
- 04845 #define TIOCSWINSZ _IOW('T', 17, struct winsize)
- 04846 #define TIOCGPGRP _IOW('T', 18, int)
- 04847 #define TIOCSPGRP _IOW('T', 19, int)
- 04848 #define TIOCSFON _IOW('T', 20, u8_t [8192])
- 04849
- 04850 #define TIOCGETP _IOR('t', 1, struct sgttyb)
- 04851 #define TIOCSETP _IOW('t', 2, struct sgttyb)
- 04852 #define TIOCGETC _IOR('t', 3, struct tchars)
- 04853 #define TIOCSETC _IOW('t', 4, struct tchars)
- 04854
- 04855
- 04856 /* Network ioctls. */
- 04857 #define NWIOSETHOPT _IOW('n', 16, struct nwio_ethopt)
- 04858 #define NWIOGETHOPT _IOR('n', 17, struct nwio_ethopt)
- 04859 #define NWIOGETHSTAT _IOR('n', 18, struct nwio_ethstat)
- 04860
- 04861 #define NWIOSIPCONF _IOW('n', 32, struct nwio_ipconf)
- 04862 #define NWIOGIPCONF _IOR('n', 33, struct nwio_ipconf)
- 04863 #define NWIOSIPOPT _IOW('n', 34, struct nwio_ipopt)
- 04864 #define NWIOGIPOPT _IOR('n', 35, struct nwio_ipopt)
- 04865
- 04866 #define NWIOIPGROUTE _IORW('n', 40, struct nwio_route)
- 04867 #define NWIOIPSROUTE _IOW ('n', 41, struct nwio_route)
- 04868 #define NWIOIPDROUTE _IOW ('n', 42, struct nwio_route)
- 04869
- 04870 #define NWIOSTCPCONF _IOW('n', 48, struct nwio_tcpconf)
- 04871 #define NWIOGTCPCONF _IOR('n', 49, struct nwio_tcpconf)
- 04872 #define NWIOTCPCONN _IOW('n', 50, struct nwio_tcpcl)
- 04873 #define NWIOTCPLISTEN _IOW('n', 51, struct nwio_tcpcl)
- 04874 #define NWIOTCPATTACH _IOW('n', 52, struct nwio_tcpatt)
- .Ep 52 include/sys/ioctl.h
- 04875 #define NWIOTCPSHUTDOWN _IO ('n', 53)
- 04876 #define NWIOSTCPOPT _IOW('n', 54, struct nwio_tcpopt)
- 04877 #define NWIOGTCPOPT _IOR('n', 55, struct nwio_tcpopt)
- 04878
- 04879 #define NWIOSUDPOPT _IOW('n', 64, struct nwio_udpopt)
- 04880 #define NWIOGUDPOPT _IOR('n', 65, struct nwio_udpopt)
- 04881
- 04882 /* Disk ioctls. */
- 04883 #define DIOCEJECT _IO ('d', 5)
- 04884 #define DIOCSETP _IOW('d', 6, struct partition)
- 04885 #define DIOCGETP _IOR('d', 7, struct partition)
- 04886
- 04887 /* Keyboard ioctls. */
- 04888 #define KIOCSMAP _IOW('k', 3, keymap_t)
- 04889
- 04890 /* Memory ioctls. */
- 04891 #define MIOCRAMSIZE _IOW('m', 3, u32_t) /* Size of the ramdisk */
- 04892 #define MIOCSPSINFO _IOW('m', 4, void *)
- 04893 #define MIOCGPSINFO _IOR('m', 5, struct psinfo)
- 04894
- 04895 /* Magnetic tape ioctls. */
- 04896 #define MTIOCTOP _IOW('M', 1, struct mtop)
- 04897 #define MTIOCGET _IOR('M', 2, struct mtget)
- 04898
- 04899 /* SCSI command. */
- 04900 #define SCIOCCMD _IOW('S', 1, struct scsicmd)
- 04901
- 04902 /* CD-ROM ioctls. */
- 04903 #define CDIOPLAYTI _IOR('c', 1, struct cd_play_track)
- 04904 #define CDIOPLAYMSS _IOR('c', 2, struct cd_play_mss)
- 04905 #define CDIOREADTOCHDR _IOW('c', 3, struct cd_toc_entry)
- 04906 #define CDIOREADTOC _IOW('c', 4, struct cd_toc_entry)
- 04907 #define CDIOREADSUBCH _IOW('c', 5, struct cd_toc_entry)
- 04908 #define CDIOSTOP _IO ('c', 10)
- 04909 #define CDIOPAUSE _IO ('c', 11)
- 04910 #define CDIORESUME _IO ('c', 12)
- 04911 #define CDIOEJECT DIOCEJECT
- 04912
- 04913 /* Soundcard DSP ioctls. */
- 04914 #define DSPIORATE _IOR('s', 1, unsigned int)
- 04915 #define DSPIOSTEREO _IOR('s', 2, unsigned int)
- 04916 #define DSPIOSIZE _IOR('s', 3, unsigned int)
- 04917 #define DSPIOBITS _IOR('s', 4, unsigned int)
- 04918 #define DSPIOSIGN _IOR('s', 5, unsigned int)
- 04919 #define DSPIOMAX _IOW('s', 6, unsigned int)
- 04920 #define DSPIORESET _IO ('s', 7)
- 04921
- 04922 /* Soundcard mixer ioctls. */
- 04923 #define MIXIOGETVOLUME _IORW('s', 10, struct volume_level)
- 04924 #define MIXIOGETINPUTLEFT _IORW('s', 11, struct inout_ctrl)
- 04925 #define MIXIOGETINPUTRIGHT _IORW('s', 12, struct inout_ctrl)
- 04926 #define MIXIOGETOUTPUT _IORW('s', 13, struct inout_ctrl)
- 04927 #define MIXIOSETVOLUME _IORW('s', 20, struct volume_level)
- 04928 #define MIXIOSETINPUTLEFT _IORW('s', 21, struct inout_ctrl)
- 04929 #define MIXIOSETINPUTRIGHT _IORW('s', 22, struct inout_ctrl)
- 04930 #define MIXIOSETOUTPUT _IORW('s', 23, struct inout_ctrl)
- 04931
- 04932 #ifndef _ANSI
- 04933 #include <ansi.h>
- 04934 #endif
- .Op 53 include/sys/ioctl.h
- 04935
- 04936 _PROTOTYPE( int ioctl, (int _fd, int _request, void *_data) );
- 04937
- 04938 #endif /* _IOCTL_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/mtio.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 05000 /* <sys/mtio.h> magnetic tape commands Author: Kees J. Bot
- 05001 */
- 05002
- 05003 #ifndef _SYS__MTIO_H
- 05004 #define _SYS__MTIO_H
- 05005
- 05006 /* Tape operations: ioctl(fd, MTIOCTOP, &struct mtop) */
- 05007
- 05008 struct mtop {
- 05009 short mt_op; /* Operation (MTWEOF, etc.) */
- 05010 int mt_count; /* Repeat count. */
- 05011 };
- 05012
- 05013 #define MTWEOF 0 /* Write End-Of-File Marker */
- 05014 #define MTFSF 1 /* Forward Space File mark */
- 05015 #define MTBSF 2 /* Backward Space File mark */
- 05016 #define MTFSR 3 /* Forward Space Record */
- 05017 #define MTBSR 4 /* Backward Space Record */
- 05018 #define MTREW 5 /* Rewind tape */
- 05019 #define MTOFFL 6 /* Rewind and take Offline */
- 05020 #define MTNOP 7 /* No-Operation, set status only */
- 05021 #define MTRETEN 8 /* Retension (completely wind and rewind) */
- 05022 #define MTERASE 9 /* Erase the tape and rewind */
- 05023 #define MTEOM 10 /* Position at End-Of-Media */
- 05024 #define MTMODE 11 /* Select tape density */
- 05025 #define MTBLKZ 12 /* Select tape block size */
- 05026
- 05027 /* Tape status: ioctl(fd, MTIOCGET, &struct mtget) */
- 05028
- 05029 struct mtget {
- 05030 short mt_type; /* Type of tape device. */
- 05031
- 05032 /* Device dependent "registers". */
- 05033 short mt_dsreg; /* Drive status register. */
- 05034 short mt_erreg; /* Error register. */
- 05035 short dummy; /* (alignment) */
- 05036
- 05037 /* Misc info. */
- 05038 off_t mt_resid; /* Residual count. */
- 05039 off_t mt_fileno; /* Current File Number. */
- 05040 off_t mt_blkno; /* Current Block Number within file. */
- 05041 off_t mt_blksize; /* Current block size. */
- 05042 };
- 05043
- 05044 #endif /* _SYS__MTIO_H */
- .Ep 54 include/sys/ptrace.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/ptrace.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 05100 /* <sys/ptrace.h>
- 05101 * definitions for ptrace(2)
- 05102 */
- 05103
- 05104 #ifndef _PTRACE_H
- 05105 #define _PTRACE_H
- 05106
- 05107 #define T_STOP -1 /* stop the process */
- 05108 #define T_OK 0 /* enable tracing by parent for this process */
- 05109 #define T_GETINS 1 /* return value from instruction space */
- 05110 #define T_GETDATA 2 /* return value from data space */
- 05111 #define T_GETUSER 3 /* return value from user process table */
- 05112 #define T_SETINS 4 /* set value from instruction space */
- 05113 #define T_SETDATA 5 /* set value from data space */
- 05114 #define T_SETUSER 6 /* set value in user process table */
- 05115 #define T_RESUME 7 /* resume execution */
- 05116 #define T_EXIT 8 /* exit */
- 05117 #define T_STEP 9 /* set trace bit */
- 05118
- 05119 /* Function Prototypes. */
- 05120 #ifndef _ANSI_H
- 05121 #include <ansi.h>
- 05122 #endif
- 05123
- 05124 _PROTOTYPE( long ptrace, (int _req, pid_t _pid, long _addr, long _data) );
- 05125
- 05126 #endif /* _PTRACE_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/sigcontext.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 05200 #ifndef _SIGCONTEXT_H
- 05201 #define _SIGCONTEXT_H
- 05202
- 05203 /* The sigcontext structure is used by the sigreturn(2) system call.
- 05204 * sigreturn() is seldom called by user programs, but it is used internally
- 05205 * by the signal catching mechanism.
- 05206 */
- 05207
- 05208 #ifndef _ANSI_H
- 05209 #include <ansi.h>
- 05210 #endif
- 05211
- 05212 #ifndef _CONFIG_H
- 05213 #include <minix/config.h>
- 05214 #endif
- 05215
- 05216 #if !defined(CHIP)
- 05217 #include "error, configuration is not known"
- 05218 #endif
- 05219
- .Op 55 include/sys/sigcontext.h
- 05220 /* The following structure should match the stackframe_s structure used
- 05221 * by the kernel's context switching code. Floating point registers should
- 05222 * be added in a different struct.
- 05223 */
- 05224 #if (CHIP == INTEL)
- 05225 struct sigregs {
- 05226 #if _WORD_SIZE == 4
- 05227 short sr_gs;
- 05228 short sr_fs;
- 05229 #endif /* _WORD_SIZE == 4 */
- 05230 short sr_es;
- 05231 short sr_ds;
- 05232 int sr_di;
- 05233 int sr_si;
- 05234 int sr_bp;
- 05235 int sr_st; /* stack top -- used in kernel */
- 05236 int sr_bx;
- 05237 int sr_dx;
- 05238 int sr_cx;
- 05239 int sr_retreg;
- 05240 int sr_retadr; /* return address to caller of save -- used
- 05241 * in kernel */
- 05242 int sr_pc;
- 05243 int sr_cs;
- 05244 int sr_psw;
- 05245 int sr_sp;
- 05246 int sr_ss;
- 05247 };
- 05248
- 05249 struct sigframe { /* stack frame created for signalled process */
- 05250 _PROTOTYPE( void (*sf_retadr), (void) );
- 05251 int sf_signo;
- 05252 int sf_code;
- 05253 struct sigcontext *sf_scp;
- 05254 int sf_fp;
- 05255 _PROTOTYPE( void (*sf_retadr2), (void) );
- 05256 struct sigcontext *sf_scpcopy;
- 05257 };
- 05258
- 05259 #else
- 05260 #if (CHIP == M68000)
- 05261 struct sigregs {
- 05262 long sr_retreg; /* d0 */
- 05263 long sr_d1;
- 05264 long sr_d2;
- 05265 long sr_d3;
- 05266 long sr_d4;
- 05267 long sr_d5;
- 05268 long sr_d6;
- 05269 long sr_d7;
- 05270 long sr_a0;
- 05271 long sr_a1;
- 05272 long sr_a2;
- 05273 long sr_a3;
- 05274 long sr_a4;
- 05275 long sr_a5;
- 05276 long sr_a6;
- 05277 long sr_sp; /* also known as a7 */
- 05278 long sr_pc;
- 05279 short sr_psw;
- .Ep 56 include/sys/sigcontext.h
- 05280 short sr_dummy; /* make size multiple of 4 for system.c */
- 05281 };
- 05282 #else
- 05283 #include "error, CHIP is not supported"
- 05284 #endif
- 05285 #endif /* CHIP == INTEL */
- 05286
- 05287 struct sigcontext {
- 05288 int sc_flags; /* sigstack state to restore */
- 05289 long sc_mask; /* signal mask to restore */
- 05290 struct sigregs sc_regs; /* register set to restore */
- 05291 };
- 05292
- 05293 #if (CHIP == INTEL)
- 05294 #if _WORD_SIZE == 4
- 05295 #define sc_gs sc_regs.sr_gs
- 05296 #define sc_fs sc_regs.sr_fs
- 05297 #endif /* _WORD_SIZE == 4 */
- 05298 #define sc_es sc_regs.sr_es
- 05299 #define sc_ds sc_regs.sr_ds
- 05300 #define sc_di sc_regs.sr_di
- 05301 #define sc_si sc_regs.sr_si
- 05302 #define sc_fp sc_regs.sr_bp
- 05303 #define sc_st sc_regs.sr_st /* stack top -- used in kernel */
- 05304 #define sc_bx sc_regs.sr_bx
- 05305 #define sc_dx sc_regs.sr_dx
- 05306 #define sc_cx sc_regs.sr_cx
- 05307 #define sc_retreg sc_regs.sr_retreg
- 05308 #define sc_retadr sc_regs.sr_retadr /* return address to caller of
- 05309 save -- used in kernel */
- 05310 #define sc_pc sc_regs.sr_pc
- 05311 #define sc_cs sc_regs.sr_cs
- 05312 #define sc_psw sc_regs.sr_psw
- 05313 #define sc_sp sc_regs.sr_sp
- 05314 #define sc_ss sc_regs.sr_ss
- 05315 #endif /* CHIP == INTEL */
- 05316
- 05317 #if (CHIP == M68000)
- 05318 #define sc_retreg sc_regs.sr_retreg
- 05319 #define sc_d1 sc_regs.sr_d1
- 05320 #define sc_d2 sc_regs.sr_d2
- 05321 #define sc_d3 sc_regs.sr_d3
- 05322 #define sc_d4 sc_regs.sr_d4
- 05323 #define sc_d5 sc_regs.sr_d5
- 05324 #define sc_d6 sc_regs.sr_d6
- 05325 #define sc_d7 sc_regs.sr_d7
- 05326 #define sc_a0 sc_regs.sr_a0
- 05327 #define sc_a1 sc_regs.sr_a1
- 05328 #define sc_a2 sc_regs.sr_a2
- 05329 #define sc_a3 sc_regs.sr_a3
- 05330 #define sc_a4 sc_regs.sr_a4
- 05331 #define sc_a5 sc_regs.sr_a5
- 05332 #define sc_fp sc_regs.sr_a6
- 05333 #define sc_sp sc_regs.sr_sp
- 05334 #define sc_pc sc_regs.sr_pc
- 05335 #define sc_psw sc_regs.sr_psw
- 05336 #endif /* CHIP == M68000 */
- 05337
- 05338 /* Values for sc_flags. Must agree with <minix/jmp_buf.h>. */
- 05339 #define SC_SIGCONTEXT 2 /* nonzero when signal context is included */
- .Op 57 include/sys/sigcontext.h
- 05340 #define SC_NOREGLOCALS 4 /* nonzero when registers are not to be
- 05341 saved and restored */
- 05342
- 05343 _PROTOTYPE( int sigreturn, (struct sigcontext *_scp) );
- 05344
- 05345 #endif /* _SIGCONTEXT_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/stat.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 05400 /* The <sys/stat.h> header defines a struct that is used in the stat() and
- 05401 * fstat functions. The information in this struct comes from the i-node of
- 05402 * some file. These calls are the only approved way to inspect i-nodes.
- 05403 */
- 05404
- 05405 #ifndef _STAT_H
- 05406 #define _STAT_H
- 05407
- 05408 struct stat {
- 05409 dev_t st_dev; /* major/minor device number */
- 05410 ino_t st_ino; /* i-node number */
- 05411 mode_t st_mode; /* file mode, protection bits, etc. */
- 05412 short int st_nlink; /* # links; TEMPORARY HACK: should be nlink_t*/
- 05413 uid_t st_uid; /* uid of the file's owner */
- 05414 short int st_gid; /* gid; TEMPORARY HACK: should be gid_t */
- 05415 dev_t st_rdev;
- 05416 off_t st_size; /* file size */
- 05417 time_t st_atime; /* time of last access */
- 05418 time_t st_mtime; /* time of last data modification */
- 05419 time_t st_ctime; /* time of last file status change */
- 05420 };
- 05421
- 05422 /* Traditional mask definitions for st_mode. */
- 05423 /* The ugly casts on only some of the definitions are to avoid suprising sign
- 05424 * extensions such as S_IFREG != (mode_t) S_IFREG when ints are 32 bits.
- 05425 */
- 05426 #define S_IFMT ((mode_t) 0170000) /* type of file */
- 05427 #define S_IFREG ((mode_t) 0100000) /* regular */
- 05428 #define S_IFBLK 0060000 /* block special */
- 05429 #define S_IFDIR 0040000 /* directory */
- 05430 #define S_IFCHR 0020000 /* character special */
- 05431 #define S_IFIFO 0010000 /* this is a FIFO */
- 05432 #define S_ISUID 0004000 /* set user id on execution */
- 05433 #define S_ISGID 0002000 /* set group id on execution */
- 05434 /* next is reserved for future use */
- 05435 #define S_ISVTX 01000 /* save swapped text even after use */
- 05436
- 05437 /* POSIX masks for st_mode. */
- 05438 #define S_IRWXU 00700 /* owner: rwx------ */
- 05439 #define S_IRUSR 00400 /* owner: r-------- */
- 05440 #define S_IWUSR 00200 /* owner: -w------- */
- 05441 #define S_IXUSR 00100 /* owner: --x------ */
- 05442
- 05443 #define S_IRWXG 00070 /* group: ---rwx--- */
- 05444 #define S_IRGRP 00040 /* group: ---r----- */
- .Ep 58 include/sys/stat.h
- 05445 #define S_IWGRP 00020 /* group: ----w---- */
- 05446 #define S_IXGRP 00010 /* group: -----x--- */
- 05447
- 05448 #define S_IRWXO 00007 /* others: ------rwx */
- 05449 #define S_IROTH 00004 /* others: ------r-- */
- 05450 #define S_IWOTH 00002 /* others: -------w- */
- 05451 #define S_IXOTH 00001 /* others: --------x */
- 05452
- 05453 /* The following macros test st_mode (from POSIX Sec. 5.6.1.1). */
- 05454 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) /* is a reg file */
- 05455 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) /* is a directory */
- 05456 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) /* is a char spec */
- 05457 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) /* is a block spec */
- 05458 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* is a pipe/FIFO */
- 05459
- 05460
- 05461 /* Function Prototypes. */
- 05462 #ifndef _ANSI_H
- 05463 #include <ansi.h>
- 05464 #endif
- 05465
- 05466 _PROTOTYPE( int chmod, (const char *_path, Mode_t _mode) );
- 05467 _PROTOTYPE( int fstat, (int _fildes, struct stat *_buf) );
- 05468 _PROTOTYPE( int mkdir, (const char *_path, Mode_t _mode) );
- 05469 _PROTOTYPE( int mkfifo, (const char *_path, Mode_t _mode) );
- 05470 _PROTOTYPE( int stat, (const char *_path, struct stat *_buf) );
- 05471 _PROTOTYPE( mode_t umask, (Mode_t _cmask) );
- 05472
- 05473 #endif /* _STAT_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/times.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 05500 /* The <times.h> header is for time times() system call. */
- 05501
- 05502 #ifndef _TIMES_H
- 05503 #define _TIMES_H
- 05504
- 05505 #ifndef _CLOCK_T
- 05506 #define _CLOCK_T
- 05507 typedef long clock_t; /* unit for system accounting */
- 05508 #endif
- 05509
- 05510 struct tms {
- 05511 clock_t tms_utime;
- 05512 clock_t tms_stime;
- 05513 clock_t tms_cutime;
- 05514 clock_t tms_cstime;
- 05515 };
- 05516
- 05517 /* Function Prototypes. */
- 05518 #ifndef _ANSI_H
- 05519 #include <ansi.h>
- 05520 #endif
- 05521
- 05522 _PROTOTYPE( clock_t times, (struct tms *_buffer) );
- 05523
- 05524 #endif /* _TIMES_H */
- .Op 59 include/sys/types.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/types.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 05600 /* The <sys/types.h> header contains important data type definitions.
- 05601 * It is considered good programming practice to use these definitions,
- 05602 * instead of the underlying base type. By convention, all type names end
- 05603 * with _t.
- 05604 */
- 05605
- 05606 #ifndef _TYPES_H
- 05607 #define _TYPES_H
- 05608
- 05609 /* _ANSI is somehow used to determine whether or not the compiler is a
- 05610 * 16 bit compiler
- 05611 */
- 05612 #ifndef _ANSI
- 05613 #include <ansi.h>
- 05614 #endif
- 05615
- 05616 /* The type size_t holds all results of the sizeof operator. At first glance,
- 05617 * it seems obvious that it should be an unsigned int, but this is not always
- 05618 * the case. For example, MINIX-ST (68000) has 32-bit pointers and 16-bit
- 05619 * integers. When one asks for the size of a 70K struct or array, the result
- 05620 * requires 17 bits to express, so size_t must be a long type. The type
- 05621 * ssize_t is the signed version of size_t.
- 05622 */
- 05623 #ifndef _SIZE_T
- 05624 #define _SIZE_T
- 05625 typedef unsigned int size_t;
- 05626 #endif
- 05627
- 05628 #ifndef _SSIZE_T
- 05629 #define _SSIZE_T
- 05630 typedef int ssize_t;
- 05631 #endif
- 05632
- 05633 #ifndef _TIME_T
- 05634 #define _TIME_T
- 05635 typedef long time_t; /* time in sec since 1 Jan 1970 0000 GMT */
- 05636 #endif
- 05637
- 05638 #ifndef _CLOCK_T
- 05639 #define _CLOCK_T
- 05640 typedef long clock_t; /* unit for system accounting */
- 05641 #endif
- 05642
- 05643 #ifndef _SIGSET_T
- 05644 #define _SIGSET_T
- 05645 typedef unsigned long sigset_t;
- 05646 #endif
- 05647
- 05648 /* Types used in disk, inode, etc. data structures. */
- 05649 typedef short dev_t; /* holds (major|minor) device pair */
- 05650 typedef char gid_t; /* group id */
- 05651 typedef unsigned short ino_t; /* i-node number */
- 05652 typedef unsigned short mode_t; /* file type and permissions bits */
- 05653 typedef char nlink_t; /* number of links to a file */
- 05654 typedef unsigned long off_t; /* offset within a file */
- .Ep 60 include/sys/types.h
- 05655 typedef int pid_t; /* process id (must be signed) */
- 05656 typedef short uid_t; /* user id */
- 05657 typedef unsigned long zone_t; /* zone number */
- 05658 typedef unsigned long block_t; /* block number */
- 05659 typedef unsigned long bit_t; /* bit number in a bit map */
- 05660 typedef unsigned short zone1_t; /* zone number for V1 file systems */
- 05661 typedef unsigned short bitchunk_t; /* collection of bits in a bitmap */
- 05662
- 05663 typedef unsigned char u8_t; /* 8 bit type */
- 05664 typedef unsigned short u16_t; /* 16 bit type */
- 05665 typedef unsigned long u32_t; /* 32 bit type */
- 05666
- 05667 typedef char i8_t; /* 8 bit signed type */
- 05668 typedef short i16_t; /* 16 bit signed type */
- 05669 typedef long i32_t; /* 32 bit signed type */
- 05670
- 05671 /* The following types are needed because MINIX uses K&R style function
- 05672 * definitions (for maximum portability). When a short, such as dev_t, is
- 05673 * passed to a function with a K&R definition, the compiler automatically
- 05674 * promotes it to an int. The prototype must contain an int as the parameter,
- 05675 * not a short, because an int is what an old-style function definition
- 05676 * expects. Thus using dev_t in a prototype would be incorrect. It would be
- 05677 * sufficient to just use int instead of dev_t in the prototypes, but Dev_t
- 05678 * is clearer.
- 05679 */
- 05680 typedef int Dev_t;
- 05681 typedef int Gid_t;
- 05682 typedef int Nlink_t;
- 05683 typedef int Uid_t;
- 05684 typedef int U8_t;
- 05685 typedef unsigned long U32_t;
- 05686 typedef int I8_t;
- 05687 typedef int I16_t;
- 05688 typedef long I32_t;
- 05689
- 05690 /* ANSI C makes writing down the promotion of unsigned types very messy. When
- 05691 * sizeof(short) == sizeof(int), there is no promotion, so the type stays
- 05692 * unsigned. When the compiler is not ANSI, there is usually no loss of
- 05693 * unsignedness, and there are usually no prototypes so the promoted type
- 05694 * doesn't matter. The use of types like Ino_t is an attempt to use ints
- 05695 * (which are not promoted) while providing information to the reader.
- 05696 */
- 05697
- 05698 #ifndef _ANSI_H
- 05699 #include <ansi.h>
- 05700 #endif
- 05701
- 05702 #if _EM_WSIZE == 2 || !defined(_ANSI)
- 05703 typedef unsigned int Ino_t;
- 05704 typedef unsigned int Zone1_t;
- 05705 typedef unsigned int Bitchunk_t;
- 05706 typedef unsigned int U16_t;
- 05707 typedef unsigned int Mode_t;
- 05708
- 05709 #else /* _EM_WSIZE == 4, or _EM_WSIZE undefined, or _ANSI defined */
- 05710 typedef int Ino_t;
- 05711 typedef int Zone1_t;
- 05712 typedef int Bitchunk_t;
- 05713 typedef int U16_t;
- 05714 typedef int Mode_t;
- .Op 61 include/sys/types.h
- 05715
- 05716 #endif /* _EM_WSIZE == 2, etc */
- 05717
- 05718 /* Signal handler type, e.g. SIG_IGN */
- 05719 #if defined(_ANSI)
- 05720 typedef void (*sighandler_t) (int);
- 05721 #else
- 05722 typedef void (*sighandler_t)();
- 05723 #endif
- 05724
- 05725 #endif /* _TYPES_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/utsname.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 05800 /* The <sys/utsname.h> header gives the system name. */
- 05801
- 05802 #ifndef _UTSNAME_H
- 05803 #define _UTSNAME_H
- 05804
- 05805 struct utsname {
- 05806 char sysname[15+1];
- 05807 char nodename[255+1];
- 05808 char release[11+1];
- 05809 char version[7+1];
- 05810 char machine[11+1];
- 05811 char arch[11+1];
- 05812 };
- 05813
- 05814 /* Function Prototypes. */
- 05815 #ifndef _ANSI_H
- 05816 #include <ansi.h>
- 05817 #endif
- 05818
- 05819 _PROTOTYPE( int uname, (struct utsname *_name) );
- 05820
- 05821 #endif /* _UTSNAME_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/wait.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 05900 /* The <sys/wait.h> header contains macros related to wait(). The value
- 05901 * returned by wait() and waitpid() depends on whether the process
- 05902 * terminated by an exit() call, was killed by a signal, or was stopped
- 05903 * due to job control, as follows:
- 05904 *
- 05905 * High byte Low byte
- 05906 * +---------------------+
- 05907 * exit(status) | status | 0 |
- 05908 * +---------------------+
- 05909 * killed by signal | 0 | signal |
- .Ep 62 include/sys/wait.h
- 05910 * +---------------------+
- 05911 * stopped (job control) | signal | 0177 |
- 05912 * +---------------------+
- 05913 */
- 05914
- 05915 #ifndef _WAIT_H
- 05916 #define _WAIT_H
- 05917
- 05918 #define _LOW(v) ( (v) & 0377)
- 05919 #define _HIGH(v) ( ((v) >> 8) & 0377)
- 05920
- 05921 #define WNOHANG 1 /* do not wait for child to exit */
- 05922 #define WUNTRACED 2 /* for job control; not implemented */
- 05923
- 05924 #define WIFEXITED(s) (_LOW(s) == 0) /* normal exit */
- 05925 #define WEXITSTATUS(s) (_HIGH(s)) /* exit status */
- 05926 #define WTERMSIG(s) (_LOW(s) & 0177) /* sig value */
- 05927 #define WIFSIGNALED(s) (((unsigned int)(s)-1 & 0xFFFF) < 0xFF) /* signaled */
- 05928 #define WIFSTOPPED(s) (_LOW(s) == 0177) /* stopped */
- 05929 #define WSTOPSIG(s) (_HIGH(s) & 0377) /* stop signal */
- 05930
- 05931 /* Function Prototypes. */
- 05932 #ifndef _ANSI_H
- 05933 #include <ansi.h>
- 05934 #endif
- 05935
- 05936 _PROTOTYPE( pid_t wait, (int *_stat_loc) );
- 05937 _PROTOTYPE( pid_t waitpid, (pid_t _pid, int *_stat_loc, int _options) );
- 05938
- 05939 #endif /* _WAIT_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/boot.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 06000 /* boot.h */
- 06001
- 06002 #ifndef _BOOT_H
- 06003 #define _BOOT_H
- 06004
- 06005 /* Redefine root and root image devices as variables.
- 06006 * This keeps the diffs small but may cause future confusion.
- 06007 */
- 06008 #define ROOT_DEV (boot_parameters.bp_rootdev)
- 06009 #define IMAGE_DEV (boot_parameters.bp_ramimagedev)
- 06010
- 06011 /* Device numbers of RAM, floppy and hard disk devices.
- 06012 * h/com.h defines RAM_DEV but only as the minor number.
- 06013 */
- 06014 #define DEV_FD0 0x200
- 06015 #define DEV_HD0 0x300
- 06016 #define DEV_RAM 0x100
- 06017 #define DEV_SCSI 0x700 /* Atari TT only */
- 06018
- 06019 /* Structure to hold boot parameters. */
- .Op 63 include/minix/boot.h
- 06020 struct bparam_s
- 06021 {
- 06022 dev_t bp_rootdev;
- 06023 dev_t bp_ramimagedev;
- 06024 unsigned short bp_ramsize;
- 06025 unsigned short bp_processor;
- 06026 };
- 06027
- 06028 extern struct bparam_s boot_parameters;
- 06029 #endif /* _BOOT_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/callnr.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 06100 #define NCALLS 77 /* number of system calls allowed */
- 06101
- 06102 #define EXIT 1
- 06103 #define FORK 2
- 06104 #define READ 3
- 06105 #define WRITE 4
- 06106 #define OPEN 5
- 06107 #define CLOSE 6
- 06108 #define WAIT 7
- 06109 #define CREAT 8
- 06110 #define LINK 9
- 06111 #define UNLINK 10
- 06112 #define WAITPID 11
- 06113 #define CHDIR 12
- 06114 #define TIME 13
- 06115 #define MKNOD 14
- 06116 #define CHMOD 15
- 06117 #define CHOWN 16
- 06118 #define BRK 17
- 06119 #define STAT 18
- 06120 #define LSEEK 19
- 06121 #define GETPID 20
- 06122 #define MOUNT 21
- 06123 #define UMOUNT 22
- 06124 #define SETUID 23
- 06125 #define GETUID 24
- 06126 #define STIME 25
- 06127 #define PTRACE 26
- 06128 #define ALARM 27
- 06129 #define FSTAT 28
- 06130 #define PAUSE 29
- 06131 #define UTIME 30
- 06132 #define ACCESS 33
- 06133 #define SYNC 36
- 06134 #define KILL 37
- 06135 #define RENAME 38
- 06136 #define MKDIR 39
- 06137 #define RMDIR 40
- 06138 #define DUP 41
- 06139 #define PIPE 42
- .Ep 64 include/minix/callnr.h
- 06140 #define TIMES 43
- 06141 #define SETGID 46
- 06142 #define GETGID 47
- 06143 #define SIGNAL 48
- 06144 #define IOCTL 54
- 06145 #define FCNTL 55
- 06146 #define EXEC 59
- 06147 #define UMASK 60
- 06148 #define CHROOT 61
- 06149 #define SETSID 62
- 06150 #define GETPGRP 63
- 06151
- 06152 /* The following are not system calls, but are processed like them. */
- 06153 #define KSIG 64 /* kernel detected a signal */
- 06154 #define UNPAUSE 65 /* to MM or FS: check for EINTR */
- 06155 #define REVIVE 67 /* to FS: revive a sleeping process */
- 06156 #define TASK_REPLY 68 /* to FS: reply code from tty task */
- 06157
- 06158 /* Posix signal handling. */
- 06159 #define SIGACTION 71
- 06160 #define SIGSUSPEND 72
- 06161 #define SIGPENDING 73
- 06162 #define SIGPROCMASK 74
- 06163 #define SIGRETURN 75
- 06164
- 06165 #define REBOOT 76
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/cdrom.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 06200 /* This file contains some structures used by the Mitsumi cdrom driver.
- 06201 *
- 06202 * Feb 13 1995 Author: Michel R. Prevenier
- 06203 */
- 06204
- 06205 /* Index into the mss arrays */
- 06206 #define MINUTES 0
- 06207 #define SECONDS 1
- 06208 #define SECTOR 2
- 06209
- 06210 struct cd_play_mss
- 06211 {
- 06212 u8_t begin_mss[3];
- 06213 u8_t end_mss[3];
- 06214 };
- 06215
- 06216
- 06217 struct cd_play_track
- 06218 {
- 06219 u8_t begin_track;
- 06220 u8_t end_track;
- 06221 };
- 06222
- 06223
- 06224 struct cd_disk_info
- .Op 65 include/minix/cdrom.h
- 06225 {
- 06226 u8_t first_track;
- 06227 u8_t last_track;
- 06228 u8_t disk_length_mss[3];
- 06229 u8_t first_track_mss[3];
- 06230 };
- 06231
- 06232
- 06233 struct cd_toc_entry
- 06234 {
- 06235 u8_t control_address;
- 06236 u8_t track_nr;
- 06237 u8_t index_nr;
- 06238 u8_t track_time_mss[3];
- 06239 u8_t reserved;
- 06240 u8_t position_mss[3];
- 06241 };
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/com.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 06300 /* System calls. */
- 06301 #define SEND 1 /* function code for sending messages */
- 06302 #define RECEIVE 2 /* function code for receiving messages */
- 06303 #define BOTH 3 /* function code for SEND + RECEIVE */
- 06304 #define ANY (NR_PROCS+100) /* receive(ANY, buf) accepts from any source */
- 06305
- 06306 /* Task numbers, function codes and reply codes. */
- 06307
- 06308 /* The values of several task numbers depend on whether they or other tasks
- 06309 * are enabled. They are defined as (PREVIOUS_TASK - ENABLE_TASK) in general.
- 06310 * ENABLE_TASK is either 0 or 1, so a task either gets a new number, or gets
- 06311 * the same number as the previous task and is further unused.
- 06312 * The TTY task must always have the most negative number so that it is
- 06313 * initialized first. Many of the TTY function codes are shared with other
- 06314 * tasks.
- 06315 */
- 06316
- 06317 #define TTY (DL_ETH - 1)
- 06318 /* terminal I/O class */
- 06319 # define CANCEL 0 /* general req to force a task to cancel */
- 06320 # define HARD_INT 2 /* fcn code for all hardware interrupts */
- 06321 # define DEV_READ 3 /* fcn code for reading from tty */
- 06322 # define DEV_WRITE 4 /* fcn code for writing to tty */
- 06323 # define DEV_IOCTL 5 /* fcn code for ioctl */
- 06324 # define DEV_OPEN 6 /* fcn code for opening tty */
- 06325 # define DEV_CLOSE 7 /* fcn code for closing tty */
- 06326 # define SCATTERED_IO 8 /* fcn code for multiple reads/writes */
- 06327 # define TTY_SETPGRP 9 /* fcn code for setpgroup */
- 06328 # define TTY_EXIT 10 /* a process group leader has exited */
- 06329 # define OPTIONAL_IO 16 /* modifier to DEV_* codes within vector */
- 06330 # define SUSPEND -998 /* used in interrupts when tty has no data */
- 06331
- 06332 #define DL_ETH (CDROM - ENABLE_NETWORKING)
- 06333 /* networking task */
- 06334
- .Ep 66 include/minix/com.h
- 06335 /* Message type for data link layer reqests. */
- 06336 # define DL_WRITE 3
- 06337 # define DL_WRITEV 4
- 06338 # define DL_READ 5
- 06339 # define DL_READV 6
- 06340 # define DL_INIT 7
- 06341 # define DL_STOP 8
- 06342 # define DL_GETSTAT 9
- 06343
- 06344 /* Message type for data link layer replies. */
- 06345 # define DL_INIT_REPLY 20
- 06346 # define DL_TASK_REPLY 21
- 06347
- 06348 # define DL_PORT m2_i1
- 06349 # define DL_PROC m2_i2
- 06350 # define DL_COUNT m2_i3
- 06351 # define DL_MODE m2_l1
- 06352 # define DL_CLCK m2_l2
- 06353 # define DL_ADDR m2_p1
- 06354 # define DL_STAT m2_l1
- 06355
- 06356 /* Bits in 'DL_STAT' field of DL replies. */
- 06357 # define DL_PACK_SEND 0x01
- 06358 # define DL_PACK_RECV 0x02
- 06359 # define DL_READ_IP 0x04
- 06360
- 06361 /* Bits in 'DL_MODE' field of DL requests. */
- 06362 # define DL_NOMODE 0x0
- 06363 # define DL_PROMISC_REQ 0x2
- 06364 # define DL_MULTI_REQ 0x4
- 06365 # define DL_BROAD_REQ 0x8
- 06366
- 06367 # define NW_OPEN DEV_OPEN
- 06368 # define NW_CLOSE DEV_CLOSE
- 06369 # define NW_READ DEV_READ
- 06370 # define NW_WRITE DEV_WRITE
- 06371 # define NW_IOCTL DEV_IOCTL
- 06372 # define NW_CANCEL CANCEL
- 06373
- 06374 #define CDROM (AUDIO - ENABLE_CDROM)
- 06375 /* cd-rom device task */
- 06376
- 06377 #define AUDIO (MIXER - ENABLE_AUDIO)
- 06378 #define MIXER (SCSI - ENABLE_AUDIO)
- 06379 /* audio & mixer device tasks */
- 06380
- 06381 #define SCSI (WINCHESTER - ENABLE_SCSI)
- 06382 /* scsi device task */
- 06383
- 06384 #define WINCHESTER (SYN_ALRM_TASK - ENABLE_WINI)
- 06385 /* winchester (hard) disk class */
- 06386
- 06387 #define SYN_ALRM_TASK -8 /* task to send CLOCK_INT messages */
- 06388
- 06389 #define IDLE -7 /* task to run when there's nothing to run */
- 06390
- 06391 #define PRINTER -6 /* printer I/O class */
- 06392
- 06393 #define FLOPPY -5 /* floppy disk class */
- 06394
- .Op 67 include/minix/com.h
- 06395 #define MEM -4 /* /dev/ram, /dev/(k)mem and /dev/null class */
- 06396 # define NULL_MAJOR 1 /* major device for /dev/null */
- 06397 # define RAM_DEV 0 /* minor device for /dev/ram */
- 06398 # define MEM_DEV 1 /* minor device for /dev/mem */
- 06399 # define KMEM_DEV 2 /* minor device for /dev/kmem */
- 06400 # define NULL_DEV 3 /* minor device for /dev/null */
- 06401
- 06402 #define CLOCK -3 /* clock class */
- 06403 # define SET_ALARM 1 /* fcn code to CLOCK, set up alarm */
- 06404 # define GET_TIME 3 /* fcn code to CLOCK, get real time */
- 06405 # define SET_TIME 4 /* fcn code to CLOCK, set real time */
- 06406 # define GET_UPTIME 5 /* fcn code to CLOCK, get uptime */
- 06407 # define SET_SYNC_AL 6 /* fcn code to CLOCK, set up alarm which */
- 06408 /* times out with a send */
- 06409 # define REAL_TIME 1 /* reply from CLOCK: here is real time */
- 06410 # define CLOCK_INT HARD_INT
- 06411 /* this code will only be sent by */
- 06412 /* SYN_ALRM_TASK to a task that requested a */
- 06413 /* synchronous alarm */
- 06414
- 06415 #define SYSTASK -2 /* internal functions */
- 06416 # define SYS_XIT 1 /* fcn code for sys_xit(parent, proc) */
- 06417 # define SYS_GETSP 2 /* fcn code for sys_sp(proc, &new_sp) */
- 06418 # define SYS_OLDSIG 3 /* fcn code for sys_oldsig(proc, sig) */
- 06419 # define SYS_FORK 4 /* fcn code for sys_fork(parent, child) */
- 06420 # define SYS_NEWMAP 5 /* fcn code for sys_newmap(procno, map_ptr) */
- 06421 # define SYS_COPY 6 /* fcn code for sys_copy(ptr) */
- 06422 # define SYS_EXEC 7 /* fcn code for sys_exec(procno, new_sp) */
- 06423 # define SYS_TIMES 8 /* fcn code for sys_times(procno, bufptr) */
- 06424 # define SYS_ABORT 9 /* fcn code for sys_abort() */
- 06425 # define SYS_FRESH 10 /* fcn code for sys_fresh() (Atari only) */
- 06426 # define SYS_KILL 11 /* fcn code for sys_kill(proc, sig) */
- 06427 # define SYS_GBOOT 12 /* fcn code for sys_gboot(procno, bootptr) */
- 06428 # define SYS_UMAP 13 /* fcn code for sys_umap(procno, etc) */
- 06429 # define SYS_MEM 14 /* fcn code for sys_mem() */
- 06430 # define SYS_TRACE 15 /* fcn code for sys_trace(req,pid,addr,data) */
- 06431 # define SYS_VCOPY 16 /* fnc code for sys_vcopy(src_proc, dest_proc,
- 06432 vcopy_s, vcopy_ptr) */
- 06433 # define SYS_SENDSIG 17 /* fcn code for sys_sendsig(&sigmsg) */
- 06434 # define SYS_SIGRETURN 18 /* fcn code for sys_sigreturn(&sigmsg) */
- 06435 # define SYS_ENDSIG 19 /* fcn code for sys_endsig(procno) */
- 06436 # define SYS_GETMAP 20 /* fcn code for sys_getmap(procno, map_ptr) */
- 06437
- 06438 #define HARDWARE -1 /* used as source on interrupt generated msgs*/
- 06439
- 06440 /* Names of message fields for messages to CLOCK task. */
- 06441 #define DELTA_TICKS m6_l1 /* alarm interval in clock ticks */
- 06442 #define FUNC_TO_CALL m6_f1 /* pointer to function to call */
- 06443 #define NEW_TIME m6_l1 /* value to set clock to (SET_TIME) */
- 06444 #define CLOCK_PROC_NR m6_i1 /* which proc (or task) wants the alarm? */
- 06445 #define SECONDS_LEFT m6_l1 /* how many seconds were remaining */
- 06446
- 06447 /* Names of message fields used for messages to block and character tasks. */
- 06448 #define DEVICE m2_i1 /* major-minor device */
- 06449 #define PROC_NR m2_i2 /* which (proc) wants I/O? */
- 06450 #define COUNT m2_i3 /* how many bytes to transfer */
- 06451 #define REQUEST m2_i3 /* ioctl request code */
- 06452 #define POSITION m2_l1 /* file offset */
- 06453 #define ADDRESS m2_p1 /* core buffer address */
- 06454
- .Ep 68 include/minix/com.h
- 06455 /* Names of message fields for messages to TTY task. */
- 06456 #define TTY_LINE DEVICE /* message parameter: terminal line */
- 06457 #define TTY_REQUEST COUNT /* message parameter: ioctl request code */
- 06458 #define TTY_SPEK POSITION /* message parameter: ioctl speed, erasing */
- 06459 #define TTY_FLAGS m2_l2 /* message parameter: ioctl tty mode */
- 06460 #define TTY_PGRP m2_i3 /* message parameter: process group */
- 06461
- 06462 /* Names of the message fields for QIC 02 status reply from tape driver */
- 06463 #define TAPE_STAT0 m2_l1
- 06464 #define TAPE_STAT1 m2_l2
- 06465
- 06466 /* Names of messages fields used in reply messages from tasks. */
- 06467 #define REP_PROC_NR m2_i1 /* # of proc on whose behalf I/O was done */
- 06468 #define REP_STATUS m2_i2 /* bytes transferred or error number */
- 06469
- 06470 /* Names of fields for copy message to SYSTASK. */
- 06471 #define SRC_SPACE m5_c1 /* T or D space (stack is also D) */
- 06472 #define SRC_PROC_NR m5_i1 /* process to copy from */
- 06473 #define SRC_BUFFER m5_l1 /* virtual address where data come from */
- 06474 #define DST_SPACE m5_c2 /* T or D space (stack is also D) */
- 06475 #define DST_PROC_NR m5_i2 /* process to copy to */
- 06476 #define DST_BUFFER m5_l2 /* virtual address where data go to */
- 06477 #define COPY_BYTES m5_l3 /* number of bytes to copy */
- 06478
- 06479 /* Field names for accounting, SYSTASK and miscellaneous. */
- 06480 #define USER_TIME m4_l1 /* user time consumed by process */
- 06481 #define SYSTEM_TIME m4_l2 /* system time consumed by process */
- 06482 #define CHILD_UTIME m4_l3 /* user time consumed by process' children */
- 06483 #define CHILD_STIME m4_l4 /* sys time consumed by process' children */
- 06484 #define BOOT_TICKS m4_l5 /* number of clock ticks since boot time */
- 06485
- 06486 #define PROC1 m1_i1 /* indicates a process */
- 06487 #define PROC2 m1_i2 /* indicates a process */
- 06488 #define PID m1_i3 /* process id passed from MM to kernel */
- 06489 #define STACK_PTR m1_p1 /* used for stack ptr in sys_exec, sys_getsp */
- 06490 #define PR m6_i1 /* process number for sys_sig */
- 06491 #define SIGNUM m6_i2 /* signal number for sys_sig */
- 06492 #define FUNC m6_f1 /* function pointer for sys_sig */
- 06493 #define MEM_PTR m1_p1 /* tells where memory map is for sys_newmap */
- 06494 #define NAME_PTR m1_p2 /* tells where program name is for dmp */
- 06495 #define IP_PTR m1_p3 /* initial value for ip after exec */
- 06496 #define SIG_PROC m2_i1 /* process number for inform */
- 06497 #define SIG_MAP m2_l1 /* used by kernel for passing signal bit map */
- 06498 #define SIG_MSG_PTR m1_i1 /* pointer to info to build sig catch stack */
- 06499 #define SIG_CTXT_PTR m1_p1 /* pointer to info to restore signal context */
- .Op 69 include/minix/config.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/config.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 06500 #ifndef _CONFIG_H
- 06501 #define _CONFIG_H
- 06502
- 06503 /* Minix release and version numbers. */
- 06504 #define OS_RELEASE "2.0"
- 06505 #define OS_VERSION "0"
- 06506
- 06507 /* This file sets configuration parameters for the MINIX kernel, FS, and MM.
- 06508 * It is divided up into two main sections. The first section contains
- 06509 * user-settable parameters. In the second section, various internal system
- 06510 * parameters are set based on the user-settable parameters.
- 06511 */
- 06512
- 06513 /*===========================================================================*
- 06514 * This section contains user-settable parameters *
- 06515 *===========================================================================*/
- 06516 #define MACHINE IBM_PC /* Must be one of the names listed below */
- 06517
- 06518 #define IBM_PC 1 /* any 8088 or 80x86-based system */
- 06519 #define SUN_4 40 /* any Sun SPARC-based system */
- 06520 #define SUN_4_60 40 /* Sun-4/60 (aka SparcStation 1 or Campus) */
- 06521 #define ATARI 60 /* ATARI ST/STe/TT (68000/68030) */
- 06522 #define AMIGA 61 /* Commodore Amiga (68000) */
- 06523 #define MACINTOSH 62 /* Apple Macintosh (68000) */
- 06524
- 06525 /* Word size in bytes (a constant equal to sizeof(int)). */
- 06526 #if __ACK__
- 06527 #define _WORD_SIZE _EM_WSIZE
- 06528 #endif
- 06529
- 06530
- 06531 /* If ROBUST is set to 1, writes of i-node, directory, and indirect blocks
- 06532 * from the cache happen as soon as the blocks are modified. This gives a more
- 06533 * robust, but slower, file system. If it is set to 0, these blocks are not
- 06534 * given any special treatment, which may cause problems if the system crashes.
- 06535 */
- 06536 #define ROBUST 0 /* 0 for speed, 1 for robustness */
- 06537
- 06538 /* Number of slots in the process table for user processes. */
- 06539 #define NR_PROCS 32
- 06540
- 06541 /* The buffer cache should be made as large as you can afford. */
- 06542 #if (MACHINE == IBM_PC && _WORD_SIZE == 2)
- 06543 #define NR_BUFS 40 /* # blocks in the buffer cache */
- 06544 #define NR_BUF_HASH 64 /* size of buf hash table; MUST BE POWER OF 2*/
- 06545 #endif
- 06546
- 06547 #if (MACHINE == IBM_PC && _WORD_SIZE == 4)
- 06548 #define NR_BUFS 1024 /* # blocks in the buffer cache */
- 06549 #define NR_BUF_HASH 2048 /* size of buf hash table; MUST BE POWER OF 2*/
- 06550 #endif
- 06551
- 06552 #if (MACHINE == SUN_4_60)
- 06553 #define NR_BUFS 512 /* # blocks in the buffer cache (<=1536) */
- 06554 #define NR_BUF_HASH 512 /* size of buf hash table; MUST BE POWER OF 2*/
- .Ep 70 include/minix/config.h
- 06555 #endif
- 06556
- 06557 #if (MACHINE == ATARI)
- 06558 #define NR_BUFS 1536 /* # blocks in the buffer cache (<=1536) */
- 06559 #define NR_BUF_HASH 2048 /* size of buf hash table; MUST BE POWER OF 2*/
- 06560 #endif
- 06561
- 06562 /* Defines for kernel configuration. */
- 06563 #define AUTO_BIOS 0 /* xt_wini.c - use Western's autoconfig BIOS */
- 06564 #define LINEWRAP 1 /* console.c - wrap lines at column 80 */
- 06565 #define ALLOW_GAP_MESSAGES 1 /* proc.c - allow messages in the gap between
- 06566 * the end of bss and lowest stack address */
- 06567
- 06568 /* Enable or disable the second level file system cache on the RAM disk. */
- 06569 #define ENABLE_CACHE2 1
- 06570
- 06571 /* Include or exclude device drivers. Set to 1 to include, 0 to exclude. */
- 06572 #define ENABLE_NETWORKING 1 /* enable TCP/IP code */
- 06573 #define ENABLE_AT_WINI 1 /* enable AT winchester driver */
- 06574 #define ENABLE_BIOS_WINI 1 /* enable BIOS winchester driver */
- 06575 #define ENABLE_ESDI_WINI 1 /* enable ESDI winchester driver */
- 06576 #define ENABLE_XT_WINI 0 /* enable XT winchester driver */
- 06577 #define ENABLE_ADAPTEC_SCSI 1 /* enable ADAPTEC SCSI driver */
- 06578 #define ENABLE_MITSUMI_CDROM 0 /* enable Mitsumi CD-ROM driver */
- 06579 #define ENABLE_SB_AUDIO 0 /* enable Soundblaster audio driver */
- 06580
- 06581 /* DMA_SECTORS may be increased to speed up DMA based drivers. */
- 06582 #define DMA_SECTORS 1 /* DMA buffer size (must be >= 1) */
- 06583
- 06584 /* Include or exclude backwards compatibility code. */
- 06585 #define ENABLE_BINCOMPAT 0 /* for binaries using obsolete calls */
- 06586 #define ENABLE_SRCCOMPAT 0 /* for sources using obsolete calls */
- 06587
- 06588 /* Determine which device to use for pipes. */
- 06589 #define PIPE_DEV ROOT_DEV /* put pipes on root device */
- 06590
- 06591 /* NR_CONS, NR_RS_LINES, and NR_PTYS determine the number of terminals the
- 06592 * system can handle.
- 06593 */
- 06594 #define NR_CONS 2 /* # system consoles (1 to 8) */
- 06595 #define NR_RS_LINES 2 /* # rs232 terminals (0, 1, or 2) */
- 06596 #define NR_PTYS 4 /* # pseudo terminals (0 to 64) */
- 06597
- 06598 #if (MACHINE == ATARI)
- 06599 /* The next define says if you have an ATARI ST or TT */
- 06600 #define ATARI_TYPE TT
- 06601 #define ST 1 /* all ST's and Mega ST's */
- 06602 #define STE 2 /* all STe and Mega STe's */
- 06603 #define TT 3
- 06604
- 06605 /* if SCREEN is set to 1 graphical screen operations are possible */
- 06606 #define SCREEN 1
- 06607
- 06608 /* This define says whether the keyboard generates VT100 or IBM_PC escapes. */
- 06609 #define KEYBOARD VT100 /* either VT100 or IBM_PC */
- 06610 #define VT100 100
- 06611
- 06612 /* The next define determines the kind of partitioning. */
- 06613 #define PARTITIONING SUPRA /* one of the following or ATARI */
- 06614 #define SUPRA 1 /*ICD, SUPRA and BMS are all the same */
- .Op 71 include/minix/config.h
- 06615 #define BMS 1
- 06616 #define ICD 1
- 06617 #define CBHD 2
- 06618 #define EICKMANN 3
- 06619
- 06620 /* Define the number of hard disk drives on your system. */
- 06621 #define NR_ACSI_DRIVES 3 /* typically 0 or 1 */
- 06622 #define NR_SCSI_DRIVES 1 /* typically 0 (ST, STe) or 1 (TT) */
- 06623
- 06624 /* Some systems need to have a little delay after each winchester
- 06625 * commands. These systems need FAST_DISK set to 0. Other disks do not
- 06626 * need this delay, and thus can have FAST_DISK set to 1 to avoid this delay.
- 06627 */
- 06628 #define FAST_DISK 1 /* 0 or 1 */
- 06629
- 06630 /* Note: if you want to make your kernel smaller, you can set NR_FD_DRIVES
- 06631 * to 0. You will still be able to boot minix.img from floppy. However, you
- 06632 * MUST fetch both the root and usr filesystem from a hard disk
- 06633 */
- 06634
- 06635 /* Define the number of floppy disk drives on your system. */
- 06636 #define NR_FD_DRIVES 1 /* 0, 1, 2 */
- 06637
- 06638 /* This configuration define controls parallel printer code. */
- 06639 #define PAR_PRINTER 1 /* disable (0) / enable (1) parallel printer */
- 06640
- 06641 /* This configuration define controls disk controller clock code. */
- 06642 #define HD_CLOCK 1 /* disable (0) / enable (1) hard disk clock */
- 06643
- 06644 #endif
- 06645
- 06646
- 06647 /*===========================================================================*
- 06648 * There are no user-settable parameters after this line *
- 06649 *===========================================================================*/
- 06650 /* Set the CHIP type based on the machine selected. The symbol CHIP is actually
- 06651 * indicative of more than just the CPU. For example, machines for which
- 06652 * CHIP == INTEL are expected to have 8259A interrrupt controllers and the
- 06653 * other properties of IBM PC/XT/AT/386 types machines in general. */
- 06654 #define INTEL 1 /* CHIP type for PC, XT, AT, 386 and clones */
- 06655 #define M68000 2 /* CHIP type for Atari, Amiga, Macintosh */
- 06656 #define SPARC 3 /* CHIP type for SUN-4 (e.g. SPARCstation) */
- 06657
- 06658 /* Set the FP_FORMAT type based on the machine selected, either hw or sw */
- 06659 #define FP_NONE 0 /* no floating point support */
- 06660 #define FP_IEEE 1 /* conform IEEE floating point standard */
- 06661
- 06662 #if (MACHINE == IBM_PC)
- 06663 #define CHIP INTEL
- 06664 #define SHADOWING 0
- 06665 #define ENABLE_WINI (ENABLE_AT_WINI || ENABLE_BIOS_WINI ||
- 06666 ENABLE_ESDI_WINI || ENABLE_XT_WINI)
- 06667 #define ENABLE_SCSI (ENABLE_ADAPTEC_SCSI)
- 06668 #define ENABLE_CDROM (ENABLE_MITSUMI_CDROM)
- 06669 #define ENABLE_AUDIO (ENABLE_SB_AUDIO)
- 06670 #endif
- 06671
- 06672 #if (MACHINE == ATARI) || (MACHINE == AMIGA) || (MACHINE == MACINTOSH)
- 06673 #define CHIP M68000
- 06674 #define SHADOWING 1
- .Ep 72 include/minix/config.h
- 06675 #endif
- 06676
- 06677 #if (MACHINE == SUN_4) || (MACHINE == SUN_4_60)
- 06678 #define CHIP SPARC
- 06679 #define FP_FORMAT FP_IEEE
- 06680 #define SHADOWING 0
- 06681 #endif
- 06682
- 06683 #if (MACHINE == ATARI) || (MACHINE == SUN_4)
- 06684 #define ASKDEV 1 /* ask for boot device */
- 06685 #define FASTLOAD 1 /* use multiple block transfers to init ram */
- 06686 #endif
- 06687
- 06688 #if (ATARI_TYPE == TT) /* and all other 68030's */
- 06689 #define FPP
- 06690 #undef SHADOWING
- 06691 #define SHADOWING 0
- 06692 #endif
- 06693
- 06694 #ifndef FP_FORMAT
- 06695 #define FP_FORMAT FP_NONE
- 06696 #endif
- 06697
- 06698 /* The file buf.h uses MAYBE_WRITE_IMMED. */
- 06699 #if ROBUST
- 06700 #define MAYBE_WRITE_IMMED WRITE_IMMED /* slower but perhaps safer */
- 06701 #else
- 06702 #define MAYBE_WRITE_IMMED 0 /* faster */
- 06703 #endif
- 06704
- 06705 #ifndef MACHINE
- 06706 error "In <minix/config.h> please define MACHINE"
- 06707 #endif
- 06708
- 06709 #ifndef CHIP
- 06710 error "In <minix/config.h> please define MACHINE to have a legal value"
- 06711 #endif
- 06712
- 06713 #if (MACHINE == 0)
- 06714 error "MACHINE has incorrect value (0)"
- 06715 #endif
- 06716
- 06717 #endif /* _CONFIG_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/const.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 06800 /* Copyright (C) 1997 by Prentice-Hall, Inc. Permission is hereby granted
- 06801 * to redistribute the binary and source programs of this system for
- 06802 * educational or research purposes. For other use, written permission from
- 06803 * Prentice-Hall is required.
- 06804 */
- 06805
- 06806 #define EXTERN extern /* used in *.h files */
- 06807 #define PRIVATE static /* PRIVATE x limits the scope of x */
- 06808 #define PUBLIC /* PUBLIC is the opposite of PRIVATE */
- 06809 #define FORWARD static /* some compilers require this to be 'static'*/
- .Op 73 include/minix/const.h
- 06810
- 06811 #define TRUE 1 /* used for turning integers into Booleans */
- 06812 #define FALSE 0 /* used for turning integers into Booleans */
- 06813
- 06814 #define HZ 60 /* clock freq (software settable on IBM-PC) */
- 06815 #define BLOCK_SIZE 1024 /* # bytes in a disk block */
- 06816 #define SUPER_USER (uid_t) 0 /* uid_t of superuser */
- 06817
- 06818 #define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */
- 06819 #define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */
- 06820
- 06821 #define NULL ((void *)0) /* null pointer */
- 06822 #define CPVEC_NR 16 /* max # of entries in a SYS_VCOPY request */
- 06823 #define NR_IOREQS MIN(NR_BUFS, 64)
- 06824 /* maximum number of entries in an iorequest */
- 06825
- 06826 #define NR_SEGS 3 /* # segments per process */
- 06827 #define T 0 /* proc[i].mem_map[T] is for text */
- 06828 #define D 1 /* proc[i].mem_map[D] is for data */
- 06829 #define S 2 /* proc[i].mem_map[S] is for stack */
- 06830
- 06831 /* Process numbers of some important processes. */
- 06832 #define MM_PROC_NR 0 /* process number of memory manager */
- 06833 #define FS_PROC_NR 1 /* process number of file system */
- 06834 #define INET_PROC_NR 2 /* process number of the TCP/IP server */
- 06835 #define INIT_PROC_NR (INET_PROC_NR + ENABLE_NETWORKING)
- 06836 /* init -- the process that goes multiuser */
- 06837 #define LOW_USER (INET_PROC_NR + ENABLE_NETWORKING)
- 06838 /* first user not part of operating system */
- 06839
- 06840 /* Miscellaneous */
- 06841 #define BYTE 0377 /* mask for 8 bits */
- 06842 #define READING 0 /* copy data to user */
- 06843 #define WRITING 1 /* copy data from user */
- 06844 #define NO_NUM 0x8000 /* used as numerical argument to panic() */
- 06845 #define NIL_PTR (char *) 0 /* generally useful expression */
- 06846 #define HAVE_SCATTERED_IO 1 /* scattered I/O is now standard */
- 06847
- 06848 /* Macros. */
- 06849 #define MAX(a, b) ((a) > (b) ? (a) : (b))
- 06850 #define MIN(a, b) ((a) < (b) ? (a) : (b))
- 06851
- 06852 /* Number of tasks. */
- 06853 #define NR_TASKS (9 + ENABLE_WINI + ENABLE_SCSI + ENABLE_CDROM
- 06854 + ENABLE_NETWORKING + 2 * ENABLE_AUDIO)
- 06855
- 06856 /* Memory is allocated in clicks. */
- 06857 #if (CHIP == INTEL)
- 06858 #define CLICK_SIZE 256 /* unit in which memory is allocated */
- 06859 #define CLICK_SHIFT 8 /* log2 of CLICK_SIZE */
- 06860 #endif
- 06861
- 06862 #if (CHIP == SPARC) || (CHIP == M68000)
- 06863 #define CLICK_SIZE 4096 /* unit in which memory is alocated */
- 06864 #define CLICK_SHIFT 12 /* 2log of CLICK_SIZE */
- 06865 #endif
- 06866
- 06867 #define click_to_round_k(n)
- 06868 ((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
- 06869 #if CLICK_SIZE < 1024
- .Ep 74 include/minix/const.h
- 06870 #define k_to_click(n) ((n) * (1024 / CLICK_SIZE))
- 06871 #else
- 06872 #define k_to_click(n) ((n) / (CLICK_SIZE / 1024))
- 06873 #endif
- 06874
- 06875 #define ABS -999 /* this process means absolute memory */
- 06876
- 06877 /* Flag bits for i_mode in the inode. */
- 06878 #define I_TYPE 0170000 /* this field gives inode type */
- 06879 #define I_REGULAR 0100000 /* regular file, not dir or special */
- 06880 #define I_BLOCK_SPECIAL 0060000 /* block special file */
- 06881 #define I_DIRECTORY 0040000 /* file is a directory */
- 06882 #define I_CHAR_SPECIAL 0020000 /* character special file */
- 06883 #define I_NAMED_PIPE 0010000 /* named pipe (FIFO) */
- 06884 #define I_SET_UID_BIT 0004000 /* set effective uid_t on exec */
- 06885 #define I_SET_GID_BIT 0002000 /* set effective gid_t on exec */
- 06886 #define ALL_MODES 0006777 /* all bits for user, group and others */
- 06887 #define RWX_MODES 0000777 /* mode bits for RWX only */
- 06888 #define R_BIT 0000004 /* Rwx protection bit */
- 06889 #define W_BIT 0000002 /* rWx protection bit */
- 06890 #define X_BIT 0000001 /* rwX protection bit */
- 06891 #define I_NOT_ALLOC 0000000 /* this inode is free */
- 06892
- 06893 /* Some limits. */
- 06894 #define MAX_BLOCK_NR ((block_t) 077777777) /* largest block number */
- 06895 #define HIGHEST_ZONE ((zone_t) 077777777) /* largest zone number */
- 06896 #define MAX_INODE_NR ((ino_t) 0177777) /* largest inode number */
- 06897 #define MAX_FILE_POS ((off_t) 037777777777) /* largest legal file offset */
- 06898
- 06899 #define NO_BLOCK ((block_t) 0) /* absence of a block number */
- 06900 #define NO_ENTRY ((ino_t) 0) /* absence of a dir entry */
- 06901 #define NO_ZONE ((zone_t) 0) /* absence of a zone number */
- 06902 #define NO_DEV ((dev_t) 0) /* absence of a device numb */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/dl_eth.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 07000 /* The eth_stat struct is used in a DL_GETSTAT request the the ehw_task. */
- 07001
- 07002 #ifndef _ETH_HW_H
- 07003 #define _ETH_HW_H
- 07004
- 07005 typedef struct eth_stat
- 07006 {
- 07007 unsigned long ets_recvErr, /* # receive errors */
- 07008 ets_sendErr, /* # send error */
- 07009 ets_OVW, /* # buffer overwrite warnings */
- 07010 ets_CRCerr, /* # crc errors of read */
- 07011 ets_frameAll, /* # frames not alligned (# bits % 8 != 0) */
- 07012 ets_missedP, /* # packets missed due to slow processing */
- 07013 ets_packetR, /* # packets received */
- 07014 ets_packetT, /* # packets transmitted */
- 07015 ets_transDef, /* # transmission defered (Tx was busy) */
- 07016 ets_collision, /* # collissions */
- 07017 ets_transAb, /* # Tx aborted due to excess collisions */
- 07018 ets_carrSense, /* # carrier sense lost */
- 07019 ets_fifoUnder, /* # FIFO underruns (processor too busy) */
- .Op 75 include/minix/dl_eth.h
- 07020 ets_fifoOver, /* # FIFO overruns (processor too busy) */
- 07021 ets_CDheartbeat, /* # times unable to transmit collision sig*/
- 07022 ets_OWC; /* # times out of window collision */
- 07023 } eth_stat_t;
- 07024
- 07025 #endif /* _ETH_HW_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/fslib.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 07100 _PROTOTYPE( int bitmapsize, (bit_t _nr_bits) );
- 07101 _PROTOTYPE( unsigned conv2, (int _norm, int _w) );
- 07102 _PROTOTYPE( long conv4, (int _norm, long _x) );
- 07103 _PROTOTYPE( void conv_inode, (struct inode *_rip, d1_inode *_dip,
- 07104 d2_inode *_dip2, int _rw_flag, int _magic) );
- 07105 _PROTOTYPE( void old_icopy, (struct inode *_rip, d1_inode *_dip,
- 07106 int _direction, int _norm));
- 07107 _PROTOTYPE( void new_icopy, (struct inode *_rip, d2_inode *_dip,
- 07108 int _direction, int _norm));
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/jmp_buf.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 07200 /* This file is intended for use by assembly language programs that
- 07201 * need to manipulate a jmp_buf. It may only be used by those systems
- 07202 * for which a jmp_buf is identical to a struct sigcontext.
- 07203 */
- 07204
- 07205 #ifndef _JMP_BUF_H
- 07206 #define _JMP_BUF_H
- 07207
- 07208 #if !defined(CHIP)
- 07209 #include "error, configuration is not known"
- 07210 #endif
- 07211
- 07212 #if (CHIP == INTEL)
- 07213 #if _WORD_SIZE == 4
- 07214 #define JB_FLAGS 0
- 07215 #define JB_MASK 4
- 07216 #define JB_GS 8
- 07217 #define JB_FS 10
- 07218 #define JB_ES 12
- 07219 #define JB_DS 14
- 07220 #define JB_DI 16
- 07221 #define JB_SI 20
- 07222 #define JB_BP 24
- 07223 #define JB_ST 28
- 07224 #define JB_BX 32
- 07225 #define JB_DX 36
- 07226 #define JB_CX 40
- 07227 #define JB_AX 44
- 07228 #define JB_RETADR 48
- 07229 #define JB_IP 52
- .Ep 76 include/minix/jmp_buf.h
- 07230 #define JB_CS 56
- 07231 #define JB_PSW 60
- 07232 #define JB_SP 64
- 07233 #define JB_SS 68
- 07234 #else /* _WORD_SIZE == 2 */
- 07235 #define JB_FLAGS 0
- 07236 #define JB_MASK 2
- 07237 #define JB_ES 6
- 07238 #define JB_DS 8
- 07239 #define JB_DI 10
- 07240 #define JB_SI 12
- 07241 #define JB_BP 14
- 07242 #define JB_ST 16
- 07243 #define JB_BX 18
- 07244 #define JB_DX 20
- 07245 #define JB_CX 22
- 07246 #define JB_AX 24
- 07247 #define JB_RETADR 26
- 07248 #define JB_IP 28
- 07249 #define JB_CS 30
- 07250 #define JB_PSW 32
- 07251 #define JB_SP 34
- 07252 #define JB_SS 36
- 07253 #endif /* _WORD_SIZE == 2 */
- 07254 #else /* !(CHIP == INTEL) */
- 07255 #if (CHIP == M68000)
- 07256 #define JB_FLAGS 0
- 07257 #define JB_MASK 2
- 07258 #define JB_RETREG 6
- 07259 #define JB_D1 10
- 07260 #define JB_D2 14
- 07261 #define JB_D3 18
- 07262 #define JB_D4 22
- 07263 #define JB_D5 26
- 07264 #define JB_D6 20
- 07265 #define JB_D7 34
- 07266 #define JB_A0 38
- 07267 #define JB_A1 42
- 07268 #define JB_A2 46
- 07269 #define JB_A3 50
- 07270 #define JB_A4 54
- 07271 #define JB_A5 58
- 07272 #define JB_A6 62
- 07273 #define JB_SP 66
- 07274 #define JB_PC 70
- 07275 #define JB_PSW 74
- 07276 #else /* !(CHIP == INTEL) && !(CHIP == M68000) */
- 07277 #include "error, CHIP is not supported"
- 07278 #endif /* (CHIP == INTEL) */
- 07279
- 07280 /* Defines from C headers needed in assembly code. The headers have too
- 07281 * much C stuff to used directly.
- 07282 */
- 07283 #define SIG_BLOCK 0 /* must agree with <signal.h> */
- 07284 #define SC_SIGCONTEXT 2 /* must agree with <sys/sigcontext.h> */
- 07285 #define SC_NOREGLOCALS 4 /* must agree with <sys/sigcontext.h> */
- 07286 #endif /* _JMP_BUF_H */
- .Op 77 include/minix/keymap.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/keymap.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 07300 /* keymap.h - defines for keymapping Author: Marcus Hampel
- 07301 */
- 07302 #ifndef _SYS__KEYMAP_H
- 07303 #define _SYS__KEYMAP_H
- 07304
- 07305 #define C(c) ((c) & 0x1F) /* Map to control code */
- 07306 #define A(c) ((c) | 0x80) /* Set eight bit (ALT) */
- 07307 #define CA(c) A(C(c)) /* Control-Alt */
- 07308 #define L(c) ((c) | HASCAPS) /* Add "Caps Lock has effect" attribute */
- 07309
- 07310 #define EXT 0x0100 /* Normal function keys */
- 07311 #define CTRL 0x0200 /* Control key */
- 07312 #define SHIFT 0x0400 /* Shift key */
- 07313 #define ALT 0x0800 /* Alternate key */
- 07314 #define EXTKEY 0x1000 /* extended keycode */
- 07315 #define HASCAPS 0x8000 /* Caps Lock has effect */
- 07316
- 07317 /* Numeric keypad */
- 07318 #define HOME (0x01 + EXT)
- 07319 #define END (0x02 + EXT)
- 07320 #define UP (0x03 + EXT)
- 07321 #define DOWN (0x04 + EXT)
- 07322 #define LEFT (0x05 + EXT)
- 07323 #define RIGHT (0x06 + EXT)
- 07324 #define PGUP (0x07 + EXT)
- 07325 #define PGDN (0x08 + EXT)
- 07326 #define MID (0x09 + EXT)
- 07327 #define NMIN (0x0A + EXT)
- 07328 #define PLUS (0x0B + EXT)
- 07329 #define INSRT (0x0C + EXT)
- 07330
- 07331 /* Alt + Numeric keypad */
- 07332 #define AHOME (0x01 + ALT)
- 07333 #define AEND (0x02 + ALT)
- 07334 #define AUP (0x03 + ALT)
- 07335 #define ADOWN (0x04 + ALT)
- 07336 #define ALEFT (0x05 + ALT)
- 07337 #define ARIGHT (0x06 + ALT)
- 07338 #define APGUP (0x07 + ALT)
- 07339 #define APGDN (0x08 + ALT)
- 07340 #define AMID (0x09 + ALT)
- 07341 #define ANMIN (0x0A + ALT)
- 07342 #define APLUS (0x0B + ALT)
- 07343 #define AINSRT (0x0C + ALT)
- 07344
- 07345 /* Ctrl + Numeric keypad */
- 07346 #define CHOME (0x01 + CTRL)
- 07347 #define CEND (0x02 + CTRL)
- 07348 #define CUP (0x03 + CTRL)
- 07349 #define CDOWN (0x04 + CTRL)
- 07350 #define CLEFT (0x05 + CTRL)
- 07351 #define CRIGHT (0x06 + CTRL)
- 07352 #define CPGUP (0x07 + CTRL)
- 07353 #define CPGDN (0x08 + CTRL)
- 07354 #define CMID (0x09 + CTRL)
- .Ep 78 include/minix/keymap.h
- 07355 #define CNMIN (0x0A + CTRL)
- 07356 #define CPLUS (0x0B + CTRL)
- 07357 #define CINSRT (0x0C + CTRL)
- 07358
- 07359 /* Lock keys */
- 07360 #define CALOCK (0x0D + EXT) /* caps lock */
- 07361 #define NLOCK (0x0E + EXT) /* number lock */
- 07362 #define SLOCK (0x0F + EXT) /* scroll lock */
- 07363
- 07364 /* Function keys */
- 07365 #define F1 (0x10 + EXT)
- 07366 #define F2 (0x11 + EXT)
- 07367 #define F3 (0x12 + EXT)
- 07368 #define F4 (0x13 + EXT)
- 07369 #define F5 (0x14 + EXT)
- 07370 #define F6 (0x15 + EXT)
- 07371 #define F7 (0x16 + EXT)
- 07372 #define F8 (0x17 + EXT)
- 07373 #define F9 (0x18 + EXT)
- 07374 #define F10 (0x19 + EXT)
- 07375 #define F11 (0x1A + EXT)
- 07376 #define F12 (0x1B + EXT)
- 07377
- 07378 /* Alt+Fn */
- 07379 #define AF1 (0x10 + ALT)
- 07380 #define AF2 (0x11 + ALT)
- 07381 #define AF3 (0x12 + ALT)
- 07382 #define AF4 (0x13 + ALT)
- 07383 #define AF5 (0x14 + ALT)
- 07384 #define AF6 (0x15 + ALT)
- 07385 #define AF7 (0x16 + ALT)
- 07386 #define AF8 (0x17 + ALT)
- 07387 #define AF9 (0x18 + ALT)
- 07388 #define AF10 (0x19 + ALT)
- 07389 #define AF11 (0x1A + ALT)
- 07390 #define AF12 (0x1B + ALT)
- 07391
- 07392 /* Ctrl+Fn */
- 07393 #define CF1 (0x10 + CTRL)
- 07394 #define CF2 (0x11 + CTRL)
- 07395 #define CF3 (0x12 + CTRL)
- 07396 #define CF4 (0x13 + CTRL)
- 07397 #define CF5 (0x14 + CTRL)
- 07398 #define CF6 (0x15 + CTRL)
- 07399 #define CF7 (0x16 + CTRL)
- 07400 #define CF8 (0x17 + CTRL)
- 07401 #define CF9 (0x18 + CTRL)
- 07402 #define CF10 (0x19 + CTRL)
- 07403 #define CF11 (0x1A + CTRL)
- 07404 #define CF12 (0x1B + CTRL)
- 07405
- 07406 /* Shift+Fn */
- 07407 #define SF1 (0x10 + SHIFT)
- 07408 #define SF2 (0x11 + SHIFT)
- 07409 #define SF3 (0x12 + SHIFT)
- 07410 #define SF4 (0x13 + SHIFT)
- 07411 #define SF5 (0x14 + SHIFT)
- 07412 #define SF6 (0x15 + SHIFT)
- 07413 #define SF7 (0x16 + SHIFT)
- 07414 #define SF8 (0x17 + SHIFT)
- .Op 79 include/minix/keymap.h
- 07415 #define SF9 (0x18 + SHIFT)
- 07416 #define SF10 (0x19 + SHIFT)
- 07417 #define SF11 (0x1A + SHIFT)
- 07418 #define SF12 (0x1B + SHIFT)
- 07419
- 07420 /* Alt+Shift+Fn */
- 07421 #define ASF1 (0x10 + ALT + SHIFT)
- 07422 #define ASF2 (0x11 + ALT + SHIFT)
- 07423 #define ASF3 (0x12 + ALT + SHIFT)
- 07424 #define ASF4 (0x13 + ALT + SHIFT)
- 07425 #define ASF5 (0x14 + ALT + SHIFT)
- 07426 #define ASF6 (0x15 + ALT + SHIFT)
- 07427 #define ASF7 (0x16 + ALT + SHIFT)
- 07428 #define ASF8 (0x17 + ALT + SHIFT)
- 07429 #define ASF9 (0x18 + ALT + SHIFT)
- 07430 #define ASF10 (0x19 + ALT + SHIFT)
- 07431 #define ASF11 (0x1A + ALT + SHIFT)
- 07432 #define ASF12 (0x1B + ALT + SHIFT)
- 07433
- 07434 #define MAP_COLS 6 /* Number of columns in keymap */
- 07435 #define NR_SCAN_CODES 0x80 /* Number of scan codes (rows in keymap) */
- 07436
- 07437 typedef unsigned short keymap_t[NR_SCAN_CODES * MAP_COLS];
- 07438
- 07439 #define KEY_MAGIC "KMAZ" /* Magic number of keymap file */
- 07440
- 07441 #endif /* _SYS__KEYMAP_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/minlib.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 07500 #ifndef _MINLIB
- 07501 #define _MINLIB
- 07502
- 07503 #ifndef _ANSI_H
- 07504 #include <ansi.h>
- 07505 #endif
- 07506
- 07507 /* Miscellaneous BSD. */
- 07508 _PROTOTYPE(void swab, (char *_from, char *_to, int _count));
- 07509 _PROTOTYPE(char *itoa, (int _n));
- 07510 _PROTOTYPE(char *getpass, (const char *_prompt));
- 07511
- 07512 /* Miscellaneous MINIX. */
- 07513 _PROTOTYPE(void std_err, (char *_s));
- 07514 _PROTOTYPE(void prints, (const char *_s, ...));
- 07515 _PROTOTYPE(int fsversion, (char *_dev, char *_prog));
- 07516 _PROTOTYPE(int getprocessor, (void));
- 07517 _PROTOTYPE(int load_mtab, (char *_prog_name));
- 07518 _PROTOTYPE(int rewrite_mtab, (char *_prog_name));
- 07519 _PROTOTYPE(int get_mtab_entry, (char *_s1, char *_s2, char *_s3, char *_s4));
- 07520 _PROTOTYPE(int put_mtab_entry, (char *_s1, char *_s2, char *_s3, char *_s4));
- 07521
- 07522 #endif
- .Ep 80 include/minix/partition.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/partition.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 07600 /* minix/partition.h Author: Kees J. Bot
- 07601 * 7 Dec 1995
- 07602 * Place of a partition on disk and the disk geometry,
- 07603 * for use with the DIOCGETP and DIOCSETP ioctl's.
- 07604 */
- 07605 #ifndef _MINIX__PARTITION_H
- 07606 #define _MINIX__PARTITION_H
- 07607
- 07608 struct partition {
- 07609 u32_t base; /* byte offset to the partition start */
- 07610 u32_t size; /* number of bytes in the partition */
- 07611 unsigned cylinders; /* disk geometry */
- 07612 unsigned heads;
- 07613 unsigned sectors;
- 07614 };
- 07615 #endif /* _MINIX__PARTITION_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/sound.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 07700 /* Definitions used by /dev/audio and /dev/mixer.
- 07701 *
- 07702 * Feb 13 1995 Author: Michel R. Prevenier
- 07703 */
- 07704
- 07705 #ifndef SOUND_H
- 07706 #define SOUND_H
- 07707
- 07708
- 07709 /* ------- Mixer stuff ------- */
- 07710
- 07711 /* Available devices */
- 07712 enum Device
- 07713 {
- 07714 Master, /* Master volume */
- 07715 Dac, /* DSP, digitized sound */
- 07716 Fm, /* Fm synthesized sound */
- 07717 Cd, /* Compact */
- 07718 Line, /* Line in */
- 07719 Mic, /* Microphone */
- 07720 Speaker, /* Pc speaker */
- 07721 Treble, /* Treble */
- 07722 Bass /* Bass */
- 07723 };
- 07724
- 07725 enum InputState
- 07726 {
- 07727 ON, OFF
- 07728 };
- 07729
- .Op 81 include/minix/sound.h
- 07730 /* Volume levels range from 0 to 31, bass & treble range from 0 to 15 */
- 07731 struct volume_level
- 07732 {
- 07733 enum Device device;
- 07734 int left;
- 07735 int right;
- 07736 };
- 07737
- 07738 struct inout_ctrl
- 07739 {
- 07740 enum Device device;
- 07741 enum InputState left;
- 07742 enum InputState right;
- 07743 };
- 07744
- 07745 #endif /* SOUND_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/syslib.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 07800 /* Prototypes for system library functions. */
- 07801
- 07802 #ifndef _SYSLIB_H
- 07803 #define _SYSLIB_H
- 07804
- 07805 /* Hide names to avoid name space pollution. */
- 07806 #define sendrec _sendrec
- 07807 #define receive _receive
- 07808 #define send _send
- 07809
- 07810 /* Minix user+system library. */
- 07811 _PROTOTYPE( void printk, (char *_fmt, ...) );
- 07812 _PROTOTYPE( int sendrec, (int _src_dest, message *_m_ptr) );
- 07813 _PROTOTYPE( int _taskcall, (int _who, int _syscallnr, message *_msgptr) );
- 07814
- 07815 /* Minix system library. */
- 07816 _PROTOTYPE( int receive, (int _src, message *_m_ptr) );
- 07817 _PROTOTYPE( int send, (int _dest, message *_m_ptr) );
- 07818
- 07819 _PROTOTYPE( int sys_abort, (int _how, ...) );
- 07820 _PROTOTYPE( int sys_adjmap, (int _proc, struct mem_map *_ptr,
- 07821 vir_clicks _data_clicks, vir_clicks _sp) );
- 07822 _PROTOTYPE( int sys_copy, (int _src_proc, int _src_seg, phys_bytes _src_vir,
- 07823 int _dst_proc, int _dst_seg, phys_bytes _dst_vir, phys_bytes _bytes));
- 07824 _PROTOTYPE( int sys_exec, (int _proc, char *_ptr, int _traced,
- 07825 char *_aout, vir_bytes _initpc) );
- 07826 _PROTOTYPE( int sys_execmap, (int _proc, struct mem_map *_ptr) );
- 07827 _PROTOTYPE( int sys_fork, (int _parent, int _child, int _pid,
- 07828 phys_clicks _shadow) );
- 07829 _PROTOTYPE( int sys_fresh, (int _proc, struct mem_map *_ptr,
- 07830 phys_clicks _dc, phys_clicks *_basep, phys_clicks *_sizep) );
- 07831 _PROTOTYPE( int sys_getsp, (int _proc, vir_bytes *_newsp) );
- 07832 _PROTOTYPE( int sys_newmap, (int _proc, struct mem_map *_ptr) );
- 07833 _PROTOTYPE( int sys_getmap, (int _proc, struct mem_map *_ptr) );
- 07834 _PROTOTYPE( int sys_sendsig, (int _proc, struct sigmsg *_ptr) );
- .Ep 82 include/minix/syslib.h
- 07835 _PROTOTYPE( int sys_oldsig, (int _proc, int _sig, sighandler_t _sighandler));
- 07836 _PROTOTYPE( int sys_endsig, (int _proc) );
- 07837 _PROTOTYPE( int sys_sigreturn, (int _proc, vir_bytes _scp, int _flags) );
- 07838 _PROTOTYPE( int sys_trace, (int _req, int _procnr, long _addr, long *_data_p));
- 07839 _PROTOTYPE( int sys_xit, (int _parent, int _proc, phys_clicks *_basep,
- 07840 phys_clicks *_sizep));
- 07841 _PROTOTYPE( int sys_kill, (int _proc, int _sig) );
- 07842 _PROTOTYPE( int sys_times, (int _proc, clock_t _ptr[5]) );
- 07843
- 07844 #endif /* _SYSLIB_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/type.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 07900 #ifndef _TYPE_H
- 07901 #define _TYPE_H
- 07902 #ifndef _MINIX_TYPE_H
- 07903 #define _MINIX_TYPE_H
- 07904
- 07905 /* Type definitions. */
- 07906 typedef unsigned int vir_clicks; /* virtual addresses and lengths in clicks */
- 07907 typedef unsigned long phys_bytes;/* physical addresses and lengths in bytes */
- 07908 typedef unsigned int phys_clicks;/* physical addresses and lengths in clicks */
- 07909
- 07910 #if (CHIP == INTEL)
- 07911 typedef unsigned int vir_bytes; /* virtual addresses and lengths in bytes */
- 07912 #endif
- 07913
- 07914 #if (CHIP == M68000)
- 07915 typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
- 07916 #endif
- 07917
- 07918 #if (CHIP == SPARC)
- 07919 typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
- 07920 #endif
- 07921
- 07922 /* Types relating to messages. */
- 07923 #define M1 1
- 07924 #define M3 3
- 07925 #define M4 4
- 07926 #define M3_STRING 14
- 07927
- 07928 typedef struct {int m1i1, m1i2, m1i3; char *m1p1, *m1p2, *m1p3;} mess_1;
- 07929 typedef struct {int m2i1, m2i2, m2i3; long m2l1, m2l2; char *m2p1;} mess_2;
- 07930 typedef struct {int m3i1, m3i2; char *m3p1; char m3ca1[M3_STRING];} mess_3;
- 07931 typedef struct {long m4l1, m4l2, m4l3, m4l4, m4l5;} mess_4;
- 07932 typedef struct {char m5c1, m5c2; int m5i1, m5i2; long m5l1, m5l2, m5l3;}mess_5;
- 07933 typedef struct {int m6i1, m6i2, m6i3; long m6l1; sighandler_t m6f1;} mess_6;
- 07934
- 07935 typedef struct {
- 07936 int m_source; /* who sent the message */
- 07937 int m_type; /* what kind of message is it */
- 07938 union {
- 07939 mess_1 m_m1;
- .Op 83 include/minix/type.h
- 07940 mess_2 m_m2;
- 07941 mess_3 m_m3;
- 07942 mess_4 m_m4;
- 07943 mess_5 m_m5;
- 07944 mess_6 m_m6;
- 07945 } m_u;
- 07946 } message;
- 07947
- 07948 /* The following defines provide names for useful members. */
- 07949 #define m1_i1 m_u.m_m1.m1i1
- 07950 #define m1_i2 m_u.m_m1.m1i2
- 07951 #define m1_i3 m_u.m_m1.m1i3
- 07952 #define m1_p1 m_u.m_m1.m1p1
- 07953 #define m1_p2 m_u.m_m1.m1p2
- 07954 #define m1_p3 m_u.m_m1.m1p3
- 07955
- 07956 #define m2_i1 m_u.m_m2.m2i1
- 07957 #define m2_i2 m_u.m_m2.m2i2
- 07958 #define m2_i3 m_u.m_m2.m2i3
- 07959 #define m2_l1 m_u.m_m2.m2l1
- 07960 #define m2_l2 m_u.m_m2.m2l2
- 07961 #define m2_p1 m_u.m_m2.m2p1
- 07962
- 07963 #define m3_i1 m_u.m_m3.m3i1
- 07964 #define m3_i2 m_u.m_m3.m3i2
- 07965 #define m3_p1 m_u.m_m3.m3p1
- 07966 #define m3_ca1 m_u.m_m3.m3ca1
- 07967
- 07968 #define m4_l1 m_u.m_m4.m4l1
- 07969 #define m4_l2 m_u.m_m4.m4l2
- 07970 #define m4_l3 m_u.m_m4.m4l3
- 07971 #define m4_l4 m_u.m_m4.m4l4
- 07972 #define m4_l5 m_u.m_m4.m4l5
- 07973
- 07974 #define m5_c1 m_u.m_m5.m5c1
- 07975 #define m5_c2 m_u.m_m5.m5c2
- 07976 #define m5_i1 m_u.m_m5.m5i1
- 07977 #define m5_i2 m_u.m_m5.m5i2
- 07978 #define m5_l1 m_u.m_m5.m5l1
- 07979 #define m5_l2 m_u.m_m5.m5l2
- 07980 #define m5_l3 m_u.m_m5.m5l3
- 07981
- 07982 #define m6_i1 m_u.m_m6.m6i1
- 07983 #define m6_i2 m_u.m_m6.m6i2
- 07984 #define m6_i3 m_u.m_m6.m6i3
- 07985 #define m6_l1 m_u.m_m6.m6l1
- 07986 #define m6_f1 m_u.m_m6.m6f1
- 07987
- 07988 struct mem_map {
- 07989 vir_clicks mem_vir; /* virtual address */
- 07990 phys_clicks mem_phys; /* physical address */
- 07991 vir_clicks mem_len; /* length */
- 07992 };
- 07993
- 07994 struct iorequest_s {
- 07995 long io_position; /* position in device file (really off_t) */
- 07996 char *io_buf; /* buffer in user space */
- 07997 int io_nbytes; /* size of request */
- 07998 unsigned short io_request; /* read, write (optionally) */
- 07999 };
- .Ep 84 include/minix/type.h
- 08000 #endif /* _TYPE_H */
- 08001
- 08002 typedef struct {
- 08003 vir_bytes iov_addr; /* address of an I/O buffer */
- 08004 vir_bytes iov_size; /* sizeof an I/O buffer */
- 08005 } iovec_t;
- 08006
- 08007 typedef struct {
- 08008 vir_bytes cpv_src; /* src address of data */
- 08009 vir_bytes cpv_dst; /* dst address of data */
- 08010 vir_bytes cpv_size; /* size of data */
- 08011 } cpvec_t;
- 08012
- 08013 /* MM passes the address of a structure of this type to KERNEL when
- 08014 * do_sendsig() is invoked as part of the signal catching mechanism.
- 08015 * The structure contain all the information that KERNEL needs to build
- 08016 * the signal stack.
- 08017 */
- 08018 struct sigmsg {
- 08019 int sm_signo; /* signal number being caught */
- 08020 unsigned long sm_mask; /* mask to restore when handler returns */
- 08021 vir_bytes sm_sighandler; /* address of handler */
- 08022 vir_bytes sm_sigreturn; /* address of _sigreturn in C library */
- 08023 vir_bytes sm_stkptr; /* user stack pointer */
- 08024 };
- 08025
- 08026 #define MESS_SIZE (sizeof(message)) /* might need usizeof from fs here */
- 08027 #define NIL_MESS ((message *) 0)
- 08028
- 08029 struct psinfo { /* information for the ps(1) program */
- 08030 u16_t nr_tasks, nr_procs; /* NR_TASKS and NR_PROCS constants. */
- 08031 vir_bytes proc, mproc, fproc; /* addresses of the main process tables. */
- 08032 };
- 08033
- 08034 #endif /* _MINIX_TYPE_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/ibm/diskparm.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 08100 /* PC (and AT) BIOS structure to hold disk parameters. Under Minix, it is
- 08101 * used mainly for formatting.
- 08102 */
- 08103
- 08104 #ifndef _DISKPARM_H
- 08105 #define _DISKPARM_H
- 08106 struct disk_parameter_s {
- 08107 char spec1;
- 08108 char spec2;
- 08109 char motor_turnoff_sec;
- 08110 char sector_size_code;
- 08111 char sectors_per_cylinder;
- 08112 char gap_length;
- 08113 char dtl;
- 08114 char gap_length_for_format;
- .Op 85 include/ibm/diskparm.h
- 08115 char fill_byte_for_format;
- 08116 char head_settle_msec;
- 08117 char motor_start_eigth_sec;
- 08118 };
- 08119 #endif /* _DISKPARM_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/ibm/partition.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 08200 /* Description of entry in partition table. */
- 08201 #ifndef _PARTITION_H
- 08202 #define _PARTITION_H
- 08203
- 08204 struct part_entry {
- 08205 unsigned char bootind; /* boot indicator 0/ACTIVE_FLAG */
- 08206 unsigned char start_head; /* head value for first sector */
- 08207 unsigned char start_sec; /* sector value + cyl bits for first sector */
- 08208 unsigned char start_cyl; /* track value for first sector */
- 08209 unsigned char sysind; /* system indicator */
- 08210 unsigned char last_head; /* head value for last sector */
- 08211 unsigned char last_sec; /* sector value + cyl bits for last sector */
- 08212 unsigned char last_cyl; /* track value for last sector */
- 08213 unsigned long lowsec; /* logical first sector */
- 08214 unsigned long size; /* size of partition in sectors */
- 08215 };
- 08216
- 08217 #define ACTIVE_FLAG 0x80 /* value for active in bootind field (hd0) */
- 08218 #define NR_PARTITIONS 4 /* number of entries in partition table */
- 08219 #define PART_TABLE_OFF 0x1BE /* offset of partition table in boot sector */
- 08220
- 08221 /* Partition types. */
- 08222 #define MINIX_PART 0x81 /* Minix partition type */
- 08223 #define NO_PART 0x00 /* unused entry */
- 08224 #define OLD_MINIX_PART 0x80 /* created before 1.4b, obsolete */
- 08225 #define EXT_PART 0x05 /* extended partition */
- 08226
- 08227 #endif /* _PARTITION_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/assert.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 08300 /*
- 08301 assert.h
- 08302 */
- 08303 #ifndef ASSERT_H
- 08304 #define ASSERT_H
- 08305
- 08306 #if DEBUG
- 08307
- 08308 #define INIT_ASSERT static char *assert_file= __FILE__;
- 08309
- .Ep 86 src/kernel/assert.h
- 08310 void bad_assertion(char *file, int line, char *what);
- 08311 void bad_compare(char *file, int line, int lhs, char *what, int rhs);
- 08312
- 08313 #define assert(x) (!(x) ? bad_assertion(assert_file, __LINE__, #x)
- 08314 : (void) 0)
- 08315 #define compare(a,t,b) (!((a) t (b)) ? bad_compare(assert_file, __LINE__,
- 08316 (a), #a " " #t " " #b, (b)) : (void) 0)
- 08317 #else /* !DEBUG */
- 08318
- 08319 #define INIT_ASSERT /* nothing */
- 08320
- 08321 #define assert(x) (void)0
- 08322 #define compare(a,t,b) (void)0
- 08323
- 08324 #endif /* !DEBUG */
- 08325
- 08326 #endif /* ASSERT_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/const.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 08400 /* General constants used by the kernel. */
- 08401
- 08402 #if (CHIP == INTEL)
- 08403
- 08404 #define K_STACK_BYTES 1024 /* how many bytes for the kernel stack */
- 08405
- 08406 #define INIT_PSW 0x0200 /* initial psw */
- 08407 #define INIT_TASK_PSW 0x1200 /* initial psw for tasks (with IOPL 1) */
- 08408 #define TRACEBIT 0x100 /* OR this with psw in proc[] for tracing */
- 08409 #define SETPSW(rp, new) /* permits only certain bits to be set */
- 08410 ((rp)->p_reg.psw = (rp)->p_reg.psw & ~0xCD5 | (new) & 0xCD5)
- 08411
- 08412 /* Initial sp for mm, fs and init.
- 08413 * 2 bytes for short jump
- 08414 * 2 bytes unused
- 08415 * 3 words for init_org[] used by fs only
- 08416 * 3 words for real mode debugger trap (actually needs 1 more)
- 08417 * 3 words for save and restart temporaries
- 08418 * 3 words for interrupt
- 08419 * Leave no margin, to flush bugs early.
- 08420 */
- 08421 #define INIT_SP (2 + 2 + 3 * 2 + 3 * 2 + 3 * 2 + 3 * 2)
- 08422
- 08423 #define HCLICK_SHIFT 4 /* log2 of HCLICK_SIZE */
- 08424 #define HCLICK_SIZE 16 /* hardware segment conversion magic */
- 08425 #if CLICK_SIZE >= HCLICK_SIZE
- 08426 #define click_to_hclick(n) ((n) << (CLICK_SHIFT - HCLICK_SHIFT))
- 08427 #else
- 08428 #define click_to_hclick(n) ((n) >> (HCLICK_SHIFT - CLICK_SHIFT))
- 08429 #endif
- 08430 #define hclick_to_physb(n) ((phys_bytes) (n) << HCLICK_SHIFT)
- 08431 #define physb_to_hclick(n) ((n) >> HCLICK_SHIFT)
- 08432
- 08433 /* Interrupt vectors defined/reserved by processor. */
- 08434 #define DIVIDE_VECTOR 0 /* divide error */
- .Op 87 src/kernel/const.h
- 08435 #define DEBUG_VECTOR 1 /* single step (trace) */
- 08436 #define NMI_VECTOR 2 /* non-maskable interrupt */
- 08437 #define BREAKPOINT_VECTOR 3 /* software breakpoint */
- 08438 #define OVERFLOW_VECTOR 4 /* from INTO */
- 08439
- 08440 /* Fixed system call vector. */
- 08441 #define SYS_VECTOR 32 /* system calls are made with int SYSVEC */
- 08442 #define SYS386_VECTOR 33 /* except 386 system calls use this */
- 08443 #define LEVEL0_VECTOR 34 /* for execution of a function at level 0 */
- 08444
- 08445 /* Suitable irq bases for hardware interrupts. Reprogram the 8259(s) from
- 08446 * the PC BIOS defaults since the BIOS doesn't respect all the processor's
- 08447 * reserved vectors (0 to 31).
- 08448 */
- 08449 #define BIOS_IRQ0_VEC 0x08 /* base of IRQ0-7 vectors used by BIOS */
- 08450 #define BIOS_IRQ8_VEC 0x70 /* base of IRQ8-15 vectors used by BIOS */
- 08451 #define IRQ0_VECTOR 0x28 /* more or less arbitrary, but > SYS_VECTOR */
- 08452 #define IRQ8_VECTOR 0x30 /* together for simplicity */
- 08453
- 08454 /* Hardware interrupt numbers. */
- 08455 #define NR_IRQ_VECTORS 16
- 08456 #define CLOCK_IRQ 0
- 08457 #define KEYBOARD_IRQ 1
- 08458 #define CASCADE_IRQ 2 /* cascade enable for 2nd AT controller */
- 08459 #define ETHER_IRQ 3 /* default ethernet interrupt vector */
- 08460 #define SECONDARY_IRQ 3 /* RS232 interrupt vector for port 2 */
- 08461 #define RS232_IRQ 4 /* RS232 interrupt vector for port 1 */
- 08462 #define XT_WINI_IRQ 5 /* xt winchester */
- 08463 #define FLOPPY_IRQ 6 /* floppy disk */
- 08464 #define PRINTER_IRQ 7
- 08465 #define AT_WINI_IRQ 14 /* at winchester */
- 08466
- 08467 /* Interrupt number to hardware vector. */
- 08468 #define BIOS_VECTOR(irq)
- 08469 (((irq) < 8 ? BIOS_IRQ0_VEC : BIOS_IRQ8_VEC) + ((irq) & 0x07))
- 08470 #define VECTOR(irq)
- 08471 (((irq) < 8 ? IRQ0_VECTOR : IRQ8_VECTOR) + ((irq) & 0x07))
- 08472
- 08473 /* BIOS hard disk parameter vectors. */
- 08474 #define WINI_0_PARM_VEC 0x41
- 08475 #define WINI_1_PARM_VEC 0x46
- 08476
- 08477 /* 8259A interrupt controller ports. */
- 08478 #define INT_CTL 0x20 /* I/O port for interrupt controller */
- 08479 #define INT_CTLMASK 0x21 /* setting bits in this port disables ints */
- 08480 #define INT2_CTL 0xA0 /* I/O port for second interrupt controller */
- 08481 #define INT2_CTLMASK 0xA1 /* setting bits in this port disables ints */
- 08482
- 08483 /* Magic numbers for interrupt controller. */
- 08484 #define ENABLE 0x20 /* code used to re-enable after an interrupt */
- 08485
- 08486 /* Sizes of memory tables. */
- 08487 #define NR_MEMS 3 /* number of chunks of memory */
- 08488
- 08489 /* Miscellaneous ports. */
- 08490 #define PCR 0x65 /* Planar Control Register */
- 08491 #define PORT_B 0x61 /* I/O port for 8255 port B (kbd, beeper...) */
- 08492 #define TIMER0 0x40 /* I/O port for timer channel 0 */
- 08493 #define TIMER2 0x42 /* I/O port for timer channel 2 */
- 08494 #define TIMER_MODE 0x43 /* I/O port for timer mode control */
- .Ep 88 src/kernel/const.h
- 08495
- 08496 #endif /* (CHIP == INTEL) */
- 08497
- 08498 #if (CHIP == M68000)
- 08499
- 08500 #define K_STACK_BYTES 1024 /* how many bytes for the kernel stack */
- 08501
- 08502 /* Sizes of memory tables. */
- 08503 #define NR_MEMS 2 /* number of chunks of memory */
- 08504
- 08505 /* p_reg contains: d0-d7, a0-a6, in that order. */
- 08506 #define NR_REGS 15 /* number of general regs in each proc slot */
- 08507
- 08508 #define TRACEBIT 0x8000 /* or this with psw in proc[] for tracing */
- 08509 #define SETPSW(rp, new) /* permits only certain bits to be set */
- 08510 ((rp)->p_reg.psw = (rp)->p_reg.psw & ~0xFF | (new) & 0xFF)
- 08511
- 08512 #define MEM_BYTES 0xffffffff /* memory size for /dev/mem */
- 08513
- 08514 #ifdef __ACK__
- 08515 #define FSTRUCOPY
- 08516 #endif
- 08517
- 08518 #endif /* (CHIP == M68000) */
- 08519
- 08520 /* The following items pertain to the scheduling queues. */
- 08521 #define TASK_Q 0 /* ready tasks are scheduled via queue 0 */
- 08522 #define SERVER_Q 1 /* ready servers are scheduled via queue 1 */
- 08523 #define USER_Q 2 /* ready users are scheduled via queue 2 */
- 08524
- 08525 #if (MACHINE == ATARI)
- 08526 #define SHADOW_Q 3 /* runnable, but shadowed processes */
- 08527 #define NQ 4 /* # of scheduling queues */
- 08528 #else
- 08529 #define NQ 3 /* # of scheduling queues */
- 08530 #endif
- 08531
- 08532 /* Env_parse() return values. */
- 08533 #define EP_UNSET 0 /* variable not set */
- 08534 #define EP_OFF 1 /* var = off */
- 08535 #define EP_ON 2 /* var = on (or field left blank) */
- 08536 #define EP_SET 3 /* var = 1:2:3 (nonblank field) */
- 08537
- 08538 /* To translate an address in kernel space to a physical address. This is
- 08539 * the same as umap(proc_ptr, D, vir, sizeof(*vir)), but a lot less costly.
- 08540 */
- 08541 #define vir2phys(vir) (data_base + (vir_bytes) (vir))
- 08542
- 08543 #define printf printk /* the kernel really uses printk, not printf */
- .Op 89 src/kernel/dp8390.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/dp8390.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 08600 /*
- 08601 dp8390.h
- 08602
- 08603 Created: before Dec 28, 1992 by Philip Homburg
- 08604 */
- 08605
- 08606 /* National Semiconductor DP8390 Network Interface Controller. */
- 08607
- 08608 /* Page 0, for reading ------------- */
- 08609 #define DP_CR 0x0 /* Read side of Command Register */
- 08610 #define DP_CLDA0 0x1 /* Current Local Dma Address 0 */
- 08611 #define DP_CLDA1 0x2 /* Current Local Dma Address 1 */
- 08612 #define DP_BNRY 0x3 /* Boundary Pointer */
- 08613 #define DP_TSR 0x4 /* Transmit Status Register */
- 08614 #define DP_NCR 0x5 /* Number of Collisions Register */
- 08615 #define DP_FIFO 0x6 /* Fifo ?? */
- 08616 #define DP_ISR 0x7 /* Interrupt Status Register */
- 08617 #define DP_CRDA0 0x8 /* Current Remote Dma Address 0 */
- 08618 #define DP_CRDA1 0x9 /* Current Remote Dma Address 1 */
- 08619 #define DP_DUM1 0xA /* unused */
- 08620 #define DP_DUM2 0xB /* unused */
- 08621 #define DP_RSR 0xC /* Receive Status Register */
- 08622 #define DP_CNTR0 0xD /* Tally Counter 0 */
- 08623 #define DP_CNTR1 0xE /* Tally Counter 1 */
- 08624 #define DP_CNTR2 0xF /* Tally Counter 2 */
- 08625
- 08626 /* Page 0, for writing ------------- */
- 08627 #define DP_CR 0x0 /* Write side of Command Register */
- 08628 #define DP_PSTART 0x1 /* Page Start Register */
- 08629 #define DP_PSTOP 0x2 /* Page Stop Register */
- 08630 #define DP_BNRY 0x3 /* Boundary Pointer */
- 08631 #define DP_TPSR 0x4 /* Transmit Page Start Register */
- 08632 #define DP_TBCR0 0x5 /* Transmit Byte Count Register 0 */
- 08633 #define DP_TBCR1 0x6 /* Transmit Byte Count Register 1 */
- 08634 #define DP_ISR 0x7 /* Interrupt Status Register */
- 08635 #define DP_RSAR0 0x8 /* Remote Start Address Register 0 */
- 08636 #define DP_RSAR1 0x9 /* Remote Start Address Register 1 */
- 08637 #define DP_RBCR0 0xA /* Remote Byte Count Register 0 */
- 08638 #define DP_RBCR1 0xB /* Remote Byte Count Register 1 */
- 08639 #define DP_RCR 0xC /* Receive Configuration Register */
- 08640 #define DP_TCR 0xD /* Transmit Configuration Register */
- 08641 #define DP_DCR 0xE /* Data Configuration Register */
- 08642 #define DP_IMR 0xF /* Interrupt Mask Register */
- 08643
- 08644 /* Page 1, read/write -------------- */
- 08645 #define DP_CR 0x0 /* Command Register */
- 08646 #define DP_PAR0 0x1 /* Physical Address Register 0 */
- 08647 #define DP_PAR1 0x2 /* Physical Address Register 1 */
- 08648 #define DP_PAR2 0x3 /* Physical Address Register 2 */
- 08649 #define DP_PAR3 0x4 /* Physical Address Register 3 */
- 08650 #define DP_PAR4 0x5 /* Physical Address Register 4 */
- 08651 #define DP_PAR5 0x6 /* Physical Address Register 5 */
- 08652 #define DP_CURR 0x7 /* Current Page Register */
- 08653 #define DP_MAR0 0x8 /* Multicast Address Register 0 */
- 08654 #define DP_MAR1 0x9 /* Multicast Address Register 1 */
- .Ep 90 src/kernel/dp8390.h
- 08655 #define DP_MAR2 0xA /* Multicast Address Register 2 */
- 08656 #define DP_MAR3 0xB /* Multicast Address Register 3 */
- 08657 #define DP_MAR4 0xC /* Multicast Address Register 4 */
- 08658 #define DP_MAR5 0xD /* Multicast Address Register 5 */
- 08659 #define DP_MAR6 0xE /* Multicast Address Register 6 */
- 08660 #define DP_MAR7 0xF /* Multicast Address Register 7 */
- 08661
- 08662 /* Bits in dp_cr */
- 08663 #define CR_STP 0x01 /* Stop: software reset */
- 08664 #define CR_STA 0x02 /* Start: activate NIC */
- 08665 #define CR_TXP 0x04 /* Transmit Packet */
- 08666 #define CR_DMA 0x38 /* Mask for DMA control */
- 08667 #define CR_DM_NOP 0x00 /* DMA: No Operation */
- 08668 #define CR_DM_RR 0x08 /* DMA: Remote Read */
- 08669 #define CR_DM_RW 0x10 /* DMA: Remote Write */
- 08670 #define CR_DM_SP 0x18 /* DMA: Send Packet */
- 08671 #define CR_DM_ABORT 0x20 /* DMA: Abort Remote DMA Operation */
- 08672 #define CR_PS 0xC0 /* Mask for Page Select */
- 08673 #define CR_PS_P0 0x00 /* Register Page 0 */
- 08674 #define CR_PS_P1 0x40 /* Register Page 1 */
- 08675 #define CR_PS_T0 0x80 /* Test Mode Register Map ?? */
- 08676 #define CR_SP_T1 0xC0 /* Test Mode Register Map ?? */
- 08677
- 08678 /* Bits in dp_isr */
- 08679 #define ISR_MASK 0x3F
- 08680 #define ISR_PRX 0x01 /* Packet Received with no errors */
- 08681 #define ISR_PTX 0x02 /* Packet Transmitted with no errors */
- 08682 #define ISR_RXE 0x04 /* Receive Error */
- 08683 #define ISR_TXE 0x08 /* Transmit Error */
- 08684 #define ISR_OVW 0x10 /* Overwrite Warning */
- 08685 #define ISR_CNT 0x20 /* Counter Overflow */
- 08686 #define ISR_RDC 0x40 /* Remote DMA Complete */
- 08687 #define ISR_RST 0x80 /* Reset Status */
- 08688
- 08689 /* Bits in dp_imr */
- 08690 #define IMR_PRXE 0x01 /* Packet Received iEnable */
- 08691 #define IMR_PTXE 0x02 /* Packet Transmitted iEnable */
- 08692 #define IMR_RXEE 0x04 /* Receive Error iEnable */
- 08693 #define IMR_TXEE 0x08 /* Transmit Error iEnable */
- 08694 #define IMR_OVWE 0x10 /* Overwrite Warning iEnable */
- 08695 #define IMR_CNTE 0x20 /* Counter Overflow iEnable */
- 08696 #define IMR_RDCE 0x40 /* DMA Complete iEnable */
- 08697
- 08698 /* Bits in dp_dcr */
- 08699 #define DCR_WTS 0x01 /* Word Transfer Select */
- 08700 #define DCR_BYTEWIDE 0x00 /* WTS: byte wide transfers */
- 08701 #define DCR_WORDWIDE 0x01 /* WTS: word wide transfers */
- 08702 #define DCR_BOS 0x02 /* Byte Order Select */
- 08703 #define DCR_LTLENDIAN 0x00 /* BOS: Little Endian */
- 08704 #define DCR_BIGENDIAN 0x02 /* BOS: Big Endian */
- 08705 #define DCR_LAS 0x04 /* Long Address Select */
- 08706 #define DCR_BMS 0x08 /* Burst Mode Select */
- 08707 #define DCR_AR 0x10 /* Autoinitialize Remote */
- 08708 #define DCR_FTS 0x60 /* Fifo Threshold Select */
- 08709 #define DCR_2BYTES 0x00 /* 2 bytes */
- 08710 #define DCR_4BYTES 0x40 /* 4 bytes */
- 08711 #define DCR_8BYTES 0x20 /* 8 bytes */
- 08712 #define DCR_12BYTES 0x60 /* 12 bytes */
- 08713
- 08714 /* Bits in dp_tcr */
- .Op 91 src/kernel/dp8390.h
- 08715 #define TCR_CRC 0x01 /* Inhibit CRC */
- 08716 #define TCR_ELC 0x06 /* Encoded Loopback Control */
- 08717 #define TCR_NORMAL 0x00 /* ELC: Normal Operation */
- 08718 #define TCR_INTERNAL 0x02 /* ELC: Internal Loopback */
- 08719 #define TCR_0EXTERNAL 0x04 /* ELC: External Loopback LPBK=0 */
- 08720 #define TCR_1EXTERNAL 0x06 /* ELC: External Loopback LPBK=1 */
- 08721 #define TCR_ATD 0x08 /* Auto Transmit */
- 08722 #define TCR_OFST 0x10 /* Collision Offset Enable (be nice) */
- 08723
- 08724 /* Bits in dp_tsr */
- 08725 #define TSR_PTX 0x01 /* Packet Transmitted (without error)*/
- 08726 #define TSR_DFR 0x02 /* Transmit Deferred */
- 08727 #define TSR_COL 0x04 /* Transmit Collided */
- 08728 #define TSR_ABT 0x08 /* Transmit Aborted */
- 08729 #define TSR_CRS 0x10 /* Carrier Sense Lost */
- 08730 #define TSR_FU 0x20 /* FIFO Underrun */
- 08731 #define TSR_CDH 0x40 /* CD Heartbeat */
- 08732 #define TSR_OWC 0x80 /* Out of Window Collision */
- 08733
- 08734 /* Bits in tp_rcr */
- 08735 #define RCR_SEP 0x01 /* Save Errored Packets */
- 08736 #define RCR_AR 0x02 /* Accept Runt Packets */
- 08737 #define RCR_AB 0x04 /* Accept Broadcast */
- 08738 #define RCR_AM 0x08 /* Accept Multicast */
- 08739 #define RCR_PRO 0x10 /* Physical Promiscuous */
- 08740 #define RCR_MON 0x20 /* Monitor Mode */
- 08741
- 08742 /* Bits in dp_rsr */
- 08743 #define RSR_PRX 0x01 /* Packet Received Intact */
- 08744 #define RSR_CRC 0x02 /* CRC Error */
- 08745 #define RSR_FAE 0x04 /* Frame Alignment Error */
- 08746 #define RSR_FO 0x08 /* FIFO Overrun */
- 08747 #define RSR_MPA 0x10 /* Missed Packet */
- 08748 #define RSR_PHY 0x20 /* Multicast Address Match !! */
- 08749 #define RSR_DIS 0x40 /* Receiver Disabled */
- 08750
- 08751
- 08752 typedef struct dp_rcvhdr
- 08753 {
- 08754 u8_t dr_status; /* Copy of rsr */
- 08755 u8_t dr_next; /* Pointer to next packet */
- 08756 u8_t dr_rbcl; /* Receive Byte Count Low */
- 08757 u8_t dr_rbch; /* Receive Byte Count High */
- 08758 } dp_rcvhdr_t;
- 08759
- 08760 #define DP_PAGESIZE 256
- 08761
- 08762 /* Some macros to simplify accessing the dp8390 */
- 08763 #define inb_reg0(dep, reg) (in_byte(dep->de_dp8390_port+reg))
- 08764 #define outb_reg0(dep, reg, data) (out_byte(dep->de_dp8390_port+reg, data))
- 08765 #define inb_reg1(dep, reg) (in_byte (dep->de_dp8390_port+reg))
- 08766 #define outb_reg1(dep, reg, data) (out_byte(dep->de_dp8390_port+reg, data))
- 08767
- 08768 /* Software interface to the dp8390 driver */
- 08769
- 08770 struct dpeth;
- 08771 struct iovec_dat;
- 08772 _PROTOTYPE( typedef void (*dp_initf_t), (struct dpeth *dep) );
- 08773 _PROTOTYPE( typedef void (*dp_stopf_t), (struct dpeth *dep) );
- 08774 _PROTOTYPE( typedef void (*dp_user2nicf_t), (struct dpeth *dep,
- .Ep 92 src/kernel/dp8390.h
- 08775 struct iovec_dat *iovp, vir_bytes offset,
- 08776 int nic_addr, vir_bytes count) );
- 08777 _PROTOTYPE( typedef void (*dp_nic2userf_t), (struct dpeth *dep,
- 08778 int nic_addr, struct iovec_dat *iovp,
- 08779 vir_bytes offset, vir_bytes count) );
- 08780 #if 0
- 08781 _PROTOTYPE( typedef void (*dp_getheaderf_t), (struct dpeth *dep,
- 08782 int page, struct dp_rcvhdr *h, u16_t *eth_type) );
- 08783 #endif
- 08784 _PROTOTYPE( typedef void (*dp_getblock_t), (struct dpeth *dep,
- 08785 int page, size_t offset, size_t size, void *dst) );
- 08786
- 08787 /* iovectors are handled IOVEC_NR entries at a time. */
- 08788 #define IOVEC_NR 16
- 08789
- 08790 typedef struct iovec_dat
- 08791 {
- 08792 iovec_t iod_iovec[IOVEC_NR];
- 08793 int iod_iovec_s;
- 08794 int iod_proc_nr;
- 08795 vir_bytes iod_iovec_addr;
- 08796 } iovec_dat_t;
- 08797
- 08798 #define SENDQ_NR 2 /* Maximum size of the send queue */
- 08799 #define SENDQ_PAGES 6 /* 6 * DP_PAGESIZE >= 1514 bytes */
- 08800
- 08801 typedef struct dpeth
- 08802 {
- 08803 /* The de_base_port field is the starting point of the probe.
- 08804 * The conf routine also fills de_linmem and de_irq. If the probe
- 08805 * routine knows the irq and/or memory address because they are
- 08806 * hardwired in the board, the probe should modify these fields.
- 08807 * Futhermore, the probe routine should also fill in de_initf and
- 08808 * de_stopf fields with the appropriate function pointers and set
- 08809 * de_prog_IO iff programmed I/O is to be used.
- 08810 */
- 08811 port_t de_base_port;
- 08812 phys_bytes de_linmem;
- 08813 int de_irq;
- 08814 dp_initf_t de_initf;
- 08815 dp_stopf_t de_stopf;
- 08816 int de_prog_IO;
- 08817
- 08818 /* The initf function fills the following fields. Only cards that do
- 08819 * programmed I/O fill in the de_pata_port field.
- 08820 * In addition, the init routine has to fill in the sendq data
- 08821 * structures.
- 08822 */
- 08823 ether_addr_t de_address;
- 08824 port_t de_dp8390_port;
- 08825 port_t de_data_port;
- 08826 int de_16bit;
- 08827 int de_ramsize;
- 08828 int de_offset_page;
- 08829 int de_startpage;
- 08830 int de_stoppage;
- 08831
- 08832 /* Do it yourself send queue */
- 08833 struct sendq
- 08834 {
- .Op 93 src/kernel/dp8390.h
- 08835 int sq_filled; /* this buffer contains a packet */
- 08836 int sq_size; /* with this size */
- 08837 int sq_sendpage; /* starting page of the buffer */
- 08838 } de_sendq[SENDQ_NR];
- 08839 int de_sendq_nr;
- 08840 int de_sendq_head; /* Enqueue at the head */
- 08841 int de_sendq_tail; /* Dequeue at the tail */
- 08842
- 08843 /* The de_memsegm field is calculated based on the de_linmem field */
- 08844 segm_t de_memsegm;
- 08845
- 08846 /* Fields for internal use by the dp8390 driver. */
- 08847 int de_flags;
- 08848 int de_mode;
- 08849 eth_stat_t de_stat;
- 08850 iovec_dat_t de_read_iovec;
- 08851 iovec_dat_t de_write_iovec;
- 08852 iovec_dat_t de_tmp_iovec;
- 08853 vir_bytes de_read_s;
- 08854 int de_client;
- 08855 message de_sendmsg;
- 08856 dp_user2nicf_t de_user2nicf;
- 08857 dp_nic2userf_t de_nic2userf;
- 08858 dp_getblock_t de_getblockf;
- 08859 } dpeth_t;
- 08860
- 08861 #define DEI_DEFAULT 0x8000
- 08862
- 08863 #define DEF_EMPTY 0x000
- 08864 #define DEF_PACK_SEND 0x001
- 08865 #define DEF_PACK_RECV 0x002
- 08866 #define DEF_SEND_AVAIL 0x004
- 08867 #define DEF_READING 0x010
- 08868 #define DEF_PROMISC 0x040
- 08869 #define DEF_MULTI 0x080
- 08870 #define DEF_BROAD 0x100
- 08871 #define DEF_ENABLED 0x200
- 08872 #define DEF_STOPPED 0x400
- 08873
- 08874 #define DEM_DISABLED 0x0
- 08875 #define DEM_SINK 0x1
- 08876 #define DEM_ENABLED 0x2
- 08877
- 08878
- 08879 /*
- 08880 * $PchHeader: /mount/hd2/minix/sys/kernel/ibm/RCS/dp8390.h,v 1.4 1995/06/12 18:21:01 philip Exp $
- 08881 */
- .Ep 94 src/kernel/driver.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/driver.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 08900 /* Types and constants shared between the generic and device dependent
- 08901 * device driver code.
- 08902 */
- 08903
- 08904 #include <minix/callnr.h>
- 08905 #include <minix/com.h>
- 08906 #include "proc.h"
- 08907 #include <minix/partition.h>
- 08908
- 08909 /* Info about and entry points into the device dependent code. */
- 08910 struct driver {
- 08911 _PROTOTYPE( char *(*dr_name), (void) );
- 08912 _PROTOTYPE( int (*dr_open), (struct driver *dp, message *m_ptr) );
- 08913 _PROTOTYPE( int (*dr_close), (struct driver *dp, message *m_ptr) );
- 08914 _PROTOTYPE( int (*dr_ioctl), (struct driver *dp, message *m_ptr) );
- 08915 _PROTOTYPE( struct device *(*dr_prepare), (int device) );
- 08916 _PROTOTYPE( int (*dr_schedule), (int proc_nr, struct iorequest_s *request) );
- 08917 _PROTOTYPE( int (*dr_finish), (void) );
- 08918 _PROTOTYPE( void (*dr_cleanup), (void) );
- 08919 _PROTOTYPE( void (*dr_geometry), (struct partition *entry) );
- 08920 };
- 08921
- 08922 #if (CHIP == INTEL)
- 08923
- 08924 /* Number of bytes you can DMA before hitting a 64K boundary: */
- 08925 #define dma_bytes_left(phys)
- 08926 ((unsigned) (sizeof(int) == 2 ? 0 : 0x10000) - (unsigned) ((phys) & 0xFFFF))
- 08927
- 08928 #endif /* CHIP == INTEL */
- 08929
- 08930 /* Base and size of a partition in bytes. */
- 08931 struct device {
- 08932 unsigned long dv_base;
- 08933 unsigned long dv_size;
- 08934 };
- 08935
- 08936 #define NIL_DEV ((struct device *) 0)
- 08937
- 08938 /* Functions defined by driver.c: */
- 08939 _PROTOTYPE( void driver_task, (struct driver *dr) );
- 08940 _PROTOTYPE( int do_rdwt, (struct driver *dr, message *m_ptr) );
- 08941 _PROTOTYPE( int do_vrdwt, (struct driver *dr, message *m_ptr) );
- 08942 _PROTOTYPE( char *no_name, (void) );
- 08943 _PROTOTYPE( int do_nop, (struct driver *dp, message *m_ptr) );
- 08944 _PROTOTYPE( int nop_finish, (void) );
- 08945 _PROTOTYPE( void nop_cleanup, (void) );
- 08946 _PROTOTYPE( void clock_mess, (int ticks, watchdog_t func) );
- 08947 _PROTOTYPE( int do_diocntl, (struct driver *dr, message *m_ptr) );
- 08948
- 08949 /* Parameters for the disk drive. */
- 08950 #define SECTOR_SIZE 512 /* physical sector size in bytes */
- 08951 #define SECTOR_SHIFT 9 /* for division */
- 08952 #define SECTOR_MASK 511 /* and remainder */
- 08953
- 08954 /* Size of the DMA buffer buffer in bytes. */
- .Op 95 src/kernel/driver.h
- 08955 #define DMA_BUF_SIZE (DMA_SECTORS * SECTOR_SIZE)
- 08956
- 08957 #if (CHIP == INTEL)
- 08958 extern u8_t *tmp_buf; /* the DMA buffer */
- 08959 #else
- 08960 extern u8_t tmp_buf[]; /* the DMA buffer */
- 08961 #endif
- 08962 extern phys_bytes tmp_phys; /* phys address of DMA buffer */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/drvlib.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 09000 /* IBM device driver definitions Author: Kees J. Bot
- 09001 * 7 Dec 1995
- 09002 */
- 09003
- 09004 #include <ibm/partition.h>
- 09005
- 09006 _PROTOTYPE( void partition, (struct driver *dr, int device, int style) );
- 09007
- 09008 /* BIOS parameter table layout. */
- 09009 #define bp_cylinders(t) (* (u16_t *) (&(t)[0]))
- 09010 #define bp_heads(t) (* (u8_t *) (&(t)[2]))
- 09011 #define bp_reduced_wr(t) (* (u16_t *) (&(t)[3]))
- 09012 #define bp_precomp(t) (* (u16_t *) (&(t)[5]))
- 09013 #define bp_max_ecc(t) (* (u8_t *) (&(t)[7]))
- 09014 #define bp_ctlbyte(t) (* (u8_t *) (&(t)[8]))
- 09015 #define bp_landingzone(t) (* (u16_t *) (&(t)[12]))
- 09016 #define bp_sectors(t) (* (u8_t *) (&(t)[14]))
- 09017
- 09018 /* Miscellaneous. */
- 09019 #define DEV_PER_DRIVE (1 + NR_PARTITIONS)
- 09020 #define MINOR_hd1a 128
- 09021 #define MINOR_fd0a (28<<2)
- 09022 #define P_FLOPPY 0
- 09023 #define P_PRIMARY 1
- 09024 #define P_SUB 2
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/glo.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 09100 /* Global variables used in the kernel. */
- 09101
- 09102 /* EXTERN is defined as extern except in table.c. */
- 09103 #ifdef _TABLE
- 09104 #undef EXTERN
- 09105 #define EXTERN
- 09106 #endif
- 09107
- 09108 /* Kernel memory. */
- 09109 EXTERN phys_bytes code_base; /* base of kernel code */
- .Ep 96 src/kernel/glo.h
- 09110 EXTERN phys_bytes data_base; /* base of kernel data */
- 09111
- 09112 /* Low level interrupt communications. */
- 09113 EXTERN struct proc *held_head; /* head of queue of held-up interrupts */
- 09114 EXTERN struct proc *held_tail; /* tail of queue of held-up interrupts */
- 09115 EXTERN unsigned char k_reenter; /* kernel reentry count (entry count less 1)*/
- 09116
- 09117 /* Process table. Here to stop too many things having to include proc.h. */
- 09118 EXTERN struct proc *proc_ptr; /* pointer to currently running process */
- 09119
- 09120 /* Signals. */
- 09121 EXTERN int sig_procs; /* number of procs with p_pending != 0 */
- 09122
- 09123 /* Memory sizes. */
- 09124 EXTERN struct memory mem[NR_MEMS]; /* base and size of chunks of memory */
- 09125 EXTERN phys_clicks tot_mem_size; /* total system memory size */
- 09126
- 09127 /* Miscellaneous. */
- 09128 extern u16_t sizes[]; /* table filled in by boot monitor */
- 09129 extern struct tasktab tasktab[];/* initialized in table.c, so extern here */
- 09130 extern char *t_stack[]; /* initialized in table.c, so extern here */
- 09131 EXTERN unsigned lost_ticks; /* clock ticks counted outside the clock task */
- 09132 EXTERN clock_t tty_timeout; /* time to wake up the TTY task */
- 09133 EXTERN int current; /* currently visible console */
- 09134
- 09135 #if (CHIP == INTEL)
- 09136
- 09137 /* Machine type. */
- 09138 EXTERN int pc_at; /* PC-AT compatible hardware interface */
- 09139 EXTERN int ps_mca; /* PS/2 with Micro Channel */
- 09140 EXTERN unsigned int processor; /* 86, 186, 286, 386, ... */
- 09141 #if _WORD_SIZE == 2
- 09142 EXTERN int protected_mode; /* nonzero if running in Intel protected mode*/
- 09143 #else
- 09144 #define protected_mode 1 /* 386 mode implies protected mode */
- 09145 #endif
- 09146
- 09147 /* Video card types. */
- 09148 EXTERN int ega; /* nonzero if console is EGA */
- 09149 EXTERN int vga; /* nonzero if console is VGA */
- 09150
- 09151 /* Memory sizes. */
- 09152 EXTERN unsigned ext_memsize; /* initialized by assembler startup code */
- 09153 EXTERN unsigned low_memsize;
- 09154
- 09155 /* Miscellaneous. */
- 09156 EXTERN irq_handler_t irq_table[NR_IRQ_VECTORS];
- 09157 EXTERN int irq_use; /* bit map of all in-use irq's */
- 09158 EXTERN reg_t mon_ss, mon_sp; /* monitor stack */
- 09159 EXTERN int mon_return; /* true if return to the monitor possible */
- 09160 EXTERN phys_bytes reboot_code; /* program for the boot monitor */
- 09161
- 09162 /* Variables that are initialized elsewhere are just extern here. */
- 09163 extern struct segdesc_s gdt[]; /* global descriptor table for protected mode*/
- 09164
- 09165 EXTERN _PROTOTYPE( void (*level0_func), (void) );
- 09166 #endif /* (CHIP == INTEL) */
- 09167
- 09168 #if (CHIP == M68000)
- 09169 /* Variables that are initialized elsewhere are just extern here. */
- .Op 97 src/kernel/glo.h
- 09170 extern int keypad; /* Flag for keypad mode */
- 09171 extern int app_mode; /* Flag for arrow key application mode */
- 09172 extern int STdebKey; /* nonzero if ctl-alt-Fx detected */
- 09173 extern struct tty *cur_cons; /* virtual cons currently displayed */
- 09174 extern unsigned char font8[]; /* 8 pixel wide font table (initialized) */
- 09175 extern unsigned char font12[]; /* 12 pixel wide font table (initialized) */
- 09176 extern unsigned char font16[]; /* 16 pixel wide font table (initialized) */
- 09177 extern unsigned short resolution; /* screen res; ST_RES_LOW..TT_RES_HIGH */
- 09178 #endif
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/kernel.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 09200 /* This is the master header for the kernel. It includes some other files
- 09201 * and defines the principal constants.
- 09202 */
- 09203 #define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */
- 09204 #define _MINIX 1 /* tell headers to include MINIX stuff */
- 09205 #define _SYSTEM 1 /* tell headers that this is the kernel */
- 09206
- 09207 /* The following are so basic, all the *.c files get them automatically. */
- 09208 #include <minix/config.h> /* MUST be first */
- 09209 #include <ansi.h> /* MUST be second */
- 09210 #include <sys/types.h>
- 09211 #include <minix/const.h>
- 09212 #include <minix/type.h>
- 09213 #include <minix/syslib.h>
- 09214
- 09215 #include <string.h>
- 09216 #include <limits.h>
- 09217 #include <errno.h>
- 09218
- 09219 #include "const.h"
- 09220 #include "type.h"
- 09221 #include "proto.h"
- 09222 #include "glo.h"
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/ne2000.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 09300 /*
- 09301 ne2000.h
- 09302
- 09303 Created: March 15, 1994 by Philip Homburg <philip@cs.vu.nl>
- 09304 */
- 09305
- 09306 #ifndef NE2000_H
- 09307 #define NE2000_H
- 09308
- 09309 #define NE_DP8390 0x00
- 09310 #define NE_DATA 0x10
- 09311 #define NE_RESET 0x1F
- 09312
- 09313 #define NE1000_START 0x2000
- 09314 #define NE1000_SIZE 0x2000
- .Ep 98 src/kernel/ne2000.h
- 09315 #define NE2000_START 0x4000
- 09316 #define NE2000_SIZE 0x4000
- 09317
- 09318 #define inb_ne(dep, reg) (in_byte(dep->de_base_port+reg))
- 09319 #define outb_ne(dep, reg, data) (out_byte(dep->de_base_port+reg, data))
- 09320 #define inw_ne(dep, reg) (in_word(dep->de_base_port+reg))
- 09321 #define outw_ne(dep, reg, data) (out_word(dep->de_base_port+reg, data))
- 09322
- 09323 #endif /* NE2000_H */
- 09324
- 09325 /*
- 09326 * $PchHeader: /mount/hd2/minix/sys/kernel/ibm/RCS/ne2000.h,v 1.1 1994/04/07 22:58:48 philip Exp $
- 09327 */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/proc.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 09400 #ifndef PROC_H
- 09401 #define PROC_H
- 09402
- 09403 /* Here is the declaration of the process table. It contains the process'
- 09404 * registers, memory map, accounting, and message send/receive information.
- 09405 * Many assembly code routines reference fields in it. The offsets to these
- 09406 * fields are defined in the assembler include file sconst.h. When changing
- 09407 * 'proc', be sure to change sconst.h to match.
- 09408 */
- 09409
- 09410 struct proc {
- 09411 struct stackframe_s p_reg; /* process' registers saved in stack frame */
- 09412
- 09413 #if (CHIP == INTEL)
- 09414 reg_t p_ldt_sel; /* selector in gdt giving ldt base and limit*/
- 09415 struct segdesc_s p_ldt[2]; /* local descriptors for code and data */
- 09416 /* 2 is LDT_SIZE - avoid include protect.h */
- 09417 #endif /* (CHIP == INTEL) */
- 09418
- 09419 #if (CHIP == M68000)
- 09420 reg_t p_splow; /* lowest observed stack value */
- 09421 int p_trap; /* trap type (only low byte) */
- 09422 #if (SHADOWING == 0)
- 09423 char *p_crp; /* mmu table pointer (really struct _rpr *) */
- 09424 #else
- 09425 phys_clicks p_shadow; /* set if shadowed process image */
- 09426 int align; /* make the struct size a multiple of 4 */
- 09427 #endif
- 09428 int p_nflips; /* statistics */
- 09429 char p_physio; /* cannot be (un)shadowed now if set */
- 09430 #if defined(FPP)
- 09431 struct fsave p_fsave; /* FPP state frame and registers */
- 09432 int align2; /* make the struct size a multiple of 4 */
- 09433 #endif
- 09434 #endif /* (CHIP == M68000) */
- 09435
- 09436 reg_t *p_stguard; /* stack guard word */
- 09437
- 09438 int p_nr; /* number of this process (for fast access) */
- 09439
- .Op 99 src/kernel/proc.h
- 09440 int p_int_blocked; /* nonzero if int msg blocked by busy task */
- 09441 int p_int_held; /* nonzero if int msg held by busy syscall */
- 09442 struct proc *p_nextheld; /* next in chain of held-up int processes */
- 09443
- 09444 int p_flags; /* P_SLOT_FREE, SENDING, RECEIVING, etc. */
- 09445 struct mem_map p_map[NR_SEGS];/* memory map */
- 09446 pid_t p_pid; /* process id passed in from MM */
- 09447
- 09448 clock_t user_time; /* user time in ticks */
- 09449 clock_t sys_time; /* sys time in ticks */
- 09450 clock_t child_utime; /* cumulative user time of children */
- 09451 clock_t child_stime; /* cumulative sys time of children */
- 09452 clock_t p_alarm; /* time of next alarm in ticks, or 0 */
- 09453
- 09454 struct proc *p_callerq; /* head of list of procs wishing to send */
- 09455 struct proc *p_sendlink; /* link to next proc wishing to send */
- 09456 message *p_messbuf; /* pointer to message buffer */
- 09457 int p_getfrom; /* from whom does process want to receive? */
- 09458 int p_sendto;
- 09459
- 09460 struct proc *p_nextready; /* pointer to next ready process */
- 09461 sigset_t p_pending; /* bit map for pending signals */
- 09462 unsigned p_pendcount; /* count of pending and unfinished signals */
- 09463
- 09464 char p_name[16]; /* name of the process */
- 09465 };
- 09466
- 09467 /* Guard word for task stacks. */
- 09468 #define STACK_GUARD ((reg_t) (sizeof(reg_t) == 2 ? 0xBEEF : 0xDEADBEEF))
- 09469
- 09470 /* Bits for p_flags in proc[]. A process is runnable iff p_flags == 0. */
- 09471 #define P_SLOT_FREE 001 /* set when slot is not in use */
- 09472 #define NO_MAP 002 /* keeps unmapped forked child from running */
- 09473 #define SENDING 004 /* set when process blocked trying to send */
- 09474 #define RECEIVING 010 /* set when process blocked trying to recv */
- 09475 #define PENDING 020 /* set when inform() of signal pending */
- 09476 #define SIG_PENDING 040 /* keeps to-be-signalled proc from running */
- 09477 #define P_STOP 0100 /* set when process is being traced */
- 09478
- 09479 /* Magic process table addresses. */
- 09480 #define BEG_PROC_ADDR (&proc[0])
- 09481 #define END_PROC_ADDR (&proc[NR_TASKS + NR_PROCS])
- 09482 #define END_TASK_ADDR (&proc[NR_TASKS])
- 09483 #define BEG_SERV_ADDR (&proc[NR_TASKS])
- 09484 #define BEG_USER_ADDR (&proc[NR_TASKS + LOW_USER])
- 09485
- 09486 #define NIL_PROC ((struct proc *) 0)
- 09487 #define isidlehardware(n) ((n) == IDLE || (n) == HARDWARE)
- 09488 #define isokprocn(n) ((unsigned) ((n) + NR_TASKS) < NR_PROCS + NR_TASKS)
- 09489 #define isoksrc_dest(n) (isokprocn(n) || (n) == ANY)
- 09490 #define isoksusern(n) ((unsigned) (n) < NR_PROCS)
- 09491 #define isokusern(n) ((unsigned) ((n) - LOW_USER) < NR_PROCS - LOW_USER)
- 09492 #define isrxhardware(n) ((n) == ANY || (n) == HARDWARE)
- 09493 #define issysentn(n) ((n) == FS_PROC_NR || (n) == MM_PROC_NR)
- 09494 #define istaskp(p) ((p) < END_TASK_ADDR && (p) != proc_addr(IDLE))
- 09495 #define isuserp(p) ((p) >= BEG_USER_ADDR)