<commit_before>/*===========================================================================*
 *          	    System calls and magic process numbers		     *
 *===========================================================================*/

/* Masks and flags for system calls. */
#define SYSCALL_FUNC	0x0F	/* mask for system call function */
#define SYSCALL_FLAGS   0xF0    /* mask for system call flags */
#define NON_BLOCKING    0x10	/* don't block, but return */

/* System calls (numbers passed when trapping to the kernel) */
#define SEND		 1	/* function code for sending messages */
#define RECEIVE		 2	/* function code for receiving messages */
#define BOTH		 3	/* function code for SEND + RECEIVE */
#define NB_SEND 	(SEND | NON_BLOCKING)	  /* non-blocking SEND */
#define NB_RECEIVE	(RECEIVE | NON_BLOCKING)  /* non-blocking RECEIVE */

/* Magic, invalid 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 RTL8139    	 IDLE - ENABLE_RTL8139 		/* networking */
#define IDLE             -4	/* runs when no one else can run */
#define CLOCK  		 -3	/* alarms and other clock functions */
#define SYSTASK          -2	/* request system functionality */
#define HARDWARE         -1	/* used as source on notify() messages */

/* Number of tasks. Note that NR_PROCS is defined in <minix/config.h>. */
#define NR_TASKS	(4 + ENABLE_RTL8139)

/* Magic numbers for controllers. Device driver mapping is dynamic. */
#define CTRLR(n)	(NONE + (n))

/* User-level processes, that is, device drivers, servers, and INIT. */
#define MM_PROC_NR	 0	/* memory manager */
#define FS_PROC_NR 	 1	/* file system */
#define IS_PROC_NR	 5 	/* information server */
#define TTY		 6	/* terminal (TTY) driver */
#define MEMORY	 	 8  	/* memory driver (RAM disk, null, etc.) */
#define AT_WINI		(MEMORY + ENABLE_AT_WINI)   /* AT Winchester */
#define FLOPPY		(AT_WINI + ENABLE_FLOPPY)   /* floppy disk */
#define PRINTER		(FLOPPY + ENABLE_PRINTER)    /* Centronics */
#define INIT_PROC_NR	(PRINTER + 1)   	/* init -- goes multiuser */

/* Number of first user process not part of the operating system. */ 
#define LOW_USER  	INIT_PROC_NR  

/* The number of processes that are contained in the system image. */
#define IMAGE_SIZE 	(NR_TASKS + \
			5 + ENABLE_AT_WINI + ENABLE_FLOPPY + \
			ENABLE_PRINTER + 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 NR_NOTIFICATIONS 	  5	/* max. is # bits in notify_mask_t */
#	define NOTIFICATION 	333 	/* offset for notification types */
#	define HARD_INT	    NOTIFICATION + 0	/* hardware interrupt */
#	define SYN_ALARM    NOTIFICATION + 1  	/* synchronous alarm */
#	define KSIG_PENDING NOTIFICATION + 2  	/* signal(s) pending */
#	define NEW_KMESS    NOTIFICATION + 3  	/* new kernel message */
#	define HARD_STOP    NOTIFICATION + 4  	/* system shutdown */


/*===========================================================================*
 *                Messages for BLOCK and CHARACTER device drivers	     *
 *===========================================================================*/

#define CANCEL       	 0	/* general req to force a task to cancel */
#define DEV_READ	 3	/* fcn code for reading from tty */
#define DEV_WRITE   	 4	/* fcn code for writing to tty */
#define DEV_IOCTL    	 5	/* fcn code for ioctl */
#define DEV_OPEN     	 6	/* fcn code for opening tty */
#define DEV_CLOSE    	 7	/* fcn code for closing tty */
#define DEV_SCATTER  	 8	/* fcn code for writing from a vector */
#define DEV_GATHER   	 9	/* fcn code for reading into a vector */
#define TTY_SETPGRP 	10	/* fcn code for setpgroup */
#define TTY_EXIT	11	/* a process group leader has exited */	
#define SUSPEND	 	-998	/* used in interrupts when tty has no data */

/* 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 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 */

/* 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

/* Major and minor device numbers for MEMORY driver. */
#  define MEMORY_MAJOR  1	/* major device for memory devices */
#  define RAM_DEV     0		/* minor device for /dev/ram */
#  define MEM_DEV     1		/* minor device for /dev/mem */
#  define KMEM_DEV    2		/* minor device for /dev/kmem */
#  define NULL_DEV    3		/* minor device for /dev/null */
#  define BOOT_DEV    4		/* minor device for /dev/boot */

#  define DEV_RAM	0x0100	/* device number of /dev/ram */
#  define DEV_BOOT	0x0104	/* device number of /dev/boot */


/*===========================================================================*
 *                  	   Messages for networking layer		     *
 *===========================================================================*/

/* Message types for network layer requests. */
#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

/* Message types for data link layer requests. */
#define DL_WRITE	3
#define DL_WRITEV	4
#define DL_READ		5
#define DL_READV	6
#define DL_INIT		7
#define DL_STOP		8<commit_msg>Created /dev/random minor device number<commit_after>/*===========================================================================*
 *          	    System calls and magic process numbers		     *
 *===========================================================================*/

/* Masks and flags for system calls. */
#define SYSCALL_FUNC	0x0F	/* mask for system call function */
#define SYSCALL_FLAGS   0xF0    /* mask for system call flags */
#define NON_BLOCKING    0x10	/* don't block, but return */

/* System calls (numbers passed when trapping to the kernel) */
#define SEND		 1	/* function code for sending messages */
#define RECEIVE		 2	/* function code for receiving messages */
#define BOTH		 3	/* function code for SEND + RECEIVE */
#define NB_SEND 	(SEND | NON_BLOCKING)	  /* non-blocking SEND */
#define NB_RECEIVE	(RECEIVE | NON_BLOCKING)  /* non-blocking RECEIVE */

/* Magic, invalid 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 RTL8139    	 IDLE - ENABLE_RTL8139 		/* networking */
#define IDLE             -4	/* runs when no one else can run */
#define CLOCK  		 -3	/* alarms and other clock functions */
#define SYSTASK          -2	/* request system functionality */
#define HARDWARE         -1	/* used as source on notify() messages */

/* Number of tasks. Note that NR_PROCS is defined in <minix/config.h>. */
#define NR_TASKS	(4 + ENABLE_RTL8139)

/* Magic numbers for controllers. Device driver mapping is dynamic. */
#define CTRLR(n)	(NONE + (n))

/* User-level processes, that is, device drivers, servers, and INIT. */
#define MM_PROC_NR	 0	/* memory manager */
#define FS_PROC_NR 	 1	/* file system */
#define IS_PROC_NR	 5 	/* information server */
#define TTY		 6	/* terminal (TTY) driver */
#define MEMORY	 	 8  	/* memory driver (RAM disk, null, etc.) */
#define AT_WINI		(MEMORY + ENABLE_AT_WINI)   /* AT Winchester */
#define FLOPPY		(AT_WINI + ENABLE_FLOPPY)   /* floppy disk */
#define PRINTER		(FLOPPY + ENABLE_PRINTER)    /* Centronics */
#define INIT_PROC_NR	(PRINTER + 1)   	/* init -- goes multiuser */

/* Number of first user process not part of the operating system. */ 
#define LOW_USER  	INIT_PROC_NR  

/* The number of processes that are contained in the system image. */
#define IMAGE_SIZE 	(NR_TASKS + \
			5 + ENABLE_AT_WINI + ENABLE_FLOPPY + \
			ENABLE_PRINTER + 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 NR_NOTIFICATIONS 	  5	/* max. is # bits in notify_mask_t */
#	define NOTIFICATION 	333 	/* offset for notification types */
#	define HARD_INT	    NOTIFICATION + 0	/* hardware interrupt */
#	define SYN_ALARM    NOTIFICATION + 1  	/* synchronous alarm */
#	define KSIG_PENDING NOTIFICATION + 2  	/* signal(s) pending */
#	define NEW_KMESS    NOTIFICATION + 3  	/* new kernel message */
#	define HARD_STOP    NOTIFICATION + 4  	/* system shutdown */


/*===========================================================================*
 *                Messages for BLOCK and CHARACTER device drivers	     *
 *===========================================================================*/

#define CANCEL       	 0	/* general req to force a task to cancel */
#define DEV_READ	 3	/* fcn code for reading from tty */
#define DEV_WRITE   	 4	/* fcn code for writing to tty */
#define DEV_IOCTL    	 5	/* fcn code for ioctl */
#define DEV_OPEN     	 6	/* fcn code for opening tty */
#define DEV_CLOSE    	 7	/* fcn code for closing tty */
#define DEV_SCATTER  	 8	/* fcn code for writing from a vector */
#define DEV_GATHER   	 9	/* fcn code for reading into a vector */
#define TTY_SETPGRP 	10	/* fcn code for setpgroup */
#define TTY_EXIT	11	/* a process group leader has exited */	
#define SUSPEND	 	-998	/* used in interrupts when tty has no data */

/* 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 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 */

/* 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

/* Major and minor device numbers for MEMORY driver. */
#  define MEMORY_MAJOR  1	/* major device for memory devices */
#  define RAM_DEV     0		/* minor device for /dev/ram */
#  define MEM_DEV     1		/* minor device for /dev/mem */
#  define KMEM_DEV    2		/* minor device for /dev/kmem */
#  define NULL_DEV    3		/* minor device for /dev/null */
#  define BOOT_DEV    4		/* minor device for /dev/boot */
#  define RANDOM_DEV  5		/* minor device for /dev/random */
#  define URANDOM_DEV 6		/* minor device for /dev/urandom */

#  define DEV_RAM	0x0100	/* device number of /dev/ram */
#  define DEV_BOOT	0x0104	/* device number of /dev/boot */
#  define DEV_RANDOM	0x0105	/* device number of /dev/random */
#  define DEV_URANDOM	0x0106	/* device number of /dev/urandom */


/*===========================================================================*
 *                  	   Messages for networking layer		     *
 *===========================================================================*/

/* Message types for network layer requests. */
#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

/* Message types for data link layer requests. */
#define DL_WRITE	3
#define DL_WRITEV	4
#define DL_READ		5
#define DL_READV	6
#define DL_INIT		7
#define DL_STOP		8
{'fraction_non_alphanumeric': 0.18570753762062217, 'fraction_numerical': 0.016600310412308524, 'mean_word_length': 3.3206997084548107, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2805235', 'n_tokens_mistral': 4713, 'n_tokens_neox': 4386, 'n_words': 1671}