
SYSLIB CHANGES: - SEF framework now supports a new SEF Init request type from RS. 3 different callbacks are available (init_fresh, init_lu, init_restart) to specify initialization code when a service starts fresh, starts after a live update, or restarts. SYSTEM SERVICE CHANGES: - Initialization code for system services is now enclosed in a callback SEF will automatically call at init time. The return code of the callback will tell RS whether the initialization completed successfully. - Each init callback can access information passed by RS to initialize. As of now, each system service has access to the public entries of RS's system process table to gather all the information required to initialize. This design eliminates many existing or potential races at boot time and provides a uniform initialization interface to system services. The same interface will be reused for the upcoming publish/subscribe model to handle dynamic registration / deregistration of system services. VM CHANGES: - Uniform privilege management for all system services. Every service uses the same call mask format. For boot services, VM copies the call mask from init data. For dynamic services, VM still receives the call mask via rs_set_priv call that will be soon replaced by the upcoming publish/subscribe model. RS CHANGES: - The system process table has been reorganized and split into private entries and public entries. Only the latter ones are exposed to system services. - VM call masks are now entirely configured in rs/table.c - RS has now its own slot in the system process table. Only kernel tasks and user processes not included in the boot image are now left out from the system process table. - RS implements the initialization protocol for system services. - For services in the boot image, RS blocks till initialization is complete and panics when failure is reported back. Services are initialized in their order of appearance in the boot image priv table and RS blocks to implements synchronous initialization for every system service having the flag SF_SYNCH_BOOT set. - For services started dynamically, the initialization protocol is implemented as though it were the first ping for the service. In this case, if the system service fails to report back (or reports failure), RS brings the service down rather than trying to restart it.
99 lines
2.4 KiB
C
99 lines
2.4 KiB
C
#ifndef RS_H
|
|
#define RS_H
|
|
|
|
/*
|
|
minix/rs.h
|
|
|
|
Interface to the reincarnation server
|
|
*/
|
|
|
|
#include <minix/bitmap.h>
|
|
#include <minix/com.h>
|
|
|
|
/* RSS definitions. */
|
|
#define RSS_NR_IRQ 16
|
|
#define RSS_NR_IO 16
|
|
|
|
/* RSS flags. */
|
|
#define RSS_COPY 0x01 /* Copy the brinary into RS to make it possible
|
|
* to restart the driver without accessing FS
|
|
*/
|
|
#define RSS_IPC_VALID 0x02 /* rss_ipc and rss_ipclen are valid */
|
|
#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
|
|
#define RS_MAX_LABEL_LEN 16
|
|
|
|
/* Labels are copied over separately. */
|
|
struct rss_label
|
|
{
|
|
char *l_addr;
|
|
size_t l_len;
|
|
};
|
|
|
|
/* Arguments needed to start a new driver or server */
|
|
struct rs_start
|
|
{
|
|
unsigned rss_flags;
|
|
char *rss_cmd;
|
|
size_t rss_cmdlen;
|
|
uid_t rss_uid;
|
|
int rss_nice;
|
|
int rss_major;
|
|
long rss_period;
|
|
char *rss_script;
|
|
size_t rss_scriptlen;
|
|
int rss_nr_irq;
|
|
int rss_irq[RSS_NR_IRQ];
|
|
int rss_nr_io;
|
|
struct { unsigned base; unsigned len; } rss_io[RSS_NR_IO];
|
|
int rss_nr_pci_id;
|
|
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];
|
|
struct rss_label rss_label;
|
|
char *rss_ipc;
|
|
size_t rss_ipclen;
|
|
bitchunk_t rss_vm[VM_CALL_MASK_SIZE];
|
|
int rss_nr_control;
|
|
struct rss_label rss_control[RS_NR_CONTROL];
|
|
};
|
|
|
|
/* ACL information for access to PCI devices */
|
|
struct rs_pci
|
|
{
|
|
char rsp_label[RS_MAX_LABEL_LEN];
|
|
int rsp_endpoint;
|
|
int rsp_nr_device;
|
|
struct { u16_t vid; u16_t did; } rsp_device[RS_NR_PCI_DEVICE];
|
|
int rsp_nr_class;
|
|
struct { u32_t class; u32_t mask; } rsp_class[RS_NR_PCI_CLASS];
|
|
};
|
|
|
|
/* Definition of a public entry of the system process table. */
|
|
struct rprocpub {
|
|
short in_use; /* set when the entry is in use */
|
|
unsigned sys_flags; /* sys flags */
|
|
endpoint_t endpoint; /* process endpoint number */
|
|
|
|
dev_t dev_nr; /* major device number */
|
|
int dev_style; /* device style */
|
|
long period; /* heartbeat period (or zero) */
|
|
|
|
char label[RS_MAX_LABEL_LEN]; /* label of this service */
|
|
char proc_name[RS_MAX_LABEL_LEN]; /* process name of this service */
|
|
|
|
bitchunk_t vm_call_mask[VM_CALL_MASK_SIZE]; /* vm call mask */
|
|
|
|
struct rs_pci pci_acl; /* pci acl */
|
|
};
|
|
|
|
_PROTOTYPE( int minix_rs_lookup, (const char *name, endpoint_t *value));
|
|
|
|
#endif
|