2005-04-21 16:53:53 +02:00
|
|
|
#include "syslib.h"
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* sys_in *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int sys_in(port, value, type)
|
2005-04-21 16:53:53 +02:00
|
|
|
int port; /* port address to read from */
|
2012-03-05 00:11:41 +01:00
|
|
|
u32_t *value; /* pointer where to store value */
|
2005-04-21 16:53:53 +02:00
|
|
|
int type; /* byte, word, long */
|
|
|
|
{
|
|
|
|
message m_io;
|
|
|
|
int result;
|
|
|
|
|
2014-07-26 13:53:55 +02:00
|
|
|
m_io.m_lsys_krn_sys_devio.request = _DIO_INPUT | type;
|
|
|
|
m_io.m_lsys_krn_sys_devio.port = port;
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2010-02-09 16:20:09 +01:00
|
|
|
result = _kernel_call(SYS_DEVIO, &m_io);
|
2014-07-26 13:53:55 +02:00
|
|
|
*value = m_io.m_krn_lsys_sys_devio.value;
|
2005-04-21 16:53:53 +02:00
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|