(Incomplete) support for access control in PCI (pci_set_acl).

-script argument to service for crash recovery scripts
-config argument to service for driver resource configuration
restart command in service to restart a driver after a crash (for use in
crash recovery scripts).
down and refresh now take labels instead of pids.
verious changes in rs to make this work.
This commit is contained in:
Philip Homburg
2006-10-20 15:01:32 +00:00
parent fd448c332b
commit f9ccfca2a1
14 changed files with 1487 additions and 53 deletions
+13 -5
View File
@@ -131,6 +131,9 @@
#define BUSC_PCI_SLOT_NAME_S (BUSC_RQ_BASE + 16) /* Get the name of a
* PCI slot (safecopy)
*/
#define BUSC_PCI_ACL (BUSC_RQ_BASE + 17) /* Set the ACL for a
* driver (safecopy)
*/
/*===========================================================================*
* Messages for BLOCK and CHARACTER device drivers *
@@ -537,13 +540,18 @@
#define RS_UP (RS_RQ_BASE + 0) /* start system service */
#define RS_DOWN (RS_RQ_BASE + 1) /* stop system service */
#define RS_REFRESH (RS_RQ_BASE + 2) /* restart system service */
#define RS_RESCUE (RS_RQ_BASE + 3) /* set rescue directory */
#define RS_SHUTDOWN (RS_RQ_BASE + 4) /* alert about shutdown */
#define RS_UP_COPY (RS_RQ_BASE + 5) /* start system service and
#define RS_REFRESH (RS_RQ_BASE + 2) /* refresh system service */
#define RS_RESTART (RS_RQ_BASE + 3) /* restart system service */
#define RS_RESCUE (RS_RQ_BASE + 4) /* set rescue directory */
#define RS_SHUTDOWN (RS_RQ_BASE + 5) /* alert about shutdown */
#define RS_UP_COPY (RS_RQ_BASE + 6) /* start system service and
* keep the binary in memory
*/
#define RS_RUN (RS_RQ_BASE + 6) /* run without restart */
#define RS_RUN (RS_RQ_BASE + 7) /* run without restart */
#define RS_START (RS_RQ_BASE + 8) /* start a driver/service
* arguments are passed in
* a struct rs_start
*/
# define RS_CMD_ADDR m1_p1 /* command string */
# define RS_CMD_LEN m1_i1 /* length of command */
+53
View File
@@ -0,0 +1,53 @@
/*
minix/rs.h
Interface to the reincarnation server
*/
#define RSS_NR_IRQ 16
#define RSS_NR_IO 16
#define RSS_NR_PCI_ID 16
#define RSS_NR_PCI_CLASS 4
#define RSS_NR_SYSTEM 2
/* 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[RSS_NR_PCI_ID];
int rss_nr_pci_class;
struct { u32_t class; u32_t mask; } rss_pci_class[RSS_NR_PCI_CLASS];
u32_t rss_system[RSS_NR_SYSTEM];
};
#define RF_COPY 0x01 /* Copy the brinary into RS to make it possible
* to restart the driver without accessing FS
*/
#define RSP_LABEL_SIZE 16
#define RSP_NR_DEVICE 16
#define RSP_NR_CLASS 4
/* ACL information for access to PCI devices */
struct rs_pci
{
char rsp_label[RSP_LABEL_SIZE]; /* Name of the driver */
int rsp_endpoint;
int rsp_nr_device;
struct { u16_t vid; u16_t did; } rsp_device[RSP_NR_DEVICE];
int rsp_nr_class;
struct { u32_t class; u32_t mask; } rsp_class[RSP_NR_CLASS];
};
+2
View File
@@ -19,6 +19,7 @@
/* Forward declaration */
struct reg86u;
struct rs_pci;
#define SYSTASK SYSTEM
@@ -194,6 +195,7 @@ _PROTOTYPE( void pci_attr_w16, (int devind, int port, U16_t value) );
_PROTOTYPE( void pci_attr_w32, (int devind, int port, u32_t value) );
_PROTOTYPE( char *pci_dev_name, (U16_t vid, U16_t did) );
_PROTOTYPE( char *pci_slot_name, (int devind) );
_PROTOTYPE( int pci_set_acl, (struct rs_pci *rs_pci) );
#endif /* _SYSLIB_H */