tie_hu
June 10, 2002, 5:23pm
1
1)Does anyone know how to use in8() and out8() in qnx?
2)Can I use these functions to read and write
data from I/O port?
3)In QNX 6.2 library,
uint8_t in8(uintptr_t port);
what 's the meaning of unintptr and uint8_t?
4)Is in8() and out() same with _inp() and
_outp() function in Visual C++?
Tie Hu
6/10
tie hu <tie@cbis.ece.drexel.edu > wrote:
1)Does anyone know how to use in8() and out8() in qnx?
Yes.
You need to do a ThreadCtl( _NTO_TCTL_IO, 0 ) first in any
thread that is going to use them.
2)Can I use these functions to read and write
data from I/O port?
That is explicitly what they are intended for.
3)In QNX 6.2 library,
uint8_t in8(uintptr_t port);
what 's the meaning of unintptr and uint8_t?
uint8_t → unsigned 8 bit integer value
uintptr_t → ptr to an unsigned integer value (e.g. an address)
This means, you pass in8() and address, and it returns you an unsigned
8 bit value.
4)Is in8() and out() same with _inp() and
_outp() function in Visual C++?
Essentially yes.
But, they are genericised – inp/outp are x86 specific, these will
work on other platforms.
If you want to know what they actually do, take a look at
usr/include/x86/inout.h
as they are implemented as inline assembly.
-David
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.