summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/endian.h
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-04-13 09:46:54 +0000
committermarkm <markm@FreeBSD.org>2001-04-13 09:46:54 +0000
commit3709643556622297c2380ed18c0949585c16f360 (patch)
tree9e07ae7f98497b54a15b69eb84b043c98eb45b5d /sys/i386/include/endian.h
parentb31a55145f147e39ce1bb7d802d0e98562b76884 (diff)
downloadFreeBSD-src-3709643556622297c2380ed18c0949585c16f360.zip
FreeBSD-src-3709643556622297c2380ed18c0949585c16f360.tar.gz
Make this more lint-friendly. This file seems to be invoked in just
about any .c file that includes a .h, and lint produces copious whining because of the asm ...; stuff.
Diffstat (limited to 'sys/i386/include/endian.h')
-rw-r--r--sys/i386/include/endian.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/i386/include/endian.h b/sys/i386/include/endian.h
index c9e6cb9..2764e69 100644
--- a/sys/i386/include/endian.h
+++ b/sys/i386/include/endian.h
@@ -60,10 +60,10 @@
#endif
__BEGIN_DECLS
-unsigned long htonl __P((unsigned long));
-unsigned short htons __P((unsigned short));
-unsigned long ntohl __P((unsigned long));
-unsigned short ntohs __P((unsigned short));
+unsigned long htonl(unsigned long);
+unsigned short htons(unsigned short);
+unsigned long ntohl(unsigned long);
+unsigned short ntohs(unsigned short);
__END_DECLS
#ifdef __GNUC__
@@ -71,7 +71,9 @@ __END_DECLS
static __inline unsigned long
__uint16_swap_uint32(unsigned long __x)
{
+#ifndef lint
__asm ("rorl $16, %1" : "=r" (__x) : "0" (__x));
+#endif
return __x;
}
@@ -79,19 +81,23 @@ __uint16_swap_uint32(unsigned long __x)
static __inline unsigned long
__uint8_swap_uint32(unsigned long __x)
{
+#ifndef lint
#if defined(_KERNEL) && (defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)) && !defined(I386_CPU)
__asm ("bswap %0" : "=r" (__x) : "0" (__x));
#else
__asm ("xchgb %h1, %b1\n\trorl $16, %1\n\txchgb %h1, %b1"
: "=q" (__x) : "0" (__x));
#endif
+#endif
return __x;
}
static __inline unsigned short
__uint8_swap_uint16(unsigned short __x)
{
+#ifndef lint
__asm ("xchgb %h1, %b1" : "=q" (__x) : "0" (__x));
+#endif
return __x;
}
OpenPOWER on IntegriCloud