mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
gallium/util: Add macros for converting from little endian to CPU byte order.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 4a3be16fd2)
This commit is contained in:
parent
d15ce8dd29
commit
f60e81ecb2
1 changed files with 13 additions and 0 deletions
|
|
@ -547,6 +547,19 @@ util_bitcount(unsigned n)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert from little endian to CPU byte order.
|
||||
*/
|
||||
|
||||
#ifdef PIPE_ARCH_BIG_ENDIAN
|
||||
#define util_le32_to_cpu(x) util_bswap32(x)
|
||||
#define util_le16_to_cpu(x) util_bswap16(x)
|
||||
#else
|
||||
#define util_le32_to_cpu(x) (x)
|
||||
#define util_le16_to_cpu(x) (x)
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Reverse byte order of a 32 bit word.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue