xref: /minix3/minix/lib/libsys/arch/i386/sys_in.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #include "syslib.h"
2*433d6423SLionel Sambuc 
3*433d6423SLionel Sambuc /*===========================================================================*
4*433d6423SLionel Sambuc  *                                sys_in				     *
5*433d6423SLionel Sambuc  *===========================================================================*/
sys_in(port,value,type)6*433d6423SLionel Sambuc int sys_in(port, value, type)
7*433d6423SLionel Sambuc int port; 				/* port address to read from */
8*433d6423SLionel Sambuc u32_t *value;				/* pointer where to store value */
9*433d6423SLionel Sambuc int type;				/* byte, word, long */
10*433d6423SLionel Sambuc {
11*433d6423SLionel Sambuc     message m_io;
12*433d6423SLionel Sambuc     int result;
13*433d6423SLionel Sambuc 
14*433d6423SLionel Sambuc     m_io.m_lsys_krn_sys_devio.request = _DIO_INPUT | type;
15*433d6423SLionel Sambuc     m_io.m_lsys_krn_sys_devio.port = port;
16*433d6423SLionel Sambuc 
17*433d6423SLionel Sambuc     result = _kernel_call(SYS_DEVIO, &m_io);
18*433d6423SLionel Sambuc     *value = m_io.m_krn_lsys_sys_devio.value;
19*433d6423SLionel Sambuc     return(result);
20*433d6423SLionel Sambuc }
21*433d6423SLionel Sambuc 
22