util: Rename src/gallium/include/pipe/p_config.h to src/util/detect_arch.h

Even though the defines in p_config.h are stared with PIPE_, they are indeed
are generic detecting mechanics, we will rename them to DETECT_* in latter MR

We rename src/gallium/include/pipe/p_config.h src/util/detect_arch.h because
the detect code in src/gallium/include/pipe/p_config.h are most about
processor architecture detecting.

The file util/detect.h is added to replace functional of src/gallium/include/pipe/p_config.h
So we replace of #include "pipe/p_config.h" with #include "util/detect.h"

The file util/detect_cc.h is added as a placeholder for moving compiler related macro defines
from p_config.h into it in following commits

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19674>
This commit is contained in:
Yonggang Luo 2022-11-09 15:00:37 +08:00 committed by Marge Bot
parent 7710cc8506
commit 845222dbae
37 changed files with 147 additions and 38 deletions

View file

@ -38,7 +38,7 @@
#include "tgsi/tgsi_scan.h"
#include "util/os_time.h"
#include <inttypes.h>
#include "pipe/p_config.h"
#include "util/detect.h"
void
dd_get_debug_filename_and_mkdir(char *buf, size_t buflen, bool verbose)

View file

@ -37,7 +37,7 @@
#include "util/u_debug.h"
#include "util/u_string.h"
#include "pipe/p_config.h"
#include "util/detect.h"
#if defined(PIPE_OS_UNIX)
#include <unistd.h>
#include <sys/stat.h>

View file

@ -38,7 +38,7 @@
* @author Jose Fonseca <jfonseca@vmware.com>
*/
#include "pipe/p_config.h"
#include "util/detect.h"
#include <stdio.h>
#include <stdlib.h>

View file

@ -26,7 +26,7 @@
**************************************************************************/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "pipe/p_compiler.h"
#include "util/macros.h"
#include "util/u_cpu_detect.h"

View file

@ -87,7 +87,7 @@
#include "c11/threads.h"
#include "util/u_thread.h"
#include "pipe/p_config.h"
#include "util/detect.h"
#include "util/u_debug.h"
#include "util/u_cpu_detect.h"

View file

@ -37,7 +37,7 @@
* @author Jose Fonseca <jfonseca@vmware.com>
*/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "pipe/p_shader_tokens.h"
#include "util/u_debug.h"
#include "util/u_math.h"

View file

@ -36,7 +36,7 @@
* Brian Paul, and others.
*/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "pipe/p_shader_tokens.h"
#include "util/u_debug.h"
#include "util/u_math.h"

View file

@ -34,7 +34,7 @@
*/
#include "pipe/p_config.h"
#include "util/detect.h"
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
#include <unistd.h>

View file

@ -22,7 +22,7 @@
*
**************************************************************************/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "util/u_cpu_detect.h"
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)

View file

@ -26,7 +26,7 @@
#define _RTASM_X86SSE_H_
#include "pipe/p_compiler.h"
#include "pipe/p_config.h"
#include "util/detect.h"
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)

View file

@ -30,7 +30,7 @@
* Keith Whitwell <keithw@vmware.com>
*/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "pipe/p_state.h"
#include "translate.h"

View file

@ -26,7 +26,7 @@
*/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "pipe/p_compiler.h"
#include "util/u_memory.h"
#include "util/u_cpu_detect.h"

View file

@ -37,7 +37,7 @@
#ifndef U_SSE_H_
#define U_SSE_H_
#include "pipe/p_config.h"
#include "util/detect.h"
#include "pipe/p_compiler.h"
#include "util/u_debug.h"

View file

@ -26,7 +26,7 @@
**************************************************************************/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "util/u_math.h"
#include "util/u_cpu_detect.h"

View file

@ -26,7 +26,7 @@
**************************************************************************/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "util/u_math.h"
#include "util/u_cpu_detect.h"

View file

@ -26,7 +26,7 @@
**************************************************************************/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "util/u_math.h"
#include "util/u_cpu_detect.h"

View file

@ -26,7 +26,7 @@
**************************************************************************/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "util/u_math.h"
#include "util/u_cpu_detect.h"

View file

@ -26,7 +26,7 @@
**************************************************************************/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "util/u_math.h"
#include "util/u_cpu_detect.h"

View file

@ -26,7 +26,7 @@
**************************************************************************/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "util/u_math.h"
#include "util/u_cpu_detect.h"

View file

@ -36,7 +36,7 @@
#include "pan_earlyzs.h"
#include "pipe/p_compiler.h"
#include "pipe/p_config.h"
#include "util/detect.h"
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_format.h"

View file

@ -34,7 +34,7 @@
#include "tgsi/tgsi_parse.h"
#include "pipe/p_config.h"
#include "util/detect.h"
#include "r300_cb.h"
#include "r300_context.h"

View file

@ -29,7 +29,7 @@
#include "vk_cmd_enqueue_entrypoints.h"
#include "vk_sampler.h"
#include "vk_util.h"
#include "pipe/p_config.h"
#include "util/detect.h"
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#include "pipe/p_context.h"

View file

@ -22,7 +22,7 @@
*/
#include "lvp_private.h"
#include "pipe/p_config.h"
#include "util/detect.h"
#include "pipe/p_defines.h"
#include "util/format/u_format.h"
#include "util/u_math.h"

View file

@ -44,7 +44,7 @@
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "pipe/p_config.h"
#include "util/detect.h"
#include "util/macros.h"
#include "util/u_math.h"
#include "util/u_inlines.h"

View file

@ -29,8 +29,7 @@
#define P_COMPILER_H
#include "p_config.h"
#include "util/detect.h"
#include "util/macros.h"
#include <limits.h>

View file

@ -29,7 +29,7 @@
#ifndef PIPE_FORMAT_H
#define PIPE_FORMAT_H
#include "p_config.h"
#include "util/detect.h"
#ifdef __cplusplus
extern "C" {

View file

@ -34,7 +34,7 @@
*/
#include "pipe/p_config.h"
#include "util/detect.h"
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
#include <unistd.h>

68
src/util/detect.h Normal file
View file

@ -0,0 +1,68 @@
/**************************************************************************
*
* Copyright 2022 Yonggang Luo
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* @file
* Mesa configuration defines.
*
* This header file sets several defines based on the compiler, processor
* architecture, and operating system being used. These defines are comes
* from corresponding headers.
*
* See:
* - http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
* - echo | gcc -dM -E - | sort
* - http://msdn.microsoft.com/en-us/library/b0084kay.aspx
* - https://sourceforge.net/p/predef/wiki/Home/
*/
#ifndef UTIL_DETECT_H_
#define UTIL_DETECT_H_
#include <limits.h>
/*
* Compiler detection
*/
#include "util/detect_cc.h"
/*
* Processor architecture detection
*/
#include "util/detect_arch.h"
/*
* Endian detection detection
*/
#include "util/u_endian.h"
/*
* Operating system family detection
*/
#include "util/detect_os.h"
#endif /* UTIL_DETECT_H_ */

View file

@ -43,8 +43,8 @@
* @author José Fonseca <jfonseca@vmware.com>
*/
#ifndef P_CONFIG_H_
#define P_CONFIG_H_
#ifndef UTIL_DETECT_ARCH_H_
#define UTIL_DETECT_ARCH_H_
#include <limits.h>
/*
@ -192,4 +192,4 @@
#define PIPE_OS_CYGWIN
#endif
#endif /* P_CONFIG_H_ */
#endif /* UTIL_DETECT_ARCH_H_ */

42
src/util/detect_cc.h Normal file
View file

@ -0,0 +1,42 @@
/**************************************************************************
*
* Copyright 2022 Yonggang Luo
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* @file
* Compiler configuration defines.
*
* See:
* - http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
* - echo | gcc -dM -E - | sort
* - http://msdn.microsoft.com/en-us/library/b0084kay.aspx
* - https://sourceforge.net/p/predef/wiki/Home/
*/
#ifndef UTIL_DETECT_CC_H_
#define UTIL_DETECT_CC_H_
#endif /* UTIL_DETECT_CC_H_ */

View file

@ -29,7 +29,7 @@
#include <math.h>
#include <float.h>
#include "pipe/p_config.h"
#include "util/detect.h"
#include "util/u_memory.h"
#include "util/format/u_format_tests.h"

View file

@ -32,7 +32,7 @@
* @author Based on the work of Eric Anholt <anholt@FreeBSD.org>
*/
#include "pipe/p_config.h"
#include "util/detect.h"
#include "pipe/p_compiler.h"
#include "util/u_debug.h"

View file

@ -32,7 +32,7 @@
* @author José Fonseca <jfonseca@vmware.com>
*/
#include "pipe/p_config.h"
#include "util/detect.h"
#define DEBUG_MEMORY_IMPLEMENTATION

View file

@ -27,7 +27,7 @@
#ifndef U_DEBUG_REFCNT_H_
#define U_DEBUG_REFCNT_H_
#include "pipe/p_config.h"
#include "util/detect.h"
#include "pipe/p_state.h"
#ifdef __cplusplus

View file

@ -36,7 +36,7 @@
#include "util/u_debug.h"
#include "u_debug_symbol.h"
#include "u_debug_stack.h"
#include "pipe/p_config.h"
#include "util/detect.h"
#if defined(HAVE_LIBUNWIND)

View file

@ -27,7 +27,7 @@
#include "pipe/p_config.h"
#include "util/detect.h"
#include "util/u_math.h"
#include "util/u_cpu_detect.h"

View file

@ -25,7 +25,7 @@
*
**************************************************************************/
#include "pipe/p_config.h"
#include "util/detect.h"
static inline void *
util_memset32(void *s, uint32_t ui, size_t n)