diff --git a/src/mapi/entry.c b/src/mapi/entry.c index 7bc2b7820cb..23fd26e82e3 100644 --- a/src/mapi/entry.c +++ b/src/mapi/entry.c @@ -29,7 +29,7 @@ #include #include "entry.h" -#include "u_current.h" +#include "glapi/glapi.h" #include "util/u_endian.h" #include "util/u_thread.h" diff --git a/src/mapi/glapi/glapi.c b/src/mapi/glapi/glapi.c deleted file mode 100644 index 27ca39fd254..00000000000 --- a/src/mapi/glapi/glapi.c +++ /dev/null @@ -1,39 +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 "glapi/glapi.h" -#include "u_current.h" - -/* - * _mesa_glapi_Dispatch, _glapi_Context - * _mesa_glapi_tls_Dispatch, _mesa_glapi_tls_Context, - * _mesa_glapi_set_context, _mesa_glapi_get_context, - * _glapi_destroy_multithread, _glapi_check_multithread - * _mesa_glapi_set_dispatch, and _mesa_glapi_get_dispatch - * are defined in u_current.c. - */ - diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h index 4a0d6a8b44c..02ad397f57b 100644 --- a/src/mapi/glapi/glapi.h +++ b/src/mapi/glapi/glapi.h @@ -86,7 +86,6 @@ _GLAPI_EXPORT extern __THREAD_INITIAL_EXEC void * _mesa_glapi_tls_Context; #endif _GLAPI_EXPORT extern const struct _glapi_table *_mesa_glapi_Dispatch; -_GLAPI_EXPORT extern const void *_glapi_Context; #if DETECT_OS_WINDOWS && !defined(MAPI_MODE_UTIL) && !defined(MAPI_MODE_GLAPI) # define GET_DISPATCH() _mesa_glapi_get_dispatch() @@ -96,13 +95,6 @@ _GLAPI_EXPORT extern const void *_glapi_Context; # define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _mesa_glapi_tls_Context #endif -_GLAPI_EXPORT void -_glapi_destroy_multithread(void); - - -_GLAPI_EXPORT void -_glapi_check_multithread(void); - _GLAPI_EXPORT void _mesa_glapi_set_context(void *context); @@ -124,9 +116,6 @@ _GLAPI_EXPORT unsigned int _mesa_glapi_get_dispatch_table_size(void); -_GLAPI_EXPORT int -_glapi_add_dispatch( const char * function_name ); - _GLAPI_EXPORT int _mesa_glapi_get_proc_offset(const char *funcName); @@ -156,22 +145,6 @@ _GLAPI_EXPORT struct _glapi_table * _glapi_new_nop_table(unsigned num_entries); -/** Deprecated function */ -_GLAPI_EXPORT unsigned long -_glthread_GetID(void); - - -/* - * These stubs are kept so that the old DRI drivers still load. - */ -_GLAPI_EXPORT void -_glapi_noop_enable_warnings(unsigned char enable); - - -_GLAPI_EXPORT void -_glapi_set_warning_func(_glapi_proc func); - - #ifdef __cplusplus } #endif diff --git a/src/mapi/glapi/glapi_getproc.c b/src/mapi/glapi/glapi_getproc.c index 649a6050f01..acb3b400ef6 100644 --- a/src/mapi/glapi/glapi_getproc.c +++ b/src/mapi/glapi/glapi_getproc.c @@ -87,18 +87,6 @@ get_static_proc_offset(const char *funcName) * Extension function management. */ -/** - * Initializes the glapi relocs table, and returns the offset of the given - * function in the dispatch table. - */ -int -_glapi_add_dispatch(const char *funcName) -{ - init_glapi_relocs_once(); - - return get_static_proc_offset(funcName); -} - /** * Return offset of entrypoint for named function within dispatch table. */ diff --git a/src/mapi/glapi/glapi_nop.c b/src/mapi/glapi/glapi_nop.c index 2e130e63ebc..d15cddb5e85 100644 --- a/src/mapi/glapi/glapi_nop.c +++ b/src/mapi/glapi/glapi_nop.c @@ -49,17 +49,6 @@ #include "glapi/glapi_priv.h" -void -_glapi_noop_enable_warnings(unsigned char enable) -{ -} - -void -_glapi_set_warning_func(_glapi_proc func) -{ -} - - /** * We'll jump though this function pointer whenever a no-op function * is called. diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build index d15a59caadc..88b4b4b40de 100644 --- a/src/mapi/glapi/meson.build +++ b/src/mapi/glapi/meson.build @@ -39,12 +39,10 @@ if with_platform_windows endif static_glapi_files += files( '../u_current.c', - '../u_current.h', 'glapi_dispatch.c', 'glapi_entrypoint.c', 'glapi_getproc.c', 'glapi_nop.c', - 'glapi.c', 'glapi.h', 'glapi_priv.h', ) diff --git a/src/mapi/shared-glapi/glapi.c b/src/mapi/shared-glapi/glapi.c index 78fb7663e0d..4cd2dcf48d6 100644 --- a/src/mapi/shared-glapi/glapi.c +++ b/src/mapi/shared-glapi/glapi.c @@ -29,15 +29,13 @@ #include #include #include "glapi/glapi.h" -#include "u_current.h" #include "table.h" /* for MAPI_TABLE_NUM_SLOTS */ #include "stub.h" /* - * _mesa_glapi_Dispatch, _glapi_Context + * _mesa_glapi_Dispatch, * _mesa_glapi_tls_Dispatch, _mesa_glapi_tls_Context, * _mesa_glapi_set_context, _mesa_glapi_get_context, - * _glapi_destroy_multithread, _glapi_check_multithread * _mesa_glapi_set_dispatch, and _mesa_glapi_get_dispatch * are defined in u_current.c. */ @@ -52,22 +50,6 @@ _mesa_glapi_get_dispatch_table_size(void) return MAPI_TABLE_NUM_SLOTS; } -/** - * Initializes the glapi relocs table (no-op for shared-glapi), and returns the - * offset of the given function in the dispatch table. - */ -int -_glapi_add_dispatch( const char * function_name ) -{ - assert(function_name[0] == 'g' && function_name[1] == 'l'); - - const struct mapi_stub *stub = stub_find_public(function_name + 2); - if (!stub) - return -1; - - return stub_get_slot(stub); -} - static const struct mapi_stub * _glapi_get_stub(const char *name) { @@ -132,23 +114,3 @@ _glapi_set_nop_handler(_glapi_nop_handler_proc func) { table_set_noop_handler(func); } - -/** - * This is a deprecated function which should not be used anymore. - * It's only present to satisfy linking with older versions of libGL. - */ -unsigned long -_glthread_GetID(void) -{ - return 0; -} - -void -_glapi_noop_enable_warnings(unsigned char enable) -{ -} - -void -_glapi_set_warning_func(_glapi_proc func) -{ -} diff --git a/src/mapi/shared-glapi/meson.build b/src/mapi/shared-glapi/meson.build index dc7be9cdc07..f2fe87a547f 100644 --- a/src/mapi/shared-glapi/meson.build +++ b/src/mapi/shared-glapi/meson.build @@ -4,7 +4,6 @@ files_shared_glapi = files( '../entry.c', '../u_current.c', - '../u_current.h', 'glapi.c', 'stub.c', 'stub.h', diff --git a/src/mapi/shared-glapi/stub.c b/src/mapi/shared-glapi/stub.c index 0bf54a89ffc..0be8258a2ec 100644 --- a/src/mapi/shared-glapi/stub.c +++ b/src/mapi/shared-glapi/stub.c @@ -32,7 +32,7 @@ #include "util/macros.h" #include "util/simple_mtx.h" -#include "u_current.h" +#include "glapi/glapi.h" #include "entry.h" #include "stub.h" #include "table.h" diff --git a/src/mapi/shared-glapi/table.h b/src/mapi/shared-glapi/table.h index fd70cc4106d..7c57f690ac0 100644 --- a/src/mapi/shared-glapi/table.h +++ b/src/mapi/shared-glapi/table.h @@ -34,47 +34,14 @@ #include "mapi_tmp.h" #define MAPI_TABLE_NUM_SLOTS (MAPI_TABLE_NUM_STATIC + MAPI_TABLE_NUM_DYNAMIC) -#define MAPI_TABLE_SIZE (MAPI_TABLE_NUM_SLOTS * sizeof(mapi_func)) struct _glapi_table; extern const mapi_func table_noop_array[]; - typedef void (*nop_handler_proc)(const char *name); - void table_set_noop_handler(nop_handler_proc func); - -/** - * Get the no-op dispatch table. - */ -static inline const struct _glapi_table * -table_get_noop(void) -{ - return (const struct _glapi_table *) table_noop_array; -} - -/** - * Set the function of a slot. - */ -static inline void -table_set_func(struct _glapi_table *tbl, int slot, mapi_func func) -{ - mapi_func *funcs = (mapi_func *) tbl; - funcs[slot] = func; -} - -/** - * Return the function of a slot. - */ -static inline mapi_func -table_get_func(const struct _glapi_table *tbl, int slot) -{ - const mapi_func *funcs = (const mapi_func *) tbl; - return funcs[slot]; -} - #endif /* _TABLE_H_ */ diff --git a/src/mapi/u_current.c b/src/mapi/u_current.c index 831af741ca8..038db13a3ad 100644 --- a/src/mapi/u_current.c +++ b/src/mapi/u_current.c @@ -28,29 +28,12 @@ * The dispatch table (struct _glapi_table) is basically just a list * of function pointers. * There are functions to set/get the current dispatch table for the - * current thread and to manage registration/dispatch of dynamically - * added extension functions. - * - * It's intended that this file and the other glapi*.[ch] files are - * flexible enough to be reused in several places: XFree86, DRI- - * based libGL.so, and perhaps the SGI SI. - * - * NOTE: There are no dependencies on Mesa in this code. - * - * Versions (API changes): - * 2000/02/23 - original version for Mesa 3.3 and XFree86 4.0 - * 2001/01/16 - added dispatch override feature for Mesa 3.5 - * 2002/06/28 - added _glapi_set_warning_func(), Mesa 4.1. - * 2002/10/01 - _mesa_glapi_get_proc_address() will now generate new entrypoints - * itself (using offset ~0). _glapi_add_entrypoint() can be - * called afterward and it'll fill in the correct dispatch - * offset. This allows DRI libGL to avoid probing for DRI - * drivers! No changes to the public glapi interface. + * current thread. */ #include "c11/threads.h" #include "util/u_thread.h" -#include "u_current.h" +#include "glapi/glapi.h" #ifndef MAPI_MODE_UTIL @@ -77,9 +60,9 @@ extern void (*__glapi_noop_table[])(void); * purpose. * * In multi threaded case, The TLS variables \c _mesa_glapi_tls_Dispatch and - * \c _mesa_glapi_tls_Context are used. Having \c _mesa_glapi_Dispatch and \c _glapi_Context + * \c _mesa_glapi_tls_Context are used. Having \c _mesa_glapi_Dispatch * be hardcoded to \c NULL maintains binary compatability between TLS enabled - * loaders and non-TLS DRI drivers. When \c _mesa_glapi_Dispatch and \c _glapi_Context + * loaders and non-TLS DRI drivers. When \c _mesa_glapi_Dispatch * are \c NULL, the thread state data \c ContextTSD are used. Drivers and the * static dispatch functions access these variables via \c _mesa_glapi_get_dispatch * and \c _mesa_glapi_get_context. @@ -91,24 +74,10 @@ __THREAD_INITIAL_EXEC struct _glapi_table *_mesa_glapi_tls_Dispatch __THREAD_INITIAL_EXEC void *_mesa_glapi_tls_Context; -/* not used, but defined for compatibility */ const struct _glapi_table *_mesa_glapi_Dispatch; -const void *_glapi_Context; /*@}*/ -/* not used, but defined for compatibility */ -void -_glapi_destroy_multithread(void) -{ -} - -/* not used, but defined for compatibility */ -void -_glapi_check_multithread(void) -{ -} - /** * Set the current context pointer for this thread. * The context pointer is an opaque type which should be cast to diff --git a/src/mapi/u_current.h b/src/mapi/u_current.h deleted file mode 100644 index 15ef61ce821..00000000000 --- a/src/mapi/u_current.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _U_CURRENT_H_ -#define _U_CURRENT_H_ - -#include "glapi/glapi.h" - -#endif /* _U_CURRENT_H_ */