From 0129d98ae1fc862bea7d16ec0d180a001883e329 Mon Sep 17 00:00:00 2001 From: Jorrit Herder Date: Tue, 19 Jul 2005 12:24:51 +0000 Subject: [PATCH] Added new signal types for kernel events: - SIGKMESS: new kernel message (sent to TTY, IS, or LOG) - SIGKSTOP: MINIX is shut down (sent to TTY-> switch to primary console) - SIGKSIG: kernel signals pending (sent to PM) Renamed SYS_SETPRIORITY to SYS_NICE. --- drivers/memory/.depend | 0 include/minix/com.h | 17 ++++++++--------- include/minix/config.h | 2 -- include/minix/syslib.h | 4 ++-- include/signal.h | 11 ++++++++++- lib/syslib/Makefile | 6 +++--- lib/syslib/sys_getinfo.c | 18 +++++++++--------- lib/syslib/{sys_setpriority.c => sys_nice.c} | 6 +++--- 8 files changed, 35 insertions(+), 29 deletions(-) delete mode 100644 drivers/memory/.depend rename lib/syslib/{sys_setpriority.c => sys_nice.c} (60%) diff --git a/drivers/memory/.depend b/drivers/memory/.depend deleted file mode 100644 index e69de29bb..000000000 diff --git a/include/minix/com.h b/include/minix/com.h index d7ed6656c..33d09e71f 100755 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -64,12 +64,11 @@ * offset are used for the per-process notification bit maps. */ #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 SYN_ALARM NOTIFY_FROM(CLOCK) /* synchronous alarm */ +# define SYS_EVENT NOTIFY_FROM(SYSTEM) /* signal system event */ +# define HARD_INT NOTIFY_FROM(HARDWARE) /* hardware interrupt */ +# 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 */ @@ -239,7 +238,7 @@ # define SYS_PHYSCOPY 31 /* sys_physcopy(src_addr,dst_addr,count) */ # define SYS_VIRVCOPY 32 /* sys_virvcopy(vec_ptr, vec_size) */ # define SYS_MEMSET 33 /* sys_memset(char, addr, count) */ -# define SYS_SETPRIORITY 34 /* sys_setpriority(who,prio) */ +# define SYS_NICE 34 /* sys_nice(who,prio) */ #define NR_SYS_CALLS 35 /* number of system calls */ /* Field names for SYS_MEMSET, SYS_SEGCTL. */ @@ -344,8 +343,8 @@ #define I_PROC_NR m7_i4 /* calling process */ #define I_VAL_PTR m7_p1 /* virtual address at caller */ #define I_VAL_LEN m7_i1 /* max length of value */ -#define I_KEY_PTR m7_p2 /* virtual address of key to lookup */ -#define I_KEY_LEN m7_i2 /* length of key to lookup */ +#define I_VAL_PTR2 m7_p2 /* second virtual address */ +#define I_VAL_LEN2 m7_i2 /* second length, or proc nr */ /* Field names for SYS_TIMES. */ #define T_PROC_NR m4_l1 /* process to request time info for */ diff --git a/include/minix/config.h b/include/minix/config.h index 2786d4dc9..deae4289b 100755 --- a/include/minix/config.h +++ b/include/minix/config.h @@ -56,8 +56,6 @@ /* Defines for driver and kernel configuration. */ #define AUTO_BIOS 0 /* xt_wini.c - use Western's autoconfig BIOS */ #define LINEWRAP 1 /* console.c - wrap lines at column 80 */ -#define ALLOW_GAP_MESSAGES 1 /* proc.c - allow messages in the gap between - * the end of bss and lowest stack address */ /* Number of controller tasks (/dev/cN device classes). */ #define NR_CTRLRS 2 diff --git a/include/minix/syslib.h b/include/minix/syslib.h index ef1e46a2e..20b11920d 100755 --- a/include/minix/syslib.h +++ b/include/minix/syslib.h @@ -31,7 +31,7 @@ _PROTOTYPE( int sys_exit, (int proc) ); _PROTOTYPE( int sys_trace, (int req, int proc, long addr, long *data_p) ); _PROTOTYPE( int sys_svrctl, (int proc, int req, int priv,vir_bytes argp)); -_PROTOTYPE( int sys_setpriority, (int proc, int prio) ); +_PROTOTYPE( int sys_nice, (int proc, int prio) ); /* Shorthands for sys_sdevio() system call. */ @@ -102,7 +102,7 @@ _PROTOTYPE(int sys_segctl, (int *index, u16_t *seg, vir_bytes *off, #define sys_getschedinfo(v1,v2) sys_getinfo(GET_SCHEDINFO, v1,0, v2,0) #define sys_getlocktimings(dst) sys_getinfo(GET_LOCKTIMING, dst, 0,0,0) _PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len, - void *key_ptr, int key_len) ); + void *val_ptr2, int val_len2) ); /* Signal control. */ _PROTOTYPE(int sys_kill, (int proc, int sig) ); diff --git a/include/signal.h b/include/signal.h index d5588956b..405320b16 100755 --- a/include/signal.h +++ b/include/signal.h @@ -25,7 +25,7 @@ typedef unsigned long sigset_t; #endif #endif -#define _NSIG 17 /* number of signals used */ +#define _NSIG 20 /* number of signals used */ #define SIGHUP 1 /* hangup */ #define SIGINT 2 /* interrupt (DEL) */ @@ -48,6 +48,13 @@ typedef unsigned long sigset_t; #define SIGEMT 7 /* obsolete */ #define SIGBUS 10 /* obsolete */ +/* MINIX specific signals. These signals are not used by user proceses, + * but meant to inform system processes, like the PM, about system events. + */ +#define SIGKMESS 18 /* new kernel message */ +#define SIGKSIG 19 /* kernel signal pending */ +#define SIGKSTOP 20 /* kernel shutting down */ + /* POSIX requires the following signals to be defined, even if they are * not supported. Here are the definitions, but they are not supported. */ @@ -57,6 +64,7 @@ typedef unsigned long sigset_t; #define SIGTTIN 21 /* background process wants to read */ #define SIGTTOU 22 /* background process wants to write */ + /* The sighandler_t type is not allowed unless _POSIX_SOURCE is defined. */ typedef void _PROTOTYPE( (*__sighandler_t), (int) ); @@ -66,6 +74,7 @@ typedef void _PROTOTYPE( (*__sighandler_t), (int) ); #define SIG_IGN ((__sighandler_t) 1) /* ignore signal */ #define SIG_HOLD ((__sighandler_t) 2) /* block signal */ #define SIG_CATCH ((__sighandler_t) 3) /* catch signal */ +#define SIG_MESS ((__sighandler_t) 4) /* pass as message (MINIX) */ #ifdef _POSIX_SOURCE struct sigaction { diff --git a/lib/syslib/Makefile b/lib/syslib/Makefile index b5f097ad9..36c72a94d 100755 --- a/lib/syslib/Makefile +++ b/lib/syslib/Makefile @@ -27,7 +27,7 @@ OBJECTS = \ $(LIBSYS)(sys_getinfo.o) \ $(LIBSYS)(sys_irqctl.o) \ $(LIBSYS)(sys_segctl.o) \ - $(LIBSYS)(sys_setpriority.o) \ + $(LIBSYS)(sys_nice.o) \ $(LIBSYS)(sys_umap.o) \ $(LIBSYS)(sys_physcopy.o) \ $(LIBSYS)(sys_vircopy.o) \ @@ -89,8 +89,8 @@ $(LIBSYS)(sys_irqctl.o): sys_irqctl.c $(LIBSYS)(sys_eniop.o): sys_eniop.c $(CC1) sys_eniop.c -$(LIBSYS)(sys_setpriority.o): sys_setpriority.c - $(CC1) sys_setpriority.c +$(LIBSYS)(sys_nice.o): sys_nice.c + $(CC1) sys_nice.c $(LIBSYS)(sys_segctl.o): sys_segctl.c $(CC1) sys_segctl.c diff --git a/lib/syslib/sys_getinfo.c b/lib/syslib/sys_getinfo.c index e033d420a..f0f46757d 100644 --- a/lib/syslib/sys_getinfo.c +++ b/lib/syslib/sys_getinfo.c @@ -3,21 +3,21 @@ /*===========================================================================* * sys_getinfo * *===========================================================================*/ -PUBLIC int sys_getinfo(request, val_ptr, val_len, key_ptr, key_len) +PUBLIC int sys_getinfo(request, ptr, len, ptr2, len2) int request; /* system info requested */ -void *val_ptr; /* pointer where to store it */ -int val_len; /* max length of value to get */ -void *key_ptr; /* pointer to key requested */ -int key_len; /* length of key */ +void *ptr; /* pointer where to store it */ +int len; /* max length of value to get */ +void *ptr2; /* second pointer */ +int len2; /* length or process nr */ { message m; m.I_REQUEST = request; m.I_PROC_NR = SELF; /* always store values at caller */ - m.I_VAL_PTR = val_ptr; - m.I_VAL_LEN = val_len; - m.I_KEY_PTR = key_ptr; - m.I_KEY_LEN = key_len; + m.I_VAL_PTR = ptr; + m.I_VAL_LEN = len; + m.I_VAL_PTR2 = ptr2; + m.I_VAL_LEN2 = len2; return(_taskcall(SYSTASK, SYS_GETINFO, &m)); } diff --git a/lib/syslib/sys_setpriority.c b/lib/syslib/sys_nice.c similarity index 60% rename from lib/syslib/sys_setpriority.c rename to lib/syslib/sys_nice.c index 942d7c772..5cab55e44 100755 --- a/lib/syslib/sys_setpriority.c +++ b/lib/syslib/sys_nice.c @@ -1,13 +1,13 @@ #include "syslib.h" /*===========================================================================* - * sys_xit * + * sys_nice * *===========================================================================*/ -PUBLIC int sys_setpriority(int proc, int prio) +PUBLIC int sys_nice(int proc, int prio) { message m; m.m1_i1 = proc; m.m1_i2 = prio; - return(_taskcall(SYSTASK, SYS_SETPRIORITY, &m)); + return(_taskcall(SYSTASK, SYS_NICE, &m)); } -- 2.44.0