sdi_swap(D3I) sdi_swap(D3I)
NAME
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);
Arguments
arg Value to be swapped.
DESCRIPTION
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.
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.
Level
Base or Interrupt.
NOTICES
Applicability
sdi: 1, 2
Copyright 1994 Novell, Inc. Page 1