SYS_PROFBUF, SYS_DIAGCTL, SYS_STATECTL, SYS_SAFEMEMSET
/* Field names for SYS_DEVIO, SYS_VDEVIO, SYS_SDEVIO. */
-#define DIO_REQUEST m2_i3 /* device in or output */
# define _DIO_INPUT 0x001
# define _DIO_OUTPUT 0x002
# define _DIO_DIRMASK 0x00f
# define DIO_SAFE_OUTPUT_BYTE (_DIO_OUTPUT|_DIO_BYTE|_DIO_SAFE)
# define DIO_SAFE_OUTPUT_WORD (_DIO_OUTPUT|_DIO_WORD|_DIO_SAFE)
# 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 */
/* Field names for SYS_IRQCTL. */
# define IRQ_SETPOLICY 1 /* manage a slot of the IRQ table */
} mess_lsys_krn_sys_privctl;
_ASSERT_MSG_SIZE(mess_lsys_krn_sys_privctl);
+typedef struct {
+ int request;
+ int port;
+ uint32_t value;
+
+ uint8_t padding[44];
+} mess_lsys_krn_sys_devio;
+_ASSERT_MSG_SIZE(mess_lsys_krn_sys_devio);
+
+typedef struct {
+ uint32_t value;
+
+ uint8_t padding[52];
+} mess_krn_lsys_sys_devio;
+_ASSERT_MSG_SIZE(mess_krn_lsys_sys_devio);
+
typedef struct {
int request;
long int port;
mess_krn_lsys_sys_trace m_krn_lsys_sys_trace;
mess_krn_lsys_sys_umap m_krn_lsys_sys_umap;
mess_krn_lsys_sys_vumap m_krn_lsys_sys_vumap;
+ mess_krn_lsys_sys_devio m_krn_lsys_sys_devio;
mess_fs_vfs_breadwrite m_fs_vfs_breadwrite;
mess_fs_vfs_chmod m_fs_vfs_chmod;
mess_lsys_fi_ctl m_lsys_fi_ctl;
mess_lsys_fi_reply m_lsys_fi_reply;
+ mess_lsys_krn_sys_devio m_lsys_krn_sys_devio;
mess_lsys_krn_schedctl m_lsys_krn_schedctl;
mess_lsys_krn_schedule m_lsys_krn_schedule;
mess_lsys_krn_sys_abort m_lsys_krn_sys_abort;
* m_type: SYS_DEVIO
*
* The parameters for this kernel call are:
- * m2_i3: DIO_REQUEST (request input or output)
- * m2_l1: DIO_PORT (port to read/ write)
- * m2_l2: DIO_VALUE (value to write/ return value read)
+ * m_lsys_krn_sys_devio.request (request input or output)
+ * m_lsys_krn_sys_devio.port (port to read/ write)
+ * m_lsys_krn_sys_devio.value (value to write/ return value read)
*/
#include "kernel/system.h"
int i, size, nr_io_range;
int io_type, io_dir;
- io_type = m_ptr->DIO_REQUEST & _DIO_TYPEMASK;
- io_dir = m_ptr->DIO_REQUEST & _DIO_DIRMASK;
+ io_type = m_ptr->m_lsys_krn_sys_devio.request & _DIO_TYPEMASK;
+ io_dir = m_ptr->m_lsys_krn_sys_devio.request & _DIO_DIRMASK;
switch (io_type)
{
}
if (privp->s_flags & CHECK_IO_PORT)
{
- port= m_ptr->DIO_PORT;
+ port= m_ptr->m_lsys_krn_sys_devio.port;
nr_io_range= privp->s_nr_io_range;
for (i= 0, iorp= privp->s_io_tab; i<nr_io_range; i++, iorp++)
{
if (i >= nr_io_range)
{
printf("do_devio: port 0x%x (size %d) not allowed\n",
- m_ptr->DIO_PORT, size);
+ m_ptr->m_lsys_krn_sys_devio.port, size);
return EPERM;
}
}
doit:
- if (m_ptr->DIO_PORT & (size-1))
+ if (m_ptr->m_lsys_krn_sys_devio.port & (size-1))
{
printf("do_devio: unaligned port 0x%x (size %d)\n",
- m_ptr->DIO_PORT, size);
+ m_ptr->m_lsys_krn_sys_devio.port, size);
return EPERM;
}
if (io_dir == _DIO_INPUT) {
switch (io_type) {
/* maybe "it" should not be called ports */
- case _DIO_BYTE: m_ptr->DIO_VALUE = inb(m_ptr->DIO_PORT); break;
- case _DIO_WORD: m_ptr->DIO_VALUE = inw(m_ptr->DIO_PORT); break;
- case _DIO_LONG: m_ptr->DIO_VALUE = inl(m_ptr->DIO_PORT); break;
+ case _DIO_BYTE:
+ m_ptr->m_krn_lsys_sys_devio.value =
+ inb(m_ptr->m_lsys_krn_sys_devio.port);
+ break;
+ case _DIO_WORD:
+ m_ptr->m_krn_lsys_sys_devio.value =
+ inw(m_ptr->m_lsys_krn_sys_devio.port);
+ break;
+ case _DIO_LONG:
+ m_ptr->m_krn_lsys_sys_devio.value =
+ inl(m_ptr->m_lsys_krn_sys_devio.port);
+ break;
default: return(EINVAL);
}
} else {
switch (io_type) {
- case _DIO_BYTE: outb(m_ptr->DIO_PORT, m_ptr->DIO_VALUE); break;
- case _DIO_WORD: outw(m_ptr->DIO_PORT, m_ptr->DIO_VALUE); break;
- case _DIO_LONG: outl(m_ptr->DIO_PORT, m_ptr->DIO_VALUE); break;
+ case _DIO_BYTE:
+ outb(m_ptr->m_lsys_krn_sys_devio.port,
+ m_ptr->m_lsys_krn_sys_devio.value);
+ break;
+ case _DIO_WORD:
+ outw(m_ptr->m_lsys_krn_sys_devio.port,
+ m_ptr->m_lsys_krn_sys_devio.value);
+ break;
+ case _DIO_LONG:
+ outl(m_ptr->m_lsys_krn_sys_devio.port,
+ m_ptr->m_lsys_krn_sys_devio.value);
+ break;
default: return(EINVAL);
}
}