. added safecopies.c: these are library functions to maintain grant tables in own address space . sys_safecopy.c: interfaces to kernel calls to perform safe copy functions in from or to foreign process . changes in i/o fields (type merged with request) reflected in library functions (sys_out.c, sys_vinb.c, sys_vinl.c, sys_vinw.c, sys_voutb.c, sys_voutl.c, sys_voutw.c) . type merged with request in sys_sdevio, also now accepts offset which is used when a grant is specified (the _DIO_SAFE subtype) . system printf() function changed to send DIAGNOSTICS_S messages, which specify a grant id instead of a direct address for the buffer to be printed; tty and log can then safecopy the buffer
		
			
				
	
	
		
			27 lines
		
	
	
		
			841 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			841 B
		
	
	
	
		
			C
		
	
	
	
	
	
#include "syslib.h"
 | 
						|
 | 
						|
/*===========================================================================*
 | 
						|
 *                                sys_sdevio				     *
 | 
						|
 *===========================================================================*/
 | 
						|
PUBLIC int sys_sdevio(req, port, proc_nr, buffer, count, offset)
 | 
						|
int req;				/* request: DIO_{IN,OUT}PUT_* */
 | 
						|
long port; 				/* port address to read from */
 | 
						|
endpoint_t proc_nr;			/* process where buffer is */
 | 
						|
void *buffer;				/* pointer to buffer */
 | 
						|
int count;				/* number of elements */
 | 
						|
vir_bytes offset;			/* offset from grant */
 | 
						|
{
 | 
						|
    message m_io;
 | 
						|
    int result;
 | 
						|
 | 
						|
    m_io.DIO_REQUEST = req;
 | 
						|
    m_io.DIO_PORT = port;
 | 
						|
    m_io.DIO_VEC_ENDPT = proc_nr;
 | 
						|
    m_io.DIO_VEC_ADDR = buffer;
 | 
						|
    m_io.DIO_VEC_SIZE = count;
 | 
						|
    m_io.DIO_OFFSET = offset;
 | 
						|
 | 
						|
    return(_taskcall(SYSTASK, SYS_SDEVIO, &m_io));
 | 
						|
}
 | 
						|
 |