Simplify variable typing for IA builds
Change-Id: I065e5176b3a15bd74ba832f8827b4a4e4837b0f7
This commit is contained in:
parent
64b6c43379
commit
ce6c1d6184
1 changed files with 6 additions and 6 deletions
|
@ -31,14 +31,14 @@
|
||||||
|
|
||||||
#if defined(_KERNEL) && !defined(I386_CPU)
|
#if defined(_KERNEL) && !defined(I386_CPU)
|
||||||
#define __swap32md(x) ({ \
|
#define __swap32md(x) ({ \
|
||||||
u_int32_t __swap32md_x = (x); \
|
uint32_t __swap32md_x = (x); \
|
||||||
\
|
\
|
||||||
__asm ("bswap %1" : "+r" (__swap32md_x)); \
|
__asm ("bswap %1" : "+r" (__swap32md_x)); \
|
||||||
__swap32md_x; \
|
__swap32md_x; \
|
||||||
})
|
})
|
||||||
#else
|
#else
|
||||||
#define __swap32md(x) ({ \
|
#define __swap32md(x) ({ \
|
||||||
u_int32_t __swap32md_x = (x); \
|
uint32_t __swap32md_x = (x); \
|
||||||
\
|
\
|
||||||
__asm ("rorw $8, %w1; rorl $16, %1; rorw $8, %w1" : \
|
__asm ("rorw $8, %w1; rorl $16, %1; rorw $8, %w1" : \
|
||||||
"+r" (__swap32md_x)); \
|
"+r" (__swap32md_x)); \
|
||||||
|
@ -47,13 +47,13 @@
|
||||||
#endif /* _KERNEL && !I386_CPU */
|
#endif /* _KERNEL && !I386_CPU */
|
||||||
|
|
||||||
#define __swap64md(x) ({ \
|
#define __swap64md(x) ({ \
|
||||||
u_int64_t __swap64md_x = (x); \
|
uint64_t __swap64md_x = (x); \
|
||||||
\
|
\
|
||||||
(u_int64_t)__swap32md(__swap64md_x >> 32) | \
|
(uint64_t)__swap32md(__swap64md_x >> 32) | \
|
||||||
(u_int64_t)__swap32md(__swap64md_x & 0xffffffff) << 32; \
|
(uint64_t)__swap32md(__swap64md_x & 0xffffffff) << 32; \
|
||||||
})
|
})
|
||||||
#define __swap16md(x) ({ \
|
#define __swap16md(x) ({ \
|
||||||
u_int16_t __swap16md_x = (x); \
|
uint16_t __swap16md_x = (x); \
|
||||||
\
|
\
|
||||||
__asm ("rorw $8, %w1" : "+r" (__swap16md_x)); \
|
__asm ("rorw $8, %w1" : "+r" (__swap16md_x)); \
|
||||||
__swap16md_x; \
|
__swap16md_x; \
|
||||||
|
|
Loading…
Reference in a new issue