Kernel: make SIGKMESS target process list dynamic

The set of processes to which a SIGKMESS signal is sent whenever new
diagnostics messages are added to the kernel's message buffer, is now
no longer hardcoded. Instead, processes can (un)register themselves
to receive such notifications, by means of sys_diagctl().

Change-Id: I9d6ac006a5d9bbfad2757587a068fc1ec3cc083e
This commit is contained in:
David van Moolenbroek
2014-03-01 09:04:54 +01:00
committed by sambuc
parent de975579a4
commit 8fea5ab8bd
16 changed files with 65 additions and 34 deletions
+2
View File
@@ -589,6 +589,8 @@
#define DIAGCTL_ARG2 m1_i2
#define DIAGCTL_CODE_DIAG 1 /* Print diagnostics. */
#define DIAGCTL_CODE_STACKTRACE 2 /* Print process stack. */
#define DIAGCTL_CODE_REGISTER 3 /* Register for diagnostic signals */
#define DIAGCTL_CODE_UNREGISTER 4 /* Unregister for diagnostic signals */
#define DIAG_BUFSIZE (80*25)
/* Field names for SYS_VTIMER. */
-11
View File
@@ -35,17 +35,6 @@
/* DMA_SECTORS may be increased to speed up DMA based drivers. */
#define DMA_SECTORS 1 /* DMA buffer size (must be >= 1) */
/* Which processes should receive diagnostics from the kernel and system?
* Directly sending it to TTY only displays the output. Sending it to the
* log driver will cause the diagnostics to be buffered and displayed.
* Messages are sent by src/lib/sysutil/kputc.c to these processes, in
* the order of this array, which must be terminated by NONE. This is used
* by drivers and servers that printf().
* The kernel does this for its own kprintf() in kernel/utility.c, also using
* this array, but a slightly different mechanism.
*/
#define OUTPUT_PROCS_ARRAY { TTY_PROC_NR, LOG_PROC_NR, NONE }
/* NR_CONS, NR_RS_LINES, and NR_PTYS determine the number of terminals the
* system can handle.
*/
+11 -2
View File
@@ -69,8 +69,6 @@ int sys_vmctl_enable_paging(void * data);
int sys_readbios(phys_bytes address, void *buf, size_t size);
int sys_settime(int now, clockid_t clk_id, time_t sec, long nsec);
int sys_stime(time_t boottime);
int sys_diagctl(int ctl, char *arg1, int arg2);
int sys_diagctl_stacktrace(endpoint_t who);
int sys_vmctl_get_mapping(int index, phys_bytes *addr, phys_bytes *len,
int *flags);
int sys_vmctl_reply_mapping(int index, vir_bytes addr);
@@ -159,6 +157,17 @@ int sys_umap_data_fb(endpoint_t proc_ep, vir_bytes vir_addr, vir_bytes
int sys_umap_remote(endpoint_t proc_ep, endpoint_t grantee, int seg,
vir_bytes vir_addr, vir_bytes bytes, phys_bytes *phys_addr);
/* Shorthands for sys_diagctl() system call. */
#define sys_diagctl_diag(buf,len) \
sys_diagctl(DIAGCTL_CODE_DIAG, buf, len)
#define sys_diagctl_stacktrace(ep) \
sys_diagctl(DIAGCTL_CODE_STACKTRACE, NULL, ep)
#define sys_diagctl_register() \
sys_diagctl(DIAGCTL_CODE_REGISTER, NULL, 0)
#define sys_diagctl_unregister() \
sys_diagctl(DIAGCTL_CODE_UNREGISTER, NULL, 0)
int sys_diagctl(int ctl, char *arg1, int arg2);
/* Shorthands for sys_getinfo() system call. */
#define sys_getkinfo(dst) sys_getinfo(GET_KINFO, dst, 0,0,0)
#define sys_getloadinfo(dst) sys_getinfo(GET_LOADINFO, dst, 0,0,0)