DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sdi_swap(D3sdi)


sdi_swap16, sdi_swap24, sdi_swap32 -- swaps bytes in a 16-, 24-, or 32-bit data type

Synopsis

   #include <sys/sdi.h>

short sdi_swap16(unsigned int arg);

int sdi_swap24(unsigned int arg);

long sdi_swap32(unsigned long arg);

Description

sdi_swap16- swap bytes in a 16-bit data type

sdi_swap24- swap bytes in a 24-bit data type

sdi_swap34- swap bytes in a 34-bit data type

sdi_swap16 swaps the two bytes of the 16-bit argument, arg, and returns the swapped result.

sdi_swap24 swaps the three bytes of the 24-bit argument, arg, and returns the swapped result.

sdi_swap32 swaps the four bytes of the 32-bit argument, arg, and returns the swapped result.

Arguments


arg
value to be swapped

Return values

The return value is the value of the swapped argument.

Usage

This function is typically used by HBA drivers to convert 16-, 24-, or 32-bit binary values for a control block, returned by or sent to the Host Adapter, when the byte orientation of the Intel x86 CPU and the Host Adapter card are opposite.

Context and synchronization

Non-blockable context.

Applicable hardware

x86/Pentium compatible architectures

Version applicability

sdi: 1, 2, 3, 4 HBA and target drivers.

Differences between versions

Similar functions for the SCO OpenServer 5 SCSI interface are documented on the scsi(D3osdi) manual page.

See also

scsi(D3osdi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005