make getsysinfo() a system-land call

This commit is contained in:
David van Moolenbroek
2010-09-14 21:50:05 +00:00
parent d299a6422b
commit 354da24f5b
24 changed files with 89 additions and 240 deletions

View File

@@ -69,8 +69,8 @@
#define REBOOT 76
#define SVRCTL 77
#define SYSUNAME 78
#define GETSYSINFO 79 /* to PM, VFS, RS, or DS */
#define GETDENTS 80 /* to FS */
#define GETSYSINFO 79 /* to PM or VFS (obsolete) */
#define GETDENTS 80 /* to VFS */
#define LLSEEK 81 /* to VFS */
#define FSTATFS 82 /* to VFS */
#define STATVFS 83 /* to VFS */
@@ -87,7 +87,7 @@
#define FTRUNCATE 94 /* to VFS */
#define FCHMOD 95 /* to VFS */
#define FCHOWN 96 /* to VFS */
#define GETSYSINFO_UP 97 /* to PM or VFS */
#define GETSYSINFO_UP 97 /* to PM (obsolete) */
#define SPROF 98 /* to PM */
#define CPROF 99 /* to PM */

View File

@@ -877,8 +877,10 @@
#define PM_NUID m2_i1
#define PM_NGID m2_i2
/* Field names for GETSYSINFO_UP (PM). */
/* Field names for GETSYSINFO_UP (PM) (obsolete). */
#define SIU_WHAT m2_i1
# define SIU_LOADINFO 1 /* retrieve load info data */
# define SIU_SYSTEMHZ 2 /* retrieve system clock frequency */
#define SIU_LEN m2_i2
#define SIU_WHERE m2_p1
@@ -902,6 +904,14 @@
# define GCOV_BUFF_P m1_p1
# define GCOV_BUFF_SZ m1_i1
/* Common request to several system servers: retrieve system information.
* The GETSYSINFO userland call is an (old and deprecated) alias of this, so do
* not change the fields or old userland applications may break.
*/
#define COMMON_GETSYSINFO (COMMON_RQ_BASE+2)
# define SI_WHAT m1_i1
# define SI_WHERE m1_p1
/*===========================================================================*
* Messages for VM server *
*===========================================================================*/

View File

@@ -6,15 +6,15 @@
#include <minix/type.h>
_PROTOTYPE( int getsysinfo, (endpoint_t who, int what, void *where) );
_PROTOTYPE( int minix_getkproctab, (void *pr, int nprocs, int assert));
_PROTOTYPE( ssize_t getsysinfo_up, (endpoint_t who, int what, size_t size,
void *where));
#define SIU_LOADINFO 1 /* retrieve load info data */
#define SIU_SYSTEMHZ 2 /* retrieve system clock frequency */
#define SIU_IDLETSC 3 /* retrieve cumulative idle timestamp count */
/* Exported system parameters. */
/* What system info to retrieve with sysgetinfo(). */
#define SI_PROC_TAB 2 /* copy of entire process table */
#define SI_DMAP_TAB 3 /* get device <-> driver mappings */
#define SI_DATA_STORE 5 /* get copy of data store mappings */
#define SI_SUBSCRIPTION 6 /* get copy of data store subscriptions */
#define SI_LOADINFO 7 /* get copy of load average structure */
#define SI_CALL_STATS 9 /* system call statistics */
#define SI_PROCPUB_TAB 11 /* copy of public entries of process table */
#endif

View File

@@ -198,20 +198,5 @@ struct k_randomness {
} bin[RANDOM_SOURCES];
};
/* information on PCI devices */
#define PCIINFO_ENTRY_SIZE 80
struct pciinfo_entry {
u16_t pie_vid;
u16_t pie_did;
char pie_name[PCIINFO_ENTRY_SIZE];
};
struct pciinfo {
size_t pi_count;
struct pciinfo_entry pi_entries[NR_PCIDEV];
};
#endif /* _TYPE_H */

View File

@@ -41,20 +41,6 @@
#define _PM_SEG_FLAG (1L << 30) /* for read() and write() to FS by PM */
#endif
/* What system info to retrieve with sysgetinfo(). */
#define SI_KINFO 0 /* get kernel info via PM */
#define SI_PROC_ADDR 1 /* address of process table */
#define SI_PROC_TAB 2 /* copy of entire process table */
#define SI_DMAP_TAB 3 /* get device <-> driver mappings */
#define SI_MEM_ALLOC 4 /* get memory allocation data */
#define SI_DATA_STORE 5 /* get copy of data store mappings */
#define SI_SUBSCRIPTION 6 /* get copy of data store subscriptions */
#define SI_LOADINFO 7 /* get copy of load average structure */
#define SI_KPROC_TAB 8 /* copy of kernel process table */
#define SI_CALL_STATS 9 /* system call statistics */
#define SI_PCI_INFO 10 /* get kernel info via PM */
#define SI_PROCPUB_TAB 11 /* copy of public entries of process table */
/* NULL must be defined in <unistd.h> according to POSIX Sec. 2.7.1. */
#include <sys/null.h>
@@ -198,7 +184,6 @@ _PROTOTYPE( char *crypt, (const char *_key, const char *_salt) );
#endif
_PROTOTYPE( int getsysinfo, (endpoint_t who, int what, void *where) );
_PROTOTYPE( int getsigset, (sigset_t *sigset) );
_PROTOTYPE( int getprocnr, (void) );
_PROTOTYPE( int getnprocnr, (pid_t pid) );