?? com.h
字號:
#ifndef _MINIX_COM_H#define _MINIX_COM_H /*===========================================================================* * Magic process numbers * *===========================================================================*/#define ANY 0x7ace /* used to indicate 'any process' */#define NONE 0x6ace /* used to indicate 'no process at all' */#define SELF 0x8ace /* used to indicate 'own process' *//*===========================================================================* * Process numbers of processes in the system image * *===========================================================================*//* The values of several task numbers depend on whether they or other tasks * are enabled. They are defined as (PREVIOUS_TASK - ENABLE_TASK) in general. * ENABLE_TASK is either 0 or 1, so a task either gets a new number, or gets * the same number as the previous task and is further unused. Note that the * order should correspond to the order in the task table defined in table.c. *//* Kernel tasks. These all run in the same address space. */#define IDLE -4 /* runs when no one else can run */#define CLOCK -3 /* alarms and other clock functions */#define SYSTEM -2 /* request system functionality */#define KERNEL -1 /* pseudo-process for IPC and scheduling */#define HARDWARE KERNEL /* for hardware interrupt handlers *//* Number of tasks. Note that NR_PROCS is defined in <minix/config.h>. */#define NR_TASKS 4 /* User-space processes, that is, device drivers, servers, and INIT. */#define PM_PROC_NR 0 /* process manager */#define FS_PROC_NR 1 /* file system */#define RS_PROC_NR 2 /* reincarnation server */#define MEM_PROC_NR 3 /* memory driver (RAM disk, null, etc.) */#define LOG_PROC_NR 4 /* log device driver */#define TTY_PROC_NR 5 /* terminal (TTY) driver */#define DRVR_PROC_NR 6 /* device driver for boot medium */#define DS_PROC_NR 7 /* data store server */#define INIT_PROC_NR 8 /* init -- goes multiuser *//* Number of processes contained in the system image. */#define NR_BOOT_PROCS (NR_TASKS + INIT_PROC_NR + 1)/*===========================================================================* * Kernel notification types * *===========================================================================*//* Kernel notification types. In principle, these can be sent to any process, * so make sure that these types do not interfere with other message types. * Notifications are prioritized because of the way they are unhold() and * blocking notifications are delivered. The lowest numbers go first. The * offset are used for the per-process notification bit maps. */#define NOTIFY_MESSAGE 0x1000#define NOTIFY_FROM(p_nr) (NOTIFY_MESSAGE | ((p_nr) + NR_TASKS)) # define SYN_ALARM NOTIFY_FROM(CLOCK) /* synchronous alarm */# define SYS_SIG NOTIFY_FROM(SYSTEM) /* system signal */# define HARD_INT NOTIFY_FROM(HARDWARE) /* hardware interrupt */# define NEW_KSIG NOTIFY_FROM(HARDWARE) /* new kernel signal */# define FKEY_PRESSED NOTIFY_FROM(TTY_PROC_NR)/* function key press */# define DEV_PING NOTIFY_FROM(RS_PROC_NR) /* driver liveness ping *//* Shorthands for message parameters passed with notifications. */#define NOTIFY_SOURCE m_source#define NOTIFY_TYPE m_type#define NOTIFY_ARG m2_l1#define NOTIFY_TIMESTAMP m2_l2#define NOTIFY_FLAGS m2_i1/*===========================================================================* * Messages for BLOCK and CHARACTER device drivers * *===========================================================================*//* Message types for device drivers. */#define DEV_RQ_BASE 0x400 /* base for device request types */#define DEV_RS_BASE 0x500 /* base for device response types */#define CANCEL (DEV_RQ_BASE + 0) /* force a task to cancel */#define DEV_READ (DEV_RQ_BASE + 3) /* read from minor device */#define DEV_WRITE (DEV_RQ_BASE + 4) /* write to minor device */#define DEV_IOCTL (DEV_RQ_BASE + 5) /* I/O control code */#define DEV_OPEN (DEV_RQ_BASE + 6) /* open a minor device */#define DEV_CLOSE (DEV_RQ_BASE + 7) /* close a minor device */#define DEV_SCATTER (DEV_RQ_BASE + 8) /* write from a vector */#define DEV_GATHER (DEV_RQ_BASE + 9) /* read into a vector */#define TTY_SETPGRP (DEV_RQ_BASE + 10) /* set process group */#define TTY_EXIT (DEV_RQ_BASE + 11) /* process group leader exited */ #define DEV_SELECT (DEV_RQ_BASE + 12) /* request select() attention */#define DEV_STATUS (DEV_RQ_BASE + 13) /* request driver status */#define DEV_REPLY (DEV_RS_BASE + 0) /* general task reply */#define DEV_CLONED (DEV_RS_BASE + 1) /* return cloned minor */#define DEV_REVIVE (DEV_RS_BASE + 2) /* driver revives process */#define DEV_IO_READY (DEV_RS_BASE + 3) /* selected device ready */#define DEV_NO_STATUS (DEV_RS_BASE + 4) /* empty status reply *//* Field names for messages to block and character device drivers. */#define DEVICE m2_i1 /* major-minor device */#define PROC_NR m2_i2 /* which (proc) wants I/O? */#define COUNT m2_i3 /* how many bytes to transfer */#define REQUEST m2_i3 /* ioctl request code */#define POSITION m2_l1 /* file offset */#define ADDRESS m2_p1 /* core buffer address *//* Field names for DEV_SELECT messages to device drivers. */#define DEV_MINOR m2_i1 /* minor device */#define DEV_SEL_OPS m2_i2 /* which select operations are requested */#define DEV_SEL_WATCH m2_i3 /* request notify if no operations are ready *//* Field names used in reply messages from tasks. */#define REP_PROC_NR m2_i1 /* # of proc on whose behalf I/O was done */#define REP_STATUS m2_i2 /* bytes transferred or error number */# define SUSPEND -998 /* status to suspend caller, reply later *//* Field names for messages to TTY driver. */#define TTY_LINE DEVICE /* message parameter: terminal line */#define TTY_REQUEST COUNT /* message parameter: ioctl request code */#define TTY_SPEK POSITION/* message parameter: ioctl speed, erasing */#define TTY_FLAGS m2_l2 /* message parameter: ioctl tty mode */#define TTY_PGRP m2_i3 /* message parameter: process group */ /* Field names for the QIC 02 status reply from tape driver */#define TAPE_STAT0 m2_l1#define TAPE_STAT1 m2_l2/*===========================================================================* * Messages for networking layer * *===========================================================================*//* Message types for network layer requests. This layer acts like a driver. */#define NW_OPEN DEV_OPEN#define NW_CLOSE DEV_CLOSE#define NW_READ DEV_READ#define NW_WRITE DEV_WRITE#define NW_IOCTL DEV_IOCTL#define NW_CANCEL CANCEL/* Base type for data link layer requests and responses. */#define DL_RQ_BASE 0x800 #define DL_RS_BASE 0x900 /* Message types for data link layer requests. */#define DL_WRITE (DL_RQ_BASE + 3)#define DL_WRITEV (DL_RQ_BASE + 4)#define DL_READ (DL_RQ_BASE + 5)#define DL_READV (DL_RQ_BASE + 6)#define DL_INIT (DL_RQ_BASE + 7)#define DL_STOP (DL_RQ_BASE + 8)#define DL_GETSTAT (DL_RQ_BASE + 9)#define DL_GETNAME (DL_RQ_BASE +10)/* Message type for data link layer replies. */#define DL_INIT_REPLY (DL_RS_BASE + 20)#define DL_TASK_REPLY (DL_RS_BASE + 21)#define DL_NAME_REPLY (DL_RS_BASE + 22)/* Field names for data link layer messages. */#define DL_PORT m2_i1#define DL_PROC m2_i2#define DL_COUNT m2_i3#define DL_MODE m2_l1#define DL_CLCK m2_l2#define DL_ADDR m2_p1#define DL_STAT m2_l1#define DL_NAME m3_ca1/* Bits in 'DL_STAT' field of DL replies. */# define DL_PACK_SEND 0x01# define DL_PACK_RECV 0x02# define DL_READ_IP 0x04/* Bits in 'DL_MODE' field of DL requests. */# define DL_NOMODE 0x0# define DL_PROMISC_REQ 0x2# define DL_MULTI_REQ 0x4# define DL_BROAD_REQ 0x8/*===========================================================================* * SYSTASK request types and field names * *===========================================================================*//* System library calls are dispatched via a call vector, so be careful when * modifying the system call numbers. The numbers here determine which call * is made from the call vector. */ #define KERNEL_CALL 0x600 /* base for kernel calls to SYSTEM */ # define SYS_FORK (KERNEL_CALL + 0) /* sys_fork() */# define SYS_EXEC (KERNEL_CALL + 1) /* sys_exec() */# define SYS_EXIT (KERNEL_CALL + 2) /* sys_exit() */# define SYS_NICE (KERNEL_CALL + 3) /* sys_nice() */# define SYS_PRIVCTL (KERNEL_CALL + 4) /* sys_privctl() */# define SYS_TRACE (KERNEL_CALL + 5) /* sys_trace() */# define SYS_KILL (KERNEL_CALL + 6) /* sys_kill() */# define SYS_GETKSIG (KERNEL_CALL + 7) /* sys_getsig() */# define SYS_ENDKSIG (KERNEL_CALL + 8) /* sys_endsig() */# define SYS_SIGSEND (KERNEL_CALL + 9) /* sys_sigsend() */# define SYS_SIGRETURN (KERNEL_CALL + 10) /* sys_sigreturn() */# define SYS_NEWMAP (KERNEL_CALL + 11) /* sys_newmap() */# define SYS_SEGCTL (KERNEL_CALL + 12) /* sys_segctl() */# define SYS_MEMSET (KERNEL_CALL + 13) /* sys_memset() */# define SYS_UMAP (KERNEL_CALL + 14) /* sys_umap() */# define SYS_VIRCOPY (KERNEL_CALL + 15) /* sys_vircopy() */# define SYS_PHYSCOPY (KERNEL_CALL + 16) /* sys_physcopy() */# define SYS_VIRVCOPY (KERNEL_CALL + 17) /* sys_virvcopy() */# define SYS_PHYSVCOPY (KERNEL_CALL + 18) /* sys_physvcopy() */# define SYS_IRQCTL (KERNEL_CALL + 19) /* sys_irqctl() */# define SYS_INT86 (KERNEL_CALL + 20) /* sys_int86() */# define SYS_DEVIO (KERNEL_CALL + 21) /* sys_devio() */# define SYS_SDEVIO (KERNEL_CALL + 22) /* sys_sdevio() */# define SYS_VDEVIO (KERNEL_CALL + 23) /* sys_vdevio() */# define SYS_SETALARM (KERNEL_CALL + 24) /* sys_setalarm() */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -