New RS and new signal handling for system processes.

UPDATING INFO:
20100317:
        /usr/src/etc/system.conf updated to ignore default kernel calls: copy
        it (or merge it) to /etc/system.conf.
        The hello driver (/dev/hello) added to the distribution:
        # cd /usr/src/commands/scripts && make clean install
        # cd /dev && MAKEDEV hello

KERNEL CHANGES:
- Generic signal handling support. The kernel no longer assumes PM as a signal
manager for every process. The signal manager of a given process can now be
specified in its privilege slot. When a signal has to be delivered, the kernel
performs the lookup and forwards the signal to the appropriate signal manager.
PM is the default signal manager for user processes, RS is the default signal
manager for system processes. To enable ptrace()ing for system processes, it
is sufficient to change the default signal manager to PM. This will temporarily
disable crash recovery, though.
- sys_exit() is now split into sys_exit() (i.e. exit() for system processes,
which generates a self-termination signal), and sys_clear() (i.e. used by PM
to ask the kernel to clear a process slot when a process exits).
- Added a new kernel call (i.e. sys_update()) to swap two process slots and
implement live update.

PM CHANGES:
- Posix signal handling is no longer allowed for system processes. System
signals are split into two fixed categories: termination and non-termination
signals. When a non-termination signaled is processed, PM transforms the signal
into an IPC message and delivers the message to the system process. When a
termination signal is processed, PM terminates the process.
- PM no longer assumes itself as the signal manager for system processes. It now
makes sure that every system signal goes through the kernel before being
actually processes. The kernel will then dispatch the signal to the appropriate
signal manager which may or may not be PM.

SYSLIB CHANGES:
- Simplified SEF init and LU callbacks.
- Added additional predefined SEF callbacks to debug crash recovery and
live update.
- Fixed a temporary ack in the SEF init protocol. SEF init reply is now
completely synchronous.
- Added SEF signal event type to provide a uniform interface for system
processes to deal with signals. A sef_cb_signal_handler() callback is
available for system processes to handle every received signal. A
sef_cb_signal_manager() callback is used by signal managers to process
system signals on behalf of the kernel.
- Fixed a few bugs with memory mapping and DS.

VM CHANGES:
- Page faults and memory requests coming from the kernel are now implemented
using signals.
- Added a new VM call to swap two process slots and implement live update.
- The call is used by RS at update time and in turn invokes the kernel call
sys_update().

RS CHANGES:
- RS has been reworked with a better functional decomposition.
- Better kernel call masks. com.h now defines the set of very basic kernel calls
every system service is allowed to use. This makes system.conf simpler and
easier to maintain. In addition, this guarantees a higher level of isolation
for system libraries that use one or more kernel calls internally (e.g. printf).
- RS is the default signal manager for system processes. By default, RS
intercepts every signal delivered to every system process. This makes crash
recovery possible before bringing PM and friends in the loop.
- RS now supports fast rollback when something goes wrong while initializing
the new version during a live update.
- Live update is now implemented by keeping the two versions side-by-side and
swapping the process slots when the old version is ready to update.
- Crash recovery is now implemented by keeping the two versions side-by-side
and cleaning up the old version only when the recovery process is complete.

DS CHANGES:
- Fixed a bug when the process doing ds_publish() or ds_delete() is not known
by DS.
- Fixed the completely broken support for strings. String publishing is now
implemented in the system library and simply wraps publishing of memory ranges.
Ideally, we should adopt a similar approach for other data types as well.
- Test suite fixed.

DRIVER CHANGES:
- The hello driver has been added to the Minix distribution to demonstrate basic
live update and crash recovery functionalities.
- Other drivers have been adapted to conform the new SEF interface.
This commit is contained in:
Cristiano Giuffrida
2010-03-17 01:15:29 +00:00
parent 7685e98304
commit cb176df60f
148 changed files with 4600 additions and 3308 deletions

View File

@@ -74,7 +74,7 @@ extern int errno; /* place where the error numbers go */
#define ENOSYS (_SIGN 38) /* function not implemented */
#define ENOTEMPTY (_SIGN 39) /* directory not empty */
#define ELOOP (_SIGN 40) /* too many levels of symlinks detected */
#define ERESTART (_SIGN 41) /* driver restarted */
#define ERESTART (_SIGN 41) /* service restarted */
#define EIDRM (_SIGN 43) /* Identifier removed */
#define EILSEQ (_SIGN 44) /* illegal byte sequence */

View File

@@ -1,4 +1,4 @@
#define NCALLS 111 /* number of system calls allowed */
#define NCALLS 112 /* number of system calls allowed */
#define EXIT 1
#define FORK 2
@@ -93,7 +93,7 @@
#define EXEC_NEWMEM 100 /* from FS or RS to PM: new memory map for
* exec
*/
#define FORK_NB 101 /* to PM: special fork call for RS */
#define SRV_FORK 101 /* to PM: special fork call for RS */
#define EXEC_RESTART 102 /* to PM: final part of exec for RS */
#define PROCSTAT 103 /* to PM */
#define GETPROCNR 104 /* to PM */
@@ -109,6 +109,7 @@
* that should not be used for bus-master DMA
* any longer
*/
#define SRV_KILL 111 /* to PM: special kill call for RS */
#define TASK_REPLY 121 /* to FS: reply code from drivers, not
* really a standalone call.

View File

@@ -19,6 +19,7 @@
* 0xB00 - 0xBFF Requests from VM to VFS
* 0xC00 - 0xCFF Virtual Memory (VM) requests
* 0xD00 - 0xDFF IPC server requests
* 0xE00 - 0xEFF Common system messages (e.g. system signals)
* 0x1000 - 0x10FF Notify messages
*
* Zero and negative values are widely used for OK and error responses.
@@ -305,7 +306,7 @@
# 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_CLEAR (KERNEL_CALL + 2) /* sys_clear() */
# define SYS_NICE (KERNEL_CALL + 3) /* sys_nice() */
# define SYS_PRIVCTL (KERNEL_CALL + 4) /* sys_privctl() */
# define SYS_TRACE (KERNEL_CALL + 5) /* sys_trace() */
@@ -358,9 +359,20 @@
# define SYS_GETMCONTEXT (KERNEL_CALL + 50) /* sys_getmcontext() */
# define SYS_SETMCONTEXT (KERNEL_CALL + 51) /* sys_setmcontext() */
#define NR_SYS_CALLS 52 /* number of system calls */
# define SYS_UPDATE (KERNEL_CALL + 52) /* sys_update() */
# define SYS_EXIT (KERNEL_CALL + 53) /* sys_exit() */
/* Total */
#define NR_SYS_CALLS 54 /* number of system calls */
#define SYS_CALL_MASK_SIZE BITMAP_CHUNKS(NR_SYS_CALLS)
/* Basic kernel calls allowed to every system process. */
#define SYS_BASIC_CALLS \
SYS_EXIT, SYS_SAFECOPYFROM, SYS_SAFECOPYTO, SYS_VSAFECOPY, SYS_GETINFO, \
SYS_TIMES, SYS_SETALARM, SYS_SETGRANT, SYS_SAFEMAP, SYS_SAFEREVMAP, \
SYS_SAFEUNMAP, SYS_PROFBUF, SYS_SYSCTL
/* Field names for SYS_MEMSET. */
#define MEM_PTR m2_p1 /* base */
#define MEM_COUNT m2_l1 /* count */
@@ -631,6 +643,10 @@
#define RC_FLAGS m1_i3 /* request flags */
# define RC_DELAY 1 /* delay stop if process is sending */
/* Field names for SYS_UPDATE. */
#define SYS_UPD_SRC_ENDPT m1_i1 /* source endpoint */
#define SYS_UPD_DST_ENDPT m1_i2 /* destination endpoint */
/*===========================================================================*
* Messages for the Reincarnation Server *
*===========================================================================*/
@@ -689,7 +705,6 @@
# define DS_VAL m2_l1 /* data (u32, char *, etc.) */
# define DS_VAL_LEN m2_l2 /* data length */
# define DS_NR_SNAPSHOT m2_i3 /* number of snapshot */
# define DS_STRING m2_i3 /* inline string */
/*===========================================================================*
* Miscellaneous messages used by TTY *
@@ -732,7 +747,7 @@
#define PM_DUMPCORE (PM_RQ_BASE + 5) /* Process is to dump core */
#define PM_EXEC (PM_RQ_BASE + 6) /* Forwarded exec call */
#define PM_FORK (PM_RQ_BASE + 7) /* Newly forked process */
#define PM_FORK_NB (PM_RQ_BASE + 8) /* Non-blocking fork */
#define PM_SRV_FORK (PM_RQ_BASE + 8) /* fork for system services */
#define PM_UNPAUSE (PM_RQ_BASE + 9) /* Interrupt process call */
#define PM_REBOOT (PM_RQ_BASE + 10) /* System reboot */
#define PM_SETGROUPS (PM_RQ_BASE + 11) /* Tell VFS about setgroups */
@@ -745,7 +760,7 @@
#define PM_CORE_REPLY (PM_RS_BASE + 5)
#define PM_EXEC_REPLY (PM_RS_BASE + 6)
#define PM_FORK_REPLY (PM_RS_BASE + 7)
#define PM_FORK_NB_REPLY (PM_RS_BASE + 8)
#define PM_SRV_FORK_REPLY (PM_RS_BASE + 8)
#define PM_UNPAUSE_REPLY (PM_RS_BASE + 9)
#define PM_REBOOT_REPLY (PM_RS_BASE + 10)
#define PM_SETGROUPS_REPLY (PM_RS_BASE + 11)
@@ -755,7 +770,7 @@
/* Additional parameters for PM_INIT */
# define PM_SLOT m1_i2 /* process slot number */
# define PM_PID m2_i3 /* process pid */
# define PM_PID m1_i3 /* process pid */
/* Additional parameters for PM_SETUID and PM_SETGID */
# define PM_EID m1_i2 /* effective user/group id */
@@ -776,7 +791,7 @@
/* Additional parameters for PM_EXEC_REPLY and PM_CORE_REPLY */
# define PM_STATUS m1_i2 /* OK or failure */
/* Additional parameters for PM_FORK and PM_FORK_NB */
/* Additional parameters for PM_FORK and PM_SRV_FORK */
# define PM_PPROC m1_i2 /* parent process endpoint */
# define PM_CPID m1_i3 /* child pid */
@@ -813,6 +828,8 @@
* Miscellaneous field names *
*===========================================================================*/
#define COMMON_RQ_BASE 0xE00
/* PM field names */
/* BRK */
#define PMBRK_ADDR m1_p1
@@ -835,6 +852,10 @@
#define SEL_ERRORFDS m8_p3
#define SEL_TIMEOUT m8_p4
/* Field names for system signals (sent by a signal manager). */
#define SIGS_SIGNAL_RECEIVED (COMMON_RQ_BASE+0)
# define SIGS_SIG_NUM m2_i1
/*===========================================================================*
* Messages for VM server *
*===========================================================================*/
@@ -974,8 +995,12 @@
#define VMIW_USAGE 2
#define VMIW_REGION 3
#define VM_RS_UPDATE (VM_RQ_BASE+41)
# define VM_RS_SRC_ENDPT m1_i1
# define VM_RS_DST_ENDPT m1_i2
/* Total. */
#define NR_VM_CALLS 41
#define NR_VM_CALLS 42
#define VM_CALL_MASK_SIZE BITMAP_CHUNKS(NR_VM_CALLS)
/* Basic vm calls allowed to every process. */

View File

@@ -45,4 +45,6 @@ enum dev_style { STYLE_DEV, STYLE_NDEV, STYLE_TTY, STYLE_CLONE };
#define LOG_MAJOR 15 /* major device for log driver */
# define IS_KLOG_DEV 0 /* minor device for /dev/klog */
#define HELLO_MAJOR 17 /* major device for hello driver */
#endif /* _DMAP_H */

View File

@@ -29,7 +29,6 @@
/* DS constants. */
#define DS_MAX_KEYLEN 80 /* Max length of a key, including '\0'. */
#define DS_MAX_STRLEN 16 /* Max length of string, including '\0'. */
/* ds.c */

View File

@@ -22,7 +22,6 @@ Interface to the reincarnation server
#define RSS_REUSE 0x04 /* Try to reuse previously copied binary */
/* Common definitions. */
#define RS_SYS_CALL_MASK_SIZE 2
#define RS_NR_CONTROL 8
#define RS_NR_PCI_DEVICE 32
#define RS_NR_PCI_CLASS 4
@@ -55,7 +54,7 @@ struct rs_start
struct { u16_t vid; u16_t did; } rss_pci_id[RS_NR_PCI_DEVICE];
int rss_nr_pci_class;
struct { u32_t class; u32_t mask; } rss_pci_class[RS_NR_PCI_CLASS];
u32_t rss_system[RS_SYS_CALL_MASK_SIZE];
bitchunk_t rss_system[SYS_CALL_MASK_SIZE];
struct rss_label rss_label;
char *rss_ipc;
size_t rss_ipclen;

View File

@@ -4,6 +4,7 @@
#include <minix/sys_config.h>
#include <minix/types.h>
#include <minix/vm.h>
#include <stdint.h>
typedef struct {
@@ -47,13 +48,6 @@ struct vscp_vec {
size_t v_bytes; /* no. of bytes */
};
/* Types on VM invocation. */
#define VMPTYPE_NONE 0
#define VMPTYPE_CHECK 1
#define VMPTYPE_COWMAP 2
#define VMPTYPE_SMAP 3
#define VMPTYPE_SUNMAP 4
/* Invalid grant number. */
#define GRANT_INVALID ((cp_grant_id_t) -1)
#define GRANT_VALID(g) ((g) > GRANT_INVALID)

View File

@@ -8,6 +8,7 @@
/* SEF entry points for system processes. */
_PROTOTYPE( void sef_startup, (void) );
_PROTOTYPE( int sef_receive, (endpoint_t src, message *m_ptr) );
_PROTOTYPE( void sef_exit, (int status) );
/* SEF Debug. */
#include <stdio.h>
@@ -29,30 +30,27 @@ typedef struct {
} sef_init_info_t;
/* Callback type definitions. */
typedef int(*sef_cb_init_fresh_t)(int type, sef_init_info_t *info);
typedef int(*sef_cb_init_lu_t)(int type, sef_init_info_t *info);
typedef int(*sef_cb_init_restart_t)(int type, sef_init_info_t *info);
typedef int(*sef_cb_init_t)(int type, sef_init_info_t *info);
/* Callback registration helpers. */
_PROTOTYPE( void sef_setcb_init_fresh, (sef_cb_init_fresh_t cb));
_PROTOTYPE( void sef_setcb_init_lu, (sef_cb_init_lu_t cb));
_PROTOTYPE( void sef_setcb_init_restart, (sef_cb_init_restart_t cb));
_PROTOTYPE( void sef_setcb_init_fresh, (sef_cb_init_t cb));
_PROTOTYPE( void sef_setcb_init_lu, (sef_cb_init_t cb));
_PROTOTYPE( void sef_setcb_init_restart, (sef_cb_init_t cb));
/* Predefined callback implementations. */
_PROTOTYPE( int sef_cb_init_fresh_null, (int type, sef_init_info_t *info) );
_PROTOTYPE( int sef_cb_init_lu_null, (int type, sef_init_info_t *info) );
_PROTOTYPE( int sef_cb_init_restart_null, (int type, sef_init_info_t *info) );
_PROTOTYPE( int sef_cb_init_null, (int type, sef_init_info_t *info) );
_PROTOTYPE( int sef_cb_init_restart_fail, (int type, sef_init_info_t *info) );
_PROTOTYPE( int sef_cb_init_fail, (int type, sef_init_info_t *info) );
_PROTOTYPE( int sef_cb_init_crash, (int type, sef_init_info_t *info) );
/* Macros for predefined callback implementations. */
#define SEF_CB_INIT_FRESH_NULL sef_cb_init_fresh_null
#define SEF_CB_INIT_LU_NULL sef_cb_init_lu_null
#define SEF_CB_INIT_RESTART_NULL sef_cb_init_restart_null
#define SEF_CB_INIT_FRESH_NULL sef_cb_init_null
#define SEF_CB_INIT_LU_NULL sef_cb_init_null
#define SEF_CB_INIT_RESTART_NULL sef_cb_init_null
#define SEF_CB_INIT_FRESH_DEFAULT sef_cb_init_fresh_null
#define SEF_CB_INIT_LU_DEFAULT sef_cb_init_lu_null
#define SEF_CB_INIT_RESTART_DEFAULT sef_cb_init_restart_null
#define SEF_CB_INIT_FRESH_DEFAULT sef_cb_init_null
#define SEF_CB_INIT_LU_DEFAULT sef_cb_init_null
#define SEF_CB_INIT_RESTART_DEFAULT sef_cb_init_null
/* Init types. */
#define SEF_INIT_FRESH 0 /* init fresh */
@@ -79,15 +77,15 @@ _PROTOTYPE( int sef_cb_init_restart_fail, (int type, sef_init_info_t *info) );
&& (mp)->m_source == RS_PROC_NR)
/* Callback type definitions. */
typedef void(*sef_cb_ping_reply_t)(message *m_ptr);
typedef void(*sef_cb_ping_reply_t)(endpoint_t source);
/* Callback registration helpers. */
_PROTOTYPE( void sef_setcb_ping_reply, (sef_cb_ping_reply_t cb));
/* Predefined callback implementations. */
_PROTOTYPE( void sef_cb_ping_reply_null, (message *m_ptr) );
_PROTOTYPE( void sef_cb_ping_reply_null, (endpoint_t source) );
_PROTOTYPE( void sef_cb_ping_reply_pong, (message *m_ptr) );
_PROTOTYPE( void sef_cb_ping_reply_pong, (endpoint_t source) );
/* Macros for predefined callback implementations. */
#define SEF_CB_PING_REPLY_NULL sef_cb_ping_reply_null
@@ -113,31 +111,30 @@ _PROTOTYPE( void sef_cb_ping_reply_pong, (message *m_ptr) );
#define IS_SEF_LU_REQUEST(mp) ((mp)->m_type == RS_LU_PREPARE \
&& (mp)->m_source == RS_PROC_NR)
/* Global helpers. */
_PROTOTYPE( void sef_lu_ready, (int result) );
/* Callback type definitions. */
typedef void(*sef_cb_lu_prepare_t)(int);
typedef int(*sef_cb_lu_prepare_t)(int);
typedef int(*sef_cb_lu_state_isvalid_t)(int);
typedef void(*sef_cb_lu_state_changed_t)(int, int);
typedef void(*sef_cb_lu_state_dump_t)(int);
typedef int(*sef_cb_lu_ready_pre_t)(int);
typedef int(*sef_cb_lu_state_save_t)(int);
/* Callback registration helpers. */
_PROTOTYPE( void sef_setcb_lu_prepare, (sef_cb_lu_prepare_t cb) );
_PROTOTYPE( void sef_setcb_lu_state_isvalid, (sef_cb_lu_state_isvalid_t cb) );
_PROTOTYPE( void sef_setcb_lu_state_changed, (sef_cb_lu_state_changed_t cb) );
_PROTOTYPE( void sef_setcb_lu_state_dump, (sef_cb_lu_state_dump_t cb) );
_PROTOTYPE( void sef_setcb_lu_ready_pre, (sef_cb_lu_ready_pre_t cb) );
_PROTOTYPE( void sef_setcb_lu_state_save, (sef_cb_lu_state_save_t cb) );
/* Predefined callback implementations. */
_PROTOTYPE( void sef_cb_lu_prepare_null, (int state) );
_PROTOTYPE( int sef_cb_lu_prepare_null, (int state) );
_PROTOTYPE( int sef_cb_lu_state_isvalid_null, (int state) );
_PROTOTYPE( void sef_cb_lu_state_changed_null, (int old_state, int state) );
_PROTOTYPE( void sef_cb_lu_state_dump_null, (int state) );
_PROTOTYPE( int sef_cb_lu_ready_pre_null, (int result) );
_PROTOTYPE( int sef_cb_lu_state_save_null, (int state) );
_PROTOTYPE( void sef_cb_lu_prepare_always_ready, (int state) );
_PROTOTYPE( int sef_cb_lu_prepare_always_ready, (int state) );
_PROTOTYPE( int sef_cb_lu_prepare_never_ready, (int state) );
_PROTOTYPE( int sef_cb_lu_prepare_crash, (int state) );
_PROTOTYPE( int sef_cb_lu_state_isvalid_standard, (int state) );
/* Macros for predefined callback implementations. */
@@ -145,13 +142,13 @@ _PROTOTYPE( int sef_cb_lu_state_isvalid_standard, (int state) );
#define SEF_CB_LU_STATE_ISVALID_NULL sef_cb_lu_state_isvalid_null
#define SEF_CB_LU_STATE_CHANGED_NULL sef_cb_lu_state_changed_null
#define SEF_CB_LU_STATE_DUMP_NULL sef_cb_lu_state_dump_null
#define SEF_CB_LU_READY_PRE_NULL sef_cb_lu_ready_pre_null
#define SEF_CB_LU_STATE_SAVE_NULL sef_cb_lu_state_save_null
#define SEF_CB_LU_PREPARE_DEFAULT sef_cb_lu_prepare_null
#define SEF_CB_LU_STATE_ISVALID_DEFAULT sef_cb_lu_state_isvalid_null
#define SEF_CB_LU_STATE_CHANGED_DEFAULT sef_cb_lu_state_changed_null
#define SEF_CB_LU_STATE_DUMP_DEFAULT sef_cb_lu_state_dump_null
#define SEF_CB_LU_READY_PRE_DEFAULT sef_cb_lu_ready_pre_null
#define SEF_CB_LU_STATE_SAVE_DEFAULT sef_cb_lu_state_save_null
/* Standard live update states. */
#define SEF_LU_STATE_NULL 0 /* null state */
@@ -173,5 +170,47 @@ _PROTOTYPE( int sef_cb_lu_state_isvalid_standard, (int state) );
#define sef_lu_debug_begin sef_debug_begin
#define sef_lu_debug_end sef_debug_end
/*===========================================================================*
* SEF Signal *
*===========================================================================*/
/* What to intercept. */
#define INTERCEPT_SEF_SIGNAL_REQUESTS 1
#define IS_SEF_SIGNAL_REQUEST(mp) \
(((mp)->m_type == SIGS_SIGNAL_RECEIVED && (mp)->m_source < INIT_PROC_NR) \
|| (is_notify((mp)->m_type) && (mp)->m_source == SYSTEM))
/* Callback type definitions. */
typedef void(*sef_cb_signal_handler_t)(int signo);
typedef int(*sef_cb_signal_manager_t)(endpoint_t target, int signo);
/* Callback registration helpers. */
_PROTOTYPE( void sef_setcb_signal_handler, (sef_cb_signal_handler_t cb));
_PROTOTYPE( void sef_setcb_signal_manager, (sef_cb_signal_manager_t cb));
/* Predefined callback implementations. */
_PROTOTYPE( void sef_cb_signal_handler_null, (int signo) );
_PROTOTYPE( int sef_cb_signal_manager_null, (endpoint_t target, int signo) );
_PROTOTYPE( void sef_cb_signal_handler_term, (int signo) );
_PROTOTYPE( void sef_cb_signal_handler_posix_default, (int signo) );
/* Macros for predefined callback implementations. */
#define SEF_CB_SIGNAL_HANDLER_NULL sef_cb_signal_handler_null
#define SEF_CB_SIGNAL_MANAGER_NULL sef_cb_signal_manager_null
#define SEF_CB_SIGNAL_HANDLER_DEFAULT sef_cb_signal_handler_null
#define SEF_CB_SIGNAL_MANAGER_DEFAULT sef_cb_signal_manager_null
/* Debug. */
#define SEF_SIGNAL_DEBUG_DEFAULT 0
#ifndef SEF_SIGNAL_DEBUG
#define SEF_SIGNAL_DEBUG SEF_SIGNAL_DEBUG_DEFAULT
#endif
#define sef_signal_dprint sef_dprint
#define sef_signal_debug_begin sef_debug_begin
#define sef_signal_debug_end sef_debug_end
#endif /* _SEF_H */

View File

@@ -40,7 +40,8 @@ _PROTOTYPE( int sys_exec, (endpoint_t proc_ep, char *ptr,
_PROTOTYPE( int sys_fork, (endpoint_t parent, endpoint_t child, endpoint_t *,
struct mem_map *ptr, u32_t vm, vir_bytes *));
_PROTOTYPE( int sys_newmap, (endpoint_t proc_ep, struct mem_map *ptr));
_PROTOTYPE( int sys_exit, (endpoint_t proc_ep));
_PROTOTYPE( int sys_clear, (endpoint_t proc_ep));
_PROTOTYPE( int sys_exit, (void));
_PROTOTYPE( int sys_trace, (int req, endpoint_t proc_ep, long addr, long *data_p));
/* Shorthands for sys_runctl() system call. */
@@ -49,6 +50,7 @@ _PROTOTYPE( int sys_trace, (int req, endpoint_t proc_ep, long addr, long *data_p
#define sys_resume(proc_ep) sys_runctl(proc_ep, RC_RESUME, 0)
_PROTOTYPE( int sys_runctl, (endpoint_t proc_ep, int action, int flags));
_PROTOTYPE( int sys_update, (endpoint_t src_ep, endpoint_t dst_ep));
_PROTOTYPE( int sys_privctl, (endpoint_t proc_ep, int req, void *p));
_PROTOTYPE( int sys_privquery_mem, (endpoint_t proc_ep,
phys_bytes physstart, phys_bytes physlen));

View File

@@ -25,8 +25,16 @@ _PROTOTYPE( int vm_unmap_phys, (endpoint_t who, void *vaddr, size_t len));
_PROTOTYPE( int vm_notify_sig, (endpoint_t ep, endpoint_t ipc_ep));
_PROTOTYPE( int vm_ctl, (int what, int param));
_PROTOTYPE( int vm_set_priv, (int procnr, void *buf));
_PROTOTYPE( int vm_update, (endpoint_t src_e, endpoint_t dst_e));
_PROTOTYPE( int vm_query_exit, (int *endpt));
/* VM kernel request types. */
#define VMPTYPE_NONE 0
#define VMPTYPE_CHECK 1
#define VMPTYPE_COWMAP 2
#define VMPTYPE_SMAP 3
#define VMPTYPE_SUNMAP 4
struct vm_stats_info {
int vsi_pagesize; /* page size */
int vsi_total; /* total number of memory pages */

View File

@@ -63,10 +63,26 @@ typedef unsigned long sigset_t;
/* MINIX specific signals. These signals are not used by user proceses,
* but meant to inform system processes, like the PM, about system events.
* The order here determines the order signals are processed by system
* processes in user-space. Higher-priority signals should be first.
*/
#define SIGKMESS 29 /* new kernel message */
#define SIGKPF 26 /* kernel page fault request pending */
#define SIGKMEM 27 /* kernel memory request pending */
#define SIGKMESS 28 /* new kernel message */
#define SIGKSIGSM 29 /* kernel signal pending for signal manager */
#define SIGKSIG 30 /* kernel signal pending */
#define SIGNDELAY 31 /* end of delay for signal delivery */
#define SIGKNDELAY 31 /* end of delay for signal delivery */
#define SIGK_FIRST SIGKPF /* first kernel signal */
#define SIGK_LAST SIGKNDELAY /* last kernel signal */
#define IS_SIGK(signo) (signo>=SIGK_FIRST && signo<=SIGK_LAST)
/* Termination signals for Minix system processes. */
#define SIGS_IS_LETHAL(sig) \
(sig == SIGILL || sig == SIGBUS || sig == SIGFPE || sig == SIGSEGV \
|| sig == SIGEMT || sig == SIGABRT)
#define SIGS_IS_TERMINATION(sig) (SIGS_IS_LETHAL(sig) \
|| (sig == SIGKILL || sig == SIGPIPE))
#endif
@@ -79,7 +95,6 @@ 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 {