The function below illustrates how to print long-long values within a driver
or module using printk() which doesn't support the 64-bit data format.
Norm Dresner
Fellow Systems Engineer
Radar Systems Engineering Department
Electronic Systems and Sensors Segment
Northrop Grumman Corporation
MS 520
Box 746
Baltimore MD 21203
Voice: (410) 993 - 2096 Mornings; all-day voice-mail
(410) 969 - 8068 Afternoons with answering machine
FAX: (410) 993 - 8084 On-site
(410) 969 - 8068 Afternoons; call first to arrange
E-Mail:Mornings: [EMAIL PROTECTED]
Afternoons: [EMAIL PROTECTED]
/********************************************************
*********************************************************
*
*
* Function to format a long-long datum as %016X *
* This function is designed for small-endian CPUs *
* like the Intel x86 series *
*
*
* ENTRY
*
* char *FormatLongLongHex( llv ) *
* long long llv;
*
*
*
* RETURN
*
* Address of string containing formatted value *
*
*
* NOTE
*
* Since this function uses two static buffers, *
* no more than 2 calls to this function can be made *
* within any one printk() call *
*
*
*********************************************************
********************************************************/
char* FormatLongLongHex( long long llv )
{
static char Buffer[34];
static int phase = 0;
ulong *pul = (ulong*)&llv;
char *buf = Buffer + (phase++ & 1 ? 17 : 0);
sprintf( buf , "%08lX%08lX" , pul[1] , pul[0] );
return( buf );
}
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/