Updated various header files for consistency.
Remove some unused stuff ... better check to be done.
install::
-rm -rf $(INC)
mkdir -p $(INC)
- tar cf - `find . -name '*.h'` | (cd $(INC) && tar xf -)
+ tar cf - `find . -name '*.h'` | (cd $(INC) && tar xvf -)
-/* Physical memory layout on IMB compatible PCs. Only the major, fixed memory
+/* Physical memory layout on IBM compatible PCs. Only the major, fixed memory
* areas are detailed here. Known addresses of the BIOS data area are defined
* in <ibm/bios.h>. The map upper memory area (UMA) is only roughly defined
* since the UMA sections may vary in size and locus.
/* 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 SYSTASK -2 /* request system functionality */
-#define KERNEL -1 /* used as source on notify() messages */
+#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 INIT_PROC_NR (LOG_PROC_NR + 1) /* init -- goes multiuser */
/* Number of processes contained in the system image. */
-#define IMAGE_SIZE (NR_TASKS + \
+#define NR_BOOT_PROCS (NR_TASKS + \
5 + ENABLE_AT_WINI + ENABLE_FLOPPY + \
ENABLE_PRINTER + ENABLE_RTL8139 + ENABLE_FXP + \
ENABLE_DPETH + ENABLE_LOG + 1 )
* blocking notifications are delivered. The lowest numbers go first. The
* offset are used for the per-process notification bit maps.
*/
-#define NOTIFICATION 0x0800 /* flag for notifications */
-# 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 */
+#define NOTIFY_FROM(p_nr) (0x1000 | ((p_nr) + NR_TASKS))
+# define SYN_ALARM NOTIFY_FROM(CLOCK) /* synchronous alarm */
+# define KSIG_PENDING NOTIFY_FROM(SYSTEM) /* pending signal(s) */
+# define HARD_INT NOTIFY_FROM(HARDWARE) /* hardware interrupt */
+# define NEW_KMESS NOTIFY_FROM(SYSTEM) /* new kernel message */
+# define NEW_KSIG NOTIFY_FROM(HARDWARE) /* new kernel signal */
+# define FKEY_PRESSED NOTIFY_FROM(TTY) /* function key press */
+
+#define NOTIFICATION 0x800 /* flag for notifications */
+# define HARD_STOP (NOTIFICATION | 4) /* system shutdown */
# define DEV_SELECTED (NOTIFICATION | 5) /* select() notification */
#define NR_NOTIFY_TYPES 6 /* nr of bits in mask */
/* Shorthands for message parameters passed with notifications. */
-#define NOTIFY_SOURCE m_source
-#define NOTIFY_TYPE m_type
-#define NOTIFY_FLAGS m2_i1
-#define NOTIFY_ARG m2_l1
+#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
/*===========================================================================*
* is made from the call vector.
*/
# define SYS_TIMES 0 /* sys_times(proc_nr, bufptr) */
-# define SYS_XIT 1 /* sys_xit(parent, proc) */
-# define SYS_GETSIG 2 /* sys_getsig(proc_nr, sig_map) */
-
+# define SYS_EXIT 1 /* sys_exit(parent, proc) */
+# define SYS_GETKSIG 2 /* sys_getsig(proc_nr, sig_map) */
+# define SYS_ENDKSIG 3 /* sys_endsig(proc_nr) */
# define SYS_FORK 4 /* sys_fork(parent, child, pid) */
# define SYS_NEWMAP 5 /* sys_newmap(proc_nr, map_ptr) */
-# define SYS_ENDSIG 6 /* sys_endsig(proc_nr) */
+
# define SYS_EXEC 7 /* sys_exec(proc_nr, new_sp) */
# define SYS_SIGSEND 8 /* sys_sigsend(proc_nr, ctxt_ptr) */
# define SYS_ABORT 9 /* sys_abort() */
# define SYS_TRACE 13 /* sys_trace(req,pid,addr,data) */
-# define SYS_SIGNALRM 15 /* sys_signalrm(proc_nr, ticks) */
-# define SYS_SYNCALRM 16 /* sys_syncalrm(proc_nr,exp_time,abs_time) */
+# define SYS_SETALARM 16 /* sys_setalarm(proc_nr,exp_time,abs_time) */
# define SYS_PHYSVCOPY 18 /* sys_physvcopy(vec_ptr, vec_size) */
# define SYS_SVRCTL 19 /* sys_svrctl(proc_nr, req, argp) */
# define SYS_VDEVIO 24 /* sys_vdevio(buf_ptr, nr_ports) */
# define SYS_IRQCTL 25 /* sys_irqctl() */
-# define SYS_IOPENABLE 27 /* sys_enable_iop() */
# define SYS_SEGCTL 28 /* sys_segctl(*idx, *seg, *off, phys, size) */
# define SYS_VIRCOPY 30 /* sys_vircopy(src,seg,addr,dst,seg,addr,cnt) */
# define SYS_PHYSCOPY 31 /* sys_physcopy(src_addr,dst_addr,count) */
# define SYS_VIRVCOPY 32 /* sys_virvcopy(vec_ptr, vec_size) */
-# define SYS_PHYSZERO 33 /* sys_physzero(addr,count) */
-# define SYS_SETPRIORITY 34 /* sys_setpriority(which,who,prio) */
+# define SYS_MEMSET 33 /* sys_memset(char, addr, count) */
+# define SYS_SETPRIORITY 34 /* sys_setpriority(who,prio) */
#define NR_SYS_CALLS 35 /* number of system calls */
-/* Field names for SYS_SEGCTL. */
+/* Field names for SYS_MEMSET, SYS_SEGCTL. */
+#define MEM_PTR m1_p1 /* base */
+#define MEM_COUNT m1_i1 /* count */
+#define MEM_CHAR m1_i2 /* char to write */
#define MEM_CHUNK_BASE m4_l1 /* physical base address */
#define MEM_CHUNK_SIZE m4_l2 /* size of mem chunk */
#define MEM_TOT_SIZE m4_l3 /* total memory size */
#define MEM_CHUNK_TAG m4_l4 /* tag to identify chunk of mem */
+
/* Field names for SYS_DEVIO, SYS_VDEVIO, SYS_SDEVIO. */
#define DIO_REQUEST m2_i3 /* device in or output */
# define DIO_INPUT 0 /* input */
# define GET_KENV 5 /* get kernel environment string */
# define GET_IRQHOOKS 6 /* get the IRQ table */
# define GET_KMESSAGES 7 /* get kernel messages */
-
+# define GET_PRIVTAB 8 /* get kernel privileges table */
# define GET_KADDRESSES 9 /* get various kernel addresses */
# define GET_SCHEDINFO 10 /* get scheduling queues */
# define GET_PROC 11 /* get process slot if given process */
#define SIG_MAP m2_l1 /* used by kernel to pass signal bit map */
#define SIG_CTXT_PTR m2_p1 /* pointer to info to restore signal context */
-/* Field names for SYS_FORK, _EXEC, _XIT, _GETSP, _GETMAP, _NEWMAP */
+/* Field names for SYS_FORK, _EXEC, _EXIT, _NEWMAP. */
#define PR_PROC_NR m1_i1 /* indicates a (child) process */
+#define PR_PRIORITY m1_i2 /* process priority */
#define PR_PPROC_NR m1_i2 /* indicates a (parent) process */
#define PR_PID m1_i3 /* process id at process manager */
#define PR_STACK_PTR m1_p1 /* used for stack ptr in sys_exec, sys_getsp */
#define PR_IP_PTR m1_p3 /* initial value for ip after exec */
#define PR_MEM_PTR m1_p1 /* tells where memory map is for sys_newmap */
-/* Field names for SYS_PHYSZERO */
-#define PZ_MEM_PTR m1_p1 /* base */
-#define PZ_COUNT m1_i1 /* count */
-
/* Field names for SELECT (FS). */
#define SEL_NFDS m8_i1
#define SEL_READFDS m8_p1
/* Miscellaneous request types and field names, e.g. used by IS server. */
#define PANIC_DUMPS 97 /* debug dumps at the TTY on RBT_PANIC */
#define FKEY_CONTROL 98 /* control a function key at the TTY */
-#define FKEY_PRESSED 99 /* notify process of function key event */
# define FKEY_REQUEST m2_i1 /* request to perform at TTY */
# define FKEY_MAP 10 /* observe function key */
# define FKEY_UNMAP 11 /* stop observing function key */
#define _PTR_SIZE _EM_WSIZE
#endif
-/* Number of slots in the process table for non-kernel processes. */
+/* Number of slots in the process table for non-kernel processes. The number
+ * of system processes defines how many processes with special privileges
+ * there can be. User processes share the same properties and count for one.
+ */
#define NR_PROCS 64
+#define NR_SYS_PROCS 32
/* The buffer cache should be made as large as you can afford. */
#if (MACHINE == IBM_PC && _WORD_SIZE == 2)
/* Enable or disable swapping processes to disk. */
#define ENABLE_SWAP 1
-/* Enable or disable kernel calls (allows for minimal kernel). */
-#define ENABLE_K_DEBUGGING 0 /* kernel debugging calls */
-#define ENABLE_K_LOCKCHECK 0 /* kernel lock() sanity check */
-
/* Include or exclude an image of /dev/boot in the boot image. */
#define ENABLE_BOOTDEV 0
#define ENABLE_BINCOMPAT 0 /* for binaries using obsolete calls */
#define ENABLE_SRCCOMPAT 0 /* for sources using obsolete calls */
-/* Include or exclude security sensitive code, i.e., enable or disable certain
- * code sections that would allow special priviliges to user-level processes.
- */
-#define ENABLE_USERPRIV 1 /* allow special user mode privileges */
-
-/* User mode privileges. Be careful to set these security related features.
- * USERBIOS allows user processes to perform INT86, GLDT86, and SLDT86 MIOC
- * calls; USERIOPL set the CPU's I/O Protection Level bits so that user
- * processes can access I/O on opening /dev/mem/ or /dev/kmem/. In normal
- * operation, only the kernel should be trusted to do all this. Note that
- * ENABLE_USERPRIV must be set to 1 to allow the features anyway.
- */
-#define ENABLE_USERBIOS 0 /* enable user mode BIOS calls */
-#define ENABLE_USERIOPL 0 /* enable CPU's IOPL bits for /dev/(k)mem */
-
-#define PRINTF_PROC IS_PROC_NR
+/* Which process should receive diagnostics from the kernel and system? */
+#define PRINTF_PROC TTY
/* NR_CONS, NR_RS_LINES, and NR_PTYS determine the number of terminals the
* system can handle.
#define NR_RS_LINES 0 /* # rs232 terminals (0 to 4) */
#define NR_PTYS 32 /* # pseudo terminals (0 to 64) */
-/* these timing functions use quite a bit more kernel memory to hold
- * timing data.
- */
-#define ENABLE_INT_TIMING 0
-#define ENABLE_LOCK_TIMING 0
-
-#if ENABLE_LOCK_TIMING
-#define TIMING_POINTS 20
-#define TIMING_CATEGORIES 20
-#define TIMING_NAME 10
-#endif
/*===========================================================================*
* There are no user-settable parameters after this line *
#define SUPER_USER (uid_t) 0 /* uid_t of superuser */
+/* Devices. */
#define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */
#define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */
#define NR_IOREQS MIN(NR_BUFS, 64)
/* maximum number of entries in an iorequest */
+/* Message passing constants. */
+#define MESS_SIZE (sizeof(message)) /* might need usizeof from FS here */
+#define NIL_MESS ((message *) 0) /* null pointer */
+
+/* Memory related constants. */
#define SEGMENT_TYPE 0xFF00 /* bit mask to get segment type */
#define SEGMENT_INDEX 0x00FF /* bit mask to get segment index */
/* Hide names to avoid name space pollution. */
#define echo _echo
+#define alert _alert
#define sendrec _sendrec
#define receive _receive
#define send _send
#define nb_send _nb_send
_PROTOTYPE( int echo, (message *m_ptr) );
+_PROTOTYPE( int alert, (int dest) );
_PROTOTYPE( int sendrec, (int src_dest, message *m_ptr) );
_PROTOTYPE( int receive, (int src, message *m_ptr) );
_PROTOTYPE( int send, (int dest, message *m_ptr) );
-/* Prototypes for system library functions.
- *
- * Changes:
- * Nov 15, 2004 unified sys_sigctl calls (Jorrit N. Herder)
- * Oct 28, 2004 added nb_send, nb_receive (Jorrit N. Herder)
- * Oct 26, 2004 added sys_sdevio (Jorrit N. Herder)
- * Oct 18, 2004 added sys_irqctl (Jorrit N. Herder)
- * Oct 10, 2004 removed sys_findproc (Jorrit N. Herder)
- * Sep 23, 2004 added sys_getsig (Jorrit N. Herder)
- * Sep 09, 2004 added sys_physcopy, sys_vircopy (Jorrit N. Herder)
- * Aug 15, 2004 added sys_getinfo (Jorrit N. Herder)
- * Jul 23, 2004 added sys_umap (Jorrit N. Herder)
- * Jul 13, 2004 added sys_enable_iop, sys_segctl (Jorrit N. Herder)
- * Mar 20, 2004 added sys_devio, sys_vdevio (Jorrit N. Herder)
- */
+/* Prototypes for system library functions. */
#ifndef _SYSLIB_H
#define _SYSLIB_H
#include <minix/devio.h>
#endif
+#define SYSTASK SYSTEM
/*==========================================================================*
* Minix system library. *
*==========================================================================*/
-_PROTOTYPE( int printf, (const char *fmt, ...) );
-_PROTOTYPE( void kputc, (int c) );
_PROTOTYPE( int _taskcall, (int who, int syscallnr, message *msgptr) );
_PROTOTYPE( int sys_abort, (int how, ...) );
-_PROTOTYPE( int sys_adjmap, (int proc, struct mem_map *ptr,
- vir_clicks data_clicks, vir_clicks sp) );
_PROTOTYPE( int sys_exec, (int proc, char *ptr, int traced,
char *aout, vir_bytes initpc) );
-_PROTOTYPE( int sys_execmap, (int proc, struct mem_map *ptr) );
_PROTOTYPE( int sys_fork, (int parent, int child, int pid) );
-_PROTOTYPE( int sys_getsp, (int proc, vir_bytes *newsp) );
_PROTOTYPE( int sys_newmap, (int proc, struct mem_map *ptr) );
-_PROTOTYPE( int sys_getmap, (int proc, struct mem_map *ptr) );
-_PROTOTYPE( int sys_times, (int proc_nr, clock_t *ptr) );
-_PROTOTYPE( int sys_getuptime, (clock_t *ticks) );
+_PROTOTYPE( int sys_exit, (int proc) );
_PROTOTYPE( int sys_trace, (int req, int proc, long addr, long *data_p) );
-_PROTOTYPE( int sys_setpriority, (int proc, int prio) );
-
-/* A system server can directly exit itself with the sys_xit call. The
- * status argument is here to resemble exit(2), but not passed to kernel.
- */
-#define sys_exit(status) sys_xit(SELF)
-_PROTOTYPE( int sys_xit, (int proc) );
_PROTOTYPE( int sys_svrctl, (int proc, int req, int priv,vir_bytes argp));
+_PROTOTYPE( int sys_setpriority, (int proc, int prio) );
/* Shorthands for sys_sdevio() system call. */
_PROTOTYPE( int sys_sdevio, (int req, long port, int type, int proc_nr,
void *buffer, int count) );
-/* Clock functionality: (un)schedule an alarm call. */
-_PROTOTYPE(int sys_flagalrm, (clock_t ticks, int *flag_ptr) );
-_PROTOTYPE(int sys_signalrm, (int proc_nr, clock_t *ticks) );
-_PROTOTYPE(int sys_syncalrm, (int proc_nr, clock_t exp_time, int abs_time) );
+/* Clock functionality: get system times or (un)schedule an alarm call. */
+_PROTOTYPE( int sys_times, (int proc_nr, clock_t *ptr) );
+#define sys_syncalrm sys_setalarm
+_PROTOTYPE(int sys_setalarm, (int proc_nr, clock_t exp_time, int abs_time) );
/* Shorthands for sys_irqctl() system call. */
#define sys_irqdisable(hook_id) \
sys_physcopy(NONE, PHYS_SEG, src_phys, NONE, PHYS_SEG, dst_phys, bytes)
_PROTOTYPE(int sys_physcopy, (int src_proc, int src_seg, vir_bytes src_vir,
int dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes) );
-_PROTOTYPE(int sys_physzero, (phys_bytes base, phys_bytes bytes) );
+_PROTOTYPE(int sys_memset, (char c, phys_bytes base, phys_bytes bytes) );
_PROTOTYPE(int sys_umap, (int proc_nr, int seg, vir_bytes vir_addr,
vir_bytes bytes, phys_bytes *phys_addr) );
_PROTOTYPE(int sys_segctl, (int *index, u16_t *seg, vir_bytes *off,
phys_bytes phys, vir_bytes size));
-_PROTOTYPE(int sys_enable_iop, (int proc_nr) );
/* Shorthands for sys_getinfo() system call. */
#define sys_getkmessages(dst) sys_getinfo(GET_KMESSAGES, dst, 0,0,0)
#define sys_getkinfo(dst) sys_getinfo(GET_KINFO, dst, 0,0,0)
#define sys_getmachine(dst) sys_getinfo(GET_MACHINE, dst, 0,0,0)
#define sys_getproctab(dst) sys_getinfo(GET_PROCTAB, dst, 0,0,0)
+#define sys_getprivtab(dst) sys_getinfo(GET_PRIVTAB, dst, 0,0,0)
#define sys_getproc(dst,nr) sys_getinfo(GET_PROC, dst, 0,0, nr)
#define sys_getrandomness(dst) sys_getinfo(GET_RANDOMNESS, dst, 0,0,0)
#define sys_getimage(dst) sys_getinfo(GET_IMAGE, dst, 0,0,0)
_PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len,
void *key_ptr, int key_len) );
-
/* Signal control. */
_PROTOTYPE(int sys_kill, (int proc, int sig) );
_PROTOTYPE(int sys_sigsend, (int proc_nr, struct sigmsg *sig_ctxt) );
_PROTOTYPE(int sys_sigreturn, (int proc_nr, struct sigmsg *sig_ctxt, int flags) );
-_PROTOTYPE(int sys_getsig, (int *k_proc_nr, sigset_t *k_sig_map) );
-_PROTOTYPE(int sys_endsig, (int proc_nr) );
+_PROTOTYPE(int sys_getksig, (int *k_proc_nr, sigset_t *k_sig_map) );
+_PROTOTYPE(int sys_endksig, (int proc_nr) );
/* NOTE: two different approaches were used to distinguish the device I/O
* types 'byte', 'word', 'long': the latter uses #define and results in a
#endif
/* Type definitions. */
-typedef unsigned int vir_clicks; /* virtual addresses and lengths in clicks */
-typedef unsigned long phys_bytes;/* physical addresses and lengths in bytes */
-typedef unsigned int phys_clicks;/* physical addresses and lengths in clicks */
+typedef unsigned int vir_clicks; /* virtual addr/length in clicks */
+typedef unsigned long phys_bytes; /* physical addr/length in bytes */
+typedef unsigned int phys_clicks; /* physical addr/length in clicks */
#if (CHIP == INTEL)
typedef unsigned int vir_bytes; /* virtual addresses and lengths in bytes */
} iovec_t;
-/* MM passes the address of a structure of this type to KERNEL when
- * do_sendsig() is invoked as part of the signal catching mechanism.
+/* PM passes the address of a structure of this type to KERNEL when
+ * sys_sendsig() is invoked as part of the signal catching mechanism.
* The structure contain all the information that KERNEL needs to build
* the signal stack.
*/
vir_bytes sm_stkptr; /* user stack pointer */
};
-#define MESS_SIZE (sizeof(message)) /* might need usizeof from fs here */
-#define NIL_MESS ((message *) 0)
-
/* This is used to obtain system information through SYS_GETINFO. */
struct kinfo {
phys_bytes code_base; /* base of kernel code */
int nr_tasks; /* number of kernel tasks */
char release[4]; /* kernel release number */
char version[4]; /* kernel version number */
-#if ENABLE_K_LOCKCHECK
- int relocking;
-#endif
+ int relocking; /* relocking check (for debugging) */
};
struct machine {
int vdu_vga;
};
-/* Timing data of lock()/unlock() sequences, if selected to be compiled in. */
-
-#if ENABLE_LOCK_TIMING
-struct lock_timedata {
- char names[TIMING_NAME];
- unsigned long lock_timings[TIMING_POINTS];
- unsigned long lock_timings_range[2];
- unsigned long binsize, resets, misses, measurements;
-};
-#endif
-
#endif /* _TYPE_H */
/* These definitions can be used to initialize a timer variable and to set
* the timer's argument before passing it to tmrs_settimer.
*/
-#define tmr_inittimer(tp) (void)((tp)->tmr_exp_time = TMR_NEVER)
+#define tmr_inittimer(tp) (void)((tp)->tmr_exp_time = TMR_NEVER, \
+ (tp)->tmr_next = NULL)
#define tmr_arg(tp) (&(tp)->tmr_arg)
+#define tmr_exp_time(tp) (&(tp)->tmr_exp_time)
/* The following generic timer management functions are available. They