summaryrefslogtreecommitdiff
path: root/minix/lib/libsys/arch/i386/sys_in.c
blob: 4a792ac3d27a8057c6161b8e5cb1c0722a0d5f22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "syslib.h"

/*===========================================================================*
 *                                sys_in				     *
 *===========================================================================*/
int sys_in(port, value, type)
int port; 				/* port address to read from */
u32_t *value;				/* pointer where to store value */
int type;				/* byte, word, long */
{
    message m_io;
    int result;

    m_io.m_lsys_krn_sys_devio.request = _DIO_INPUT | type;
    m_io.m_lsys_krn_sys_devio.port = port;

    result = _kernel_call(SYS_DEVIO, &m_io);
    *value = m_io.m_krn_lsys_sys_devio.value;
    return(result);
}