From d7174ec0abd80f31626f9eec98f5c9484268f36b Mon Sep 17 00:00:00 2001 From: Philip Homburg Date: Mon, 10 Jul 2006 12:13:29 +0000 Subject: [PATCH] Added SI_CALL_STATS and ENABLE_SYSCALL_STATS for system call statistics. Added BUSC_PCI_DEV_NAME_S and BUSC_PCI_SLOT_NAME_S to support safecopies in PCI. Added DL_WRITEV_S, DL_READV_S, DL_GETSTAT_S, DL_GRANT, and iovec_s_t to support safecopies in ethernet drviers. Renamed DL_INIT to DL_CONF, and DL_INIT_REPLY to DL_CONF_REPLY. Added SYS_READBIOS and sys_readbios to read from BIOS data areas. Added GET_KMESS_S for safecopy support in LOG. Added sys_safe_insb and sys_safe_outsb. --- include/minix/com.h | 25 ++++++++++++++++++++++--- include/minix/config.h | 3 +++ include/minix/syslib.h | 6 ++++++ include/minix/type.h | 5 +++++ include/unistd.h | 1 + 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/include/minix/com.h b/include/minix/com.h index b4b65bf38..687598da0 100755 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -123,6 +123,13 @@ * attribute value */ #define BUSC_PCI_RESCAN (BUSC_RQ_BASE + 14) /* Rescan bus */ +#define BUSC_PCI_DEV_NAME_S (BUSC_RQ_BASE + 15) /* Get the name of a + * PCI device + * (safecopy) + */ +#define BUSC_PCI_SLOT_NAME_S (BUSC_RQ_BASE + 16) /* Get the name of a + * PCI slot (safecopy) + */ /*===========================================================================* * Messages for BLOCK and CHARACTER device drivers * @@ -209,13 +216,16 @@ #define DL_WRITEV (DL_RQ_BASE + 4) #define DL_READ (DL_RQ_BASE + 5) #define DL_READV (DL_RQ_BASE + 6) -#define DL_INIT (DL_RQ_BASE + 7) +#define DL_CONF (DL_RQ_BASE + 7) #define DL_STOP (DL_RQ_BASE + 8) #define DL_GETSTAT (DL_RQ_BASE + 9) #define DL_GETNAME (DL_RQ_BASE +10) +#define DL_WRITEV_S (DL_RQ_BASE +11) +#define DL_READV_S (DL_RQ_BASE +12) +#define DL_GETSTAT_S (DL_RQ_BASE +13) /* Message type for data link layer replies. */ -#define DL_INIT_REPLY (DL_RS_BASE + 20) +#define DL_CONF_REPLY (DL_RS_BASE + 20) #define DL_TASK_REPLY (DL_RS_BASE + 21) #define DL_NAME_REPLY (DL_RS_BASE + 22) @@ -227,6 +237,7 @@ #define DL_CLCK m2_l2 #define DL_ADDR m2_p1 #define DL_STAT m2_l1 +#define DL_GRANT m2_l2 #define DL_NAME m3_ca1 /* Bits in 'DL_STAT' field of DL replies. */ @@ -290,8 +301,9 @@ # define SYS_SAFECOPYTO (KERNEL_CALL + 32) /* sys_safecopyto() */ # define SYS_VSAFECOPY (KERNEL_CALL + 33) /* sys_vsafecopy() */ # define SYS_SETGRANT (KERNEL_CALL + 34) /* sys_setgrant() */ +# define SYS_READBIOS (KERNEL_CALL + 35) /* sys_readbios() */ -#define NR_SYS_CALLS 35 /* number of system calls */ +#define NR_SYS_CALLS 36 /* number of system calls */ /* Pseudo call for use in kernel/table.c. */ #define SYS_ALL_CALLS (NR_SYS_CALLS) @@ -503,6 +515,11 @@ #define SEL_ERRORFDS m8_p3 #define SEL_TIMEOUT m8_p4 +/* Message for SYS_READBIOS */ +#define RDB_SIZE m2_i1 +#define RDB_ADDR m2_l1 +#define RDB_BUF m2_p1 + /*===========================================================================* * Messages for the Reincarnation Server * *===========================================================================*/ @@ -559,6 +576,8 @@ # define DIAG_BUF_COUNT m1_i1 #define GET_KMESS (DIAG_BASE+3) /* get kmess from TTY */ # define GETKM_PTR m1_p1 +#define GET_KMESS_S (DIAG_BASE+4) /* get kmess from TTY */ +# define GETKM_GRANT m1_i1 #define PM_BASE 0x900 #define PM_GET_WORK (PM_BASE + 1) /* Get work from PM */ diff --git a/include/minix/config.h b/include/minix/config.h index 9785975fd..477aade5f 100755 --- a/include/minix/config.h +++ b/include/minix/config.h @@ -99,6 +99,9 @@ #define NR_RS_LINES 4 /* # rs232 terminals (0 to 4) */ #define NR_PTYS 32 /* # pseudo terminals (0 to 64) */ +/* This feature enable the counting of system calls in PM and FS */ +#define ENABLE_SYSCALL_STATS 0 + /*===========================================================================* * There are no user-settable parameters after this line * *===========================================================================*/ diff --git a/include/minix/syslib.h b/include/minix/syslib.h index 85a8b3a83..2d04987fe 100755 --- a/include/minix/syslib.h +++ b/include/minix/syslib.h @@ -46,6 +46,8 @@ _PROTOTYPE( int sys_vm_setbuf, (phys_bytes base, phys_bytes size, _PROTOTYPE( int sys_vm_map, (endpoint_t proc_nr, int do_map, phys_bytes base, phys_bytes size, phys_bytes offset)); +_PROTOTYPE( int sys_readbios, (phys_bytes address, void *buf, size_t size)); + /* Shorthands for sys_sdevio() system call. */ #define sys_insb(port, proc_nr, buffer, count) \ sys_sdevio(DIO_INPUT_BYTE, port, proc_nr, buffer, count, 0) @@ -55,6 +57,10 @@ _PROTOTYPE( int sys_vm_map, (endpoint_t proc_nr, int do_map, sys_sdevio(DIO_OUTPUT_BYTE, port, proc_nr, buffer, count, 0) #define sys_outsw(port, proc_nr, buffer, count) \ sys_sdevio(DIO_OUTPUT_WORD, port, proc_nr, buffer, count, 0) +#define sys_safe_insb(port, ept, grant, offset, count) \ + sys_sdevio(DIO_SAFE_INPUT_BYTE, port, ept, (void*)grant, count, offset) +#define sys_safe_outsb(port, ept, grant, offset, count) \ + sys_sdevio(DIO_SAFE_OUTPUT_BYTE, port, ept, (void*)grant, count, offset) #define sys_safe_insw(port, ept, grant, offset, count) \ sys_sdevio(DIO_SAFE_INPUT_WORD, port, ept, (void*)grant, count, offset) #define sys_safe_outsw(port, ept, grant, offset, count) \ diff --git a/include/minix/type.h b/include/minix/type.h index 0628bbd01..114b338ef 100755 --- a/include/minix/type.h +++ b/include/minix/type.h @@ -73,6 +73,11 @@ typedef struct { vir_bytes iov_size; /* sizeof an I/O buffer */ } iovec_t; +typedef struct { + int iov_grant; /* grant ID of an I/O buffer */ + vir_bytes iov_size; /* sizeof an I/O buffer */ +} iovec_s_t; + /* PM passes the address of a structure of this type to KERNEL when * sys_sendsig() is invoked as part of the signal catching mechanism. * The structure contain all the information that KERNEL needs to build diff --git a/include/unistd.h b/include/unistd.h index 1f1f89eca..0d6f780b5 100755 --- a/include/unistd.h +++ b/include/unistd.h @@ -47,6 +47,7 @@ #define SI_DATA_STORE 5 /* get copy of data store */ #define SI_LOADINFO 6 /* get copy of load average structure */ #define SI_KPROC_TAB 7 /* copy of kernel process table */ +#define SI_CALL_STATS 8 /* system call statistics */ /* NULL must be defined in according to POSIX Sec. 2.7.1. */ #define NULL ((void *)0)