Mesa (master): util: Set cpu endianness too.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Thu Oct 22 18:12:28 UTC 2009


Module: Mesa
Branch: master
Commit: 4797ce0d194720369b46d51733536d02b4a14473
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4797ce0d194720369b46d51733536d02b4a14473

Author: José Fonseca <jfonseca at vmware.com>
Date:   Thu Oct 22 18:09:37 2009 +0100

util: Set cpu endianness too.

---

 src/gallium/auxiliary/util/u_cpu_detect.c |    2 ++
 src/gallium/auxiliary/util/u_cpu_detect.h |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c
index 7330d5d..c93e0db 100644
--- a/src/gallium/auxiliary/util/u_cpu_detect.c
+++ b/src/gallium/auxiliary/util/u_cpu_detect.c
@@ -394,8 +394,10 @@ util_cpu_detect(void)
    util_cpu_caps.arch = UTIL_CPU_ARCH_SPARC;
 #elif defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
    util_cpu_caps.arch = UTIL_CPU_ARCH_X86;
+   util_cpu_caps.little_endian = 1;
 #elif defined(PIPE_ARCH_PPC)
    util_cpu_caps.arch = UTIL_CPU_ARCH_POWERPC;
+   util_cpu_caps.little_endian = 0;
 #else
    util_cpu_caps.arch = UTIL_CPU_ARCH_UNKNOWN;
 #endif
diff --git a/src/gallium/auxiliary/util/u_cpu_detect.h b/src/gallium/auxiliary/util/u_cpu_detect.h
index 7ea0121..4b3dc39 100644
--- a/src/gallium/auxiliary/util/u_cpu_detect.h
+++ b/src/gallium/auxiliary/util/u_cpu_detect.h
@@ -54,6 +54,8 @@ struct util_cpu_caps {
    int x86_cpu_type;
    unsigned cacheline;
 
+   unsigned little_endian:1;
+
    unsigned has_tsc:1;
    unsigned has_mmx:1;
    unsigned has_mmx2:1;




More information about the mesa-commit mailing list