DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

inw(D3oddi)


inw, outw -- read or write a 16-bit word from or to a physical I/O address

Synopsis

int inw(int read_addr);

void outw(int write_addr, int value);

Description

The inw( ) function reads a 16-bit word from the specified physical I/O address.

The outw( ) function writes a 16-bit word to the specified physical I/O address.

Arguments


read_addr
Physical I/O address of the 16-bit word to be read.

write_addr
Physical I/O address to which to write the 16-bit word.

value
16-bit word to be written.

Return values

inw( ) returns a 32-bit integer whose two most significant bytes are set to zero.

outw( ) does not return a value.

Usage

Context and synchronization

All contexts.

Hardware applicability

All Intel IA-32 compatible platforms

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

The inw(D3) and outw(D3) functions are essentially the same functions for SVR5 DDI drivers, although note that the casting of the function and arguments is different.

DOS systems often issue this function from user-level code. ``Porting DOS inb and outb functionality'' in HDK Technical Reference provides information about how to port such code to SCO OpenServer systems.

References

inb(D3oddi), ind(D3oddi), repinsb(D3oddi)

``ODDI driver interface version for SCO OpenServer 5'' in HDK Technical Reference

Examples

To read a 16-bit register at I/O address 0x300, you would use the following lines of code:
   short int val;
   val = (short int) inw(0x300);
To write the 16-bit value 0xFFF0 to I/O address 0x300, you could use the following code:
   outw(0x300, 0xFFF0);

19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005