# define DIO_SAFE_OUTPUT_LONG (_DIO_OUTPUT|_DIO_LONG|_DIO_SAFE)
#define DIO_PORT m2_l1 /* single port address */
#define DIO_VALUE m2_l2 /* single I/O value */
-#define DIO_VEC_ADDR m2_p1 /* address of buffer or (p,v)-pairs */
-#define DIO_VEC_SIZE m2_l2 /* number of elements in vector */
/* Field names for SYS_SETALARM. */
#define ALRM_EXP_TIME m2_l1 /* expire time for the alarm call */
} mess_lsys_krn_sys_sdevio;
_ASSERT_MSG_SIZE(mess_lsys_krn_sys_sdevio);
+typedef struct {
+ int request;
+ int vec_size;
+ vir_bytes vec_addr; /* pv{b,w,l}_pair_t * */
+
+ uint8_t padding[44];
+} mess_lsys_krn_sys_vdevio;
+_ASSERT_MSG_SIZE(mess_lsys_krn_sys_vdevio);
+
typedef struct {
phys_bytes base;
phys_bytes count;
mess_lsys_krn_schedule m_lsys_krn_schedule;
mess_lsys_krn_sys_memset m_lsys_krn_sys_memset;
mess_lsys_krn_sys_sdevio m_lsys_krn_sys_sdevio;
+ mess_lsys_krn_sys_vdevio m_lsys_krn_sys_vdevio;
mess_lsys_pci_busc_get_bar m_lsys_pci_busc_get_bar;
* m_type: SYS_VDEVIO
*
* The parameters for this kernel call are:
- * m2_i3: DIO_REQUEST (request input or output)
- * m2_p1: DIO_VEC_ADDR (pointer to port/ value pairs)
- * m2_i2: DIO_VEC_SIZE (number of ports to read or write)
+ * m_lsys_krn_sys_vdevio.request (request input or output)
+ * m_lsys_krn_sys_vdevio.vec_addr (pointer to port/ value pairs)
+ * m_lsys_krn_sys_vdevio.vec_size (number of ports to read or write)
*/
#include "kernel/system.h"
int r;
/* Get the request, size of the request vector, and check the values. */
- io_dir = m_ptr->DIO_REQUEST & _DIO_DIRMASK;
- io_type = m_ptr->DIO_REQUEST & _DIO_TYPEMASK;
+ io_dir = m_ptr->m_lsys_krn_sys_vdevio.request & _DIO_DIRMASK;
+ io_type = m_ptr->m_lsys_krn_sys_vdevio.request & _DIO_TYPEMASK;
if (io_dir == _DIO_INPUT) io_in = TRUE;
else if (io_dir == _DIO_OUTPUT) io_in = FALSE;
else return(EINVAL);
- if ((vec_size = m_ptr->DIO_VEC_SIZE) <= 0) return(EINVAL);
+ if ((vec_size = m_ptr->m_lsys_krn_sys_vdevio.vec_size) <= 0) return(EINVAL);
switch (io_type) {
case _DIO_BYTE:
bytes = vec_size * sizeof(pvb_pair_t);
if (bytes > sizeof(vdevio_buf)) return(E2BIG);
/* Copy (port,value)-pairs from user. */
- if((r=data_copy(caller->p_endpoint, (vir_bytes) m_ptr->DIO_VEC_ADDR,
+ if((r=data_copy(caller->p_endpoint, m_ptr->m_lsys_krn_sys_vdevio.vec_addr,
KERNEL, (vir_bytes) vdevio_buf, bytes)) != OK)
return r;
/* Almost done, copy back results for input requests. */
if (io_in)
if((r=data_copy(KERNEL, (vir_bytes) vdevio_buf,
- caller->p_endpoint, (vir_bytes) m_ptr->DIO_VEC_ADDR,
+ caller->p_endpoint, m_ptr->m_lsys_krn_sys_vdevio.vec_addr,
(phys_bytes) bytes)) != OK)
return r;
return(OK);
{
message m_io;
- m_io.DIO_REQUEST = _DIO_INPUT | _DIO_BYTE;
- m_io.DIO_VEC_ADDR = (char *) pvb_pairs;
- m_io.DIO_VEC_SIZE = nr_ports;
+ m_io.m_lsys_krn_sys_vdevio.request = _DIO_INPUT | _DIO_BYTE;
+ m_io.m_lsys_krn_sys_vdevio.vec_addr = (vir_bytes) pvb_pairs;
+ m_io.m_lsys_krn_sys_vdevio.vec_size = nr_ports;
return _kernel_call(SYS_VDEVIO, &m_io);
}
{
message m_io;
- m_io.DIO_REQUEST = _DIO_INPUT | _DIO_LONG;
- m_io.DIO_VEC_ADDR = (char *) pvl_pairs;
- m_io.DIO_VEC_SIZE = nr_ports;
+ m_io.m_lsys_krn_sys_vdevio.request = _DIO_INPUT | _DIO_LONG;
+ m_io.m_lsys_krn_sys_vdevio.vec_addr = (vir_bytes)pvl_pairs;
+ m_io.m_lsys_krn_sys_vdevio.vec_size = nr_ports;
return _kernel_call(SYS_VDEVIO, &m_io);
}
#include "syslib.h"
-
/*===========================================================================*
* sys_vinw *
*===========================================================================*/
{
message m_io;
- m_io.DIO_REQUEST = _DIO_WORD | _DIO_INPUT;
- m_io.DIO_VEC_ADDR = (char *) pvw_pairs;
- m_io.DIO_VEC_SIZE = nr_ports;
+ m_io.m_lsys_krn_sys_vdevio.request = _DIO_WORD | _DIO_INPUT;
+ m_io.m_lsys_krn_sys_vdevio.vec_addr = (vir_bytes)pvw_pairs;
+ m_io.m_lsys_krn_sys_vdevio.vec_size = nr_ports;
return _kernel_call(SYS_VDEVIO, &m_io);
}
int nr_ports; /* nr of pairs to be processed */
{
message m_io;
- m_io.DIO_REQUEST = _DIO_OUTPUT | _DIO_BYTE;
- m_io.DIO_VEC_ADDR = (char *) pvb_pairs;
- m_io.DIO_VEC_SIZE = nr_ports;
+
+ m_io.m_lsys_krn_sys_vdevio.request = _DIO_OUTPUT | _DIO_BYTE;
+ m_io.m_lsys_krn_sys_vdevio.vec_addr = (vir_bytes)pvb_pairs;
+ m_io.m_lsys_krn_sys_vdevio.vec_size = nr_ports;
return _kernel_call(SYS_VDEVIO, &m_io);
}
{
message m_io;
- m_io.DIO_REQUEST = _DIO_OUTPUT | _DIO_LONG;
- m_io.DIO_VEC_ADDR = (char *) pvl_pairs;
- m_io.DIO_VEC_SIZE = nr_ports;
+ m_io.m_lsys_krn_sys_vdevio.request = _DIO_OUTPUT | _DIO_LONG;
+ m_io.m_lsys_krn_sys_vdevio.vec_addr = (vir_bytes)pvl_pairs;
+ m_io.m_lsys_krn_sys_vdevio.vec_size = nr_ports;
return _kernel_call(SYS_VDEVIO, &m_io);
}
#include "syslib.h"
-
/*===========================================================================*
* sys_voutw *
*===========================================================================*/
{
message m_io;
- m_io.DIO_REQUEST = _DIO_OUTPUT | _DIO_WORD;
- m_io.DIO_VEC_ADDR = (char *) pvw_pairs;
- m_io.DIO_VEC_SIZE = nr_ports;
+ m_io.m_lsys_krn_sys_vdevio.request = _DIO_OUTPUT | _DIO_WORD;
+ m_io.m_lsys_krn_sys_vdevio.vec_addr = (vir_bytes)pvw_pairs;
+ m_io.m_lsys_krn_sys_vdevio.vec_size = nr_ports;
return _kernel_call(SYS_VDEVIO, &m_io);
}