util: Move src/gallium/auxiliary/os/os_mman.h to src/util/os_mman.h

Use "util/detect_os.h" instead of "pipe/p_config.h" and "pipe/p_compiler.h"
in src/util/os_mman.h

This is a prepare to implement os_mman on windows

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/19645>
This commit is contained in:
Yonggang Luo
2022-11-10 19:25:01 +08:00
committed by Marge Bot
parent f5050d0fcd
commit 660b110494
12 changed files with 17 additions and 17 deletions

View File

@@ -24,7 +24,7 @@
* Christian Gmeiner <christian.gmeiner@gmail.com>
*/
#include "os/os_mman.h"
#include "util/os_mman.h"
#include "util/hash_table.h"
#include "etnaviv_priv.h"

View File

@@ -24,7 +24,7 @@
* Rob Clark <robclark@freedesktop.org>
*/
#include "os/os_mman.h"
#include "util/os_mman.h"
#include "freedreno_drmif.h"
#include "freedreno_priv.h"

View File

@@ -112,7 +112,6 @@ files_libgallium = files(
'hud/hud_driver_query.c',
'hud/hud_fps.c',
'hud/hud_private.h',
'os/os_mman.h',
'os/os_process.h',
'pipebuffer/pb_buffer_fenced.c',
'pipebuffer/pb_buffer_fenced.h',

View File

@@ -54,7 +54,7 @@
#include "common/intel_gem.h"
#include "dev/intel_device_info.h"
#include "isl/isl.h"
#include "os/os_mman.h"
#include "util/os_mman.h"
#include "util/u_debug.h"
#include "util/macros.h"
#include "util/hash_table.h"

View File

@@ -32,7 +32,7 @@
#include "util/u_hash_table.h"
#include "util/u_math.h"
#include "util/os_time.h"
#include "os/os_mman.h"
#include "util/os_mman.h"
#include "frontend/drm_driver.h"

View File

@@ -8,7 +8,7 @@
#include "util/format/u_format_s3tc.h"
#include "util/u_string.h"
#include "os/os_mman.h"
#include "util/os_mman.h"
#include "util/os_time.h"
#include <stdio.h>

View File

@@ -29,7 +29,7 @@
#include "util/u_hash_table.h"
#include "util/u_memory.h"
#include "util/u_thread.h"
#include "os/os_mman.h"
#include "util/os_mman.h"
#include "util/os_time.h"
#include "frontend/drm_driver.h"

View File

@@ -46,7 +46,7 @@
#include "svga3d_caps.h"
#include "svga3d_reg.h"
#include "os/os_mman.h"
#include "util/os_mman.h"
#include <errno.h>
#include <unistd.h>

View File

@@ -28,7 +28,7 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
#include "os/os_mman.h"
#include "util/os_mman.h"
#include "util/os_file.h"
#include "util/os_time.h"
#include "util/u_memory.h"

View File

@@ -27,7 +27,7 @@
#include "util/u_inlines.h"
#include "util/os_time.h"
#include "frontend/sw_winsys.h"
#include "os/os_mman.h"
#include "util/os_mman.h"
#include "virgl_vtest_winsys.h"
#include "virgl_vtest_public.h"

View File

@@ -35,7 +35,7 @@
#include "pan_util.h"
#include "wrap.h"
#include "os/os_mman.h"
#include "util/os_mman.h"
#include "util/u_inlines.h"
#include "util/u_math.h"

View File

@@ -35,11 +35,12 @@
#ifndef _OS_MMAN_H_
#define _OS_MMAN_H_
#include <assert.h>
#include <stddef.h>
#include "pipe/p_config.h"
#include "pipe/p_compiler.h"
#include "util/detect_os.h"
#if defined(PIPE_OS_UNIX)
#if DETECT_OS_UNIX
# include <sys/mman.h>
#else
# error Unsupported OS
@@ -50,7 +51,7 @@ extern "C" {
#endif
#if defined(PIPE_OS_ANDROID) && !defined(__LP64__)
#if DETECT_OS_ANDROID && !defined(__LP64__)
/* 32-bit needs mmap64 for 64-bit offsets */
# define os_mmap(addr, length, prot, flags, fd, offset) \
mmap64(addr, length, prot, flags, fd, offset)
@@ -68,8 +69,8 @@ static inline int os_munmap(void *addr, size_t length)
/* Copied from configure code generated by AC_SYS_LARGEFILE */
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + \
(((off_t) 1 << 31) << 31))
STATIC_ASSERT(LARGE_OFF_T % 2147483629 == 721 &&
LARGE_OFF_T % 2147483647 == 1);
static_assert(LARGE_OFF_T % 2147483629 == 721 &&
LARGE_OFF_T % 2147483647 == 1, "");
#undef LARGE_OFF_T
return munmap(addr, length);