diff --git a/src/mapi/entry.c b/src/mapi/entry.c deleted file mode 100644 index d81c67dcb15..00000000000 --- a/src/mapi/entry.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2010 LunarG Inc. - * - * 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, sublicense, - * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS 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. - * - * Authors: - * Chia-I Wu - */ - -#include -#include - -#include "entry.h" -#include "glapi/glapi.h" -#include "util/u_endian.h" -#include "util/u_thread.h" - -#define _U_STRINGIFY(x) #x -#define U_STRINGIFY(x) _U_STRINGIFY(x) - -/* REALLY_INITIAL_EXEC implies __GLIBC__ */ -#if defined(USE_X86_ASM) && defined(REALLY_INITIAL_EXEC) -#include "entry_x86_tls.h" -#elif defined(USE_X86_64_ASM) && defined(REALLY_INITIAL_EXEC) -#include "entry_x86-64_tls.h" -#elif defined(USE_PPC64LE_ASM) && UTIL_ARCH_LITTLE_ENDIAN && defined(REALLY_INITIAL_EXEC) -#include "entry_ppc64le_tls.h" -#else - -/* C version of the public entries */ -#define MAPI_TMP_DEFINES -#define MAPI_TMP_PUBLIC_DECLARES -#define MAPI_TMP_PUBLIC_ENTRIES -#include "mapi_tmp.h" - -#ifndef MAPI_MODE_BRIDGE - -void -entry_patch_public(void) -{ -} - -mapi_func -entry_get_public(int slot) -{ - /* pubic_entries are defined by MAPI_TMP_PUBLIC_ENTRIES */ - return public_entries[slot]; -} - -#endif /* MAPI_MODE_BRIDGE */ - -#if defined(_WIN32) && defined(_WINDOWS_) -#error "Should not include here" -#endif - -#endif /* asm */ diff --git a/src/mapi/entry_ppc64le_tls.h b/src/mapi/entry_ppc64le_tls.h index f1fbae509f5..de3509bc8fd 100644 --- a/src/mapi/entry_ppc64le_tls.h +++ b/src/mapi/entry_ppc64le_tls.h @@ -31,6 +31,9 @@ #define HIDDEN #endif +#define _U_STRINGIFY(x) #x +#define U_STRINGIFY(x) _U_STRINGIFY(x) + // NOTE: These must be powers of two: #define PPC64LE_ENTRY_SIZE 64 #define PPC64LE_PAGE_ALIGN 65536 diff --git a/src/mapi/es1api/libgles1_public.c b/src/mapi/es1api/libgles1_public.c new file mode 100644 index 00000000000..ab543bfcacc --- /dev/null +++ b/src/mapi/es1api/libgles1_public.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2010 LunarG Inc. + * SPDX-License-Identifier: MIT + * + * Authors: + * Chia-I Wu + */ + +#include +#include + +#include "entry.h" +#include "glapi/glapi.h" +#include "util/u_endian.h" +#include "util/u_thread.h" + +/* REALLY_INITIAL_EXEC implies __GLIBC__ */ +#if defined(USE_X86_ASM) && defined(REALLY_INITIAL_EXEC) +#include "entry_x86_tls.h" +#elif defined(USE_X86_64_ASM) && defined(REALLY_INITIAL_EXEC) +#include "entry_x86-64_tls.h" +#elif defined(USE_PPC64LE_ASM) && UTIL_ARCH_LITTLE_ENDIAN && defined(REALLY_INITIAL_EXEC) +#include "entry_ppc64le_tls.h" +#else + +/* C version of the public entries */ +#define MAPI_TMP_DEFINES +#define MAPI_TMP_PUBLIC_ENTRIES +#include "mapi_tmp.h" + +#ifndef MAPI_MODE_BRIDGE + +mapi_func +entry_get_public(int slot) +{ + /* pubic_entries are defined by MAPI_TMP_PUBLIC_ENTRIES */ + return public_entries[slot]; +} + +#endif /* MAPI_MODE_BRIDGE */ + +#if defined(_WIN32) && defined(_WINDOWS_) +#error "Should not include here" +#endif + +#endif /* asm */ diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build index 008c293223c..e2f72d6c4da 100644 --- a/src/mapi/es1api/meson.build +++ b/src/mapi/es1api/meson.build @@ -24,7 +24,7 @@ gles1_def = custom_target( libglesv1_cm = shared_library( 'GLESv1_CM' + get_option('gles-lib-suffix'), - ['../entry.c', es1_glapi_mapi_tmp_h], + ['libgles1_public.c', es1_glapi_mapi_tmp_h], vs_module_defs : gles1_def, c_args : [ c_msvc_compat_args, diff --git a/src/mapi/es2api/libgles2_public.c b/src/mapi/es2api/libgles2_public.c new file mode 100644 index 00000000000..ab543bfcacc --- /dev/null +++ b/src/mapi/es2api/libgles2_public.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2010 LunarG Inc. + * SPDX-License-Identifier: MIT + * + * Authors: + * Chia-I Wu + */ + +#include +#include + +#include "entry.h" +#include "glapi/glapi.h" +#include "util/u_endian.h" +#include "util/u_thread.h" + +/* REALLY_INITIAL_EXEC implies __GLIBC__ */ +#if defined(USE_X86_ASM) && defined(REALLY_INITIAL_EXEC) +#include "entry_x86_tls.h" +#elif defined(USE_X86_64_ASM) && defined(REALLY_INITIAL_EXEC) +#include "entry_x86-64_tls.h" +#elif defined(USE_PPC64LE_ASM) && UTIL_ARCH_LITTLE_ENDIAN && defined(REALLY_INITIAL_EXEC) +#include "entry_ppc64le_tls.h" +#else + +/* C version of the public entries */ +#define MAPI_TMP_DEFINES +#define MAPI_TMP_PUBLIC_ENTRIES +#include "mapi_tmp.h" + +#ifndef MAPI_MODE_BRIDGE + +mapi_func +entry_get_public(int slot) +{ + /* pubic_entries are defined by MAPI_TMP_PUBLIC_ENTRIES */ + return public_entries[slot]; +} + +#endif /* MAPI_MODE_BRIDGE */ + +#if defined(_WIN32) && defined(_WINDOWS_) +#error "Should not include here" +#endif + +#endif /* asm */ diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build index 737ae4cf044..26c475eb63e 100644 --- a/src/mapi/es2api/meson.build +++ b/src/mapi/es2api/meson.build @@ -24,7 +24,7 @@ gles2_def = custom_target( libgles2 = shared_library( 'GLESv2' + get_option('gles-lib-suffix'), - ['../entry.c', es2_glapi_mapi_tmp_h], + ['libgles2_public.c', es2_glapi_mapi_tmp_h], vs_module_defs : gles2_def, c_args : [ c_msvc_compat_args, diff --git a/src/mapi/glapi/libgl_public.c b/src/mapi/glapi/libgl_public.c new file mode 100644 index 00000000000..ab543bfcacc --- /dev/null +++ b/src/mapi/glapi/libgl_public.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2010 LunarG Inc. + * SPDX-License-Identifier: MIT + * + * Authors: + * Chia-I Wu + */ + +#include +#include + +#include "entry.h" +#include "glapi/glapi.h" +#include "util/u_endian.h" +#include "util/u_thread.h" + +/* REALLY_INITIAL_EXEC implies __GLIBC__ */ +#if defined(USE_X86_ASM) && defined(REALLY_INITIAL_EXEC) +#include "entry_x86_tls.h" +#elif defined(USE_X86_64_ASM) && defined(REALLY_INITIAL_EXEC) +#include "entry_x86-64_tls.h" +#elif defined(USE_PPC64LE_ASM) && UTIL_ARCH_LITTLE_ENDIAN && defined(REALLY_INITIAL_EXEC) +#include "entry_ppc64le_tls.h" +#else + +/* C version of the public entries */ +#define MAPI_TMP_DEFINES +#define MAPI_TMP_PUBLIC_ENTRIES +#include "mapi_tmp.h" + +#ifndef MAPI_MODE_BRIDGE + +mapi_func +entry_get_public(int slot) +{ + /* pubic_entries are defined by MAPI_TMP_PUBLIC_ENTRIES */ + return public_entries[slot]; +} + +#endif /* MAPI_MODE_BRIDGE */ + +#if defined(_WIN32) && defined(_WINDOWS_) +#error "Should not include here" +#endif + +#endif /* asm */ diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build index 37455f28de8..9b08dd628a0 100644 --- a/src/mapi/glapi/meson.build +++ b/src/mapi/glapi/meson.build @@ -6,7 +6,7 @@ subdir('gen') inc_glapi = include_directories('.') bridge_glapi_files = files( - '../entry.c', + 'libgl_public.c', '../entry.h', '../entry_x86-64_tls.h', '../entry_x86_tls.h', diff --git a/src/mapi/shared-glapi/core.c b/src/mapi/shared-glapi/core.c new file mode 100644 index 00000000000..ab543bfcacc --- /dev/null +++ b/src/mapi/shared-glapi/core.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2010 LunarG Inc. + * SPDX-License-Identifier: MIT + * + * Authors: + * Chia-I Wu + */ + +#include +#include + +#include "entry.h" +#include "glapi/glapi.h" +#include "util/u_endian.h" +#include "util/u_thread.h" + +/* REALLY_INITIAL_EXEC implies __GLIBC__ */ +#if defined(USE_X86_ASM) && defined(REALLY_INITIAL_EXEC) +#include "entry_x86_tls.h" +#elif defined(USE_X86_64_ASM) && defined(REALLY_INITIAL_EXEC) +#include "entry_x86-64_tls.h" +#elif defined(USE_PPC64LE_ASM) && UTIL_ARCH_LITTLE_ENDIAN && defined(REALLY_INITIAL_EXEC) +#include "entry_ppc64le_tls.h" +#else + +/* C version of the public entries */ +#define MAPI_TMP_DEFINES +#define MAPI_TMP_PUBLIC_ENTRIES +#include "mapi_tmp.h" + +#ifndef MAPI_MODE_BRIDGE + +mapi_func +entry_get_public(int slot) +{ + /* pubic_entries are defined by MAPI_TMP_PUBLIC_ENTRIES */ + return public_entries[slot]; +} + +#endif /* MAPI_MODE_BRIDGE */ + +#if defined(_WIN32) && defined(_WINDOWS_) +#error "Should not include here" +#endif + +#endif /* asm */ diff --git a/src/mapi/shared-glapi/meson.build b/src/mapi/shared-glapi/meson.build index b605f0a0d9e..c71f59fe3d9 100644 --- a/src/mapi/shared-glapi/meson.build +++ b/src/mapi/shared-glapi/meson.build @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MIT files_shared_glapi = files( - '../entry.c', + 'core.c', '../u_current.c', 'glapi.c', 'stub.c',