[Mesa-dev] [PATCH 10/19] auxiliary/os: introduce os_get_total_physical_memory helper function

Emil Velikov emil.l.velikov at gmail.com
Mon Aug 18 05:24:08 PDT 2014


On 18/08/14 13:20, Jon TURNEY wrote:
> On 14/08/2014 23:18, Emil Velikov wrote:
>> Cc: Alexander von Gluck IV <kallisti5 at unixzen.com>
>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>> ---
>>   src/gallium/auxiliary/os/os_misc.c | 64
>> ++++++++++++++++++++++++++++++++++++++
>>   src/gallium/auxiliary/os/os_misc.h |  7 +++++
>>   2 files changed, 71 insertions(+)
> 
> Since this #errors on unknown platforms, teach it about the existence of Cygwin.
> 
> 
> 0001-Teach-os_get_physical_memory-about-Cygwin.patch
> 
> 
> From 03e0df4455810e255c22a0532b9e66dcc3d60a1d Mon Sep 17 00:00:00 2001
> From: Jon TURNEY <jon.turney at dronecode.org.uk>
> Date: Sun, 17 Aug 2014 17:21:27 +0100
> Subject: [PATCH] Teach os_get_physical_memory about Cygwin
> 
> Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
I was under the strange impression that the p_config.h will set PIPE_OS_LINUX
for Cygwin. It seem like I got confused with PIPE_OS_UNIX.

Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>

> ---
>  src/gallium/auxiliary/os/os_misc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/auxiliary/os/os_misc.c b/src/gallium/auxiliary/os/os_misc.c
> index 3846a9a..ef84c79 100644
> --- a/src/gallium/auxiliary/os/os_misc.c
> +++ b/src/gallium/auxiliary/os/os_misc.c
> @@ -47,7 +47,7 @@
>  #endif
>  
>  
> -#if defined(PIPE_OS_LINUX)
> +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_CYGWIN)
>  #  include <unistd.h>
>  #elif defined(PIPE_OS_APPLE) || defined(PIPE_OS_BSD)
>  #  include <sys/sysctl.h>
> @@ -111,7 +111,7 @@ os_get_option(const char *name)
>  bool
>  os_get_total_physical_memory(uint64_t *size)
>  {
> -#if defined(PIPE_OS_LINUX)
> +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_CYGWIN)
>     const long phys_pages = sysconf(_SC_PHYS_PAGES);
>     const long page_size = sysconf(_SC_PAGE_SIZE);
>  
> -- 1.8.5.5
> 
> 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 



More information about the mesa-dev mailing list