3d9168a724399a4600261da6ab8d6703bd7585c6
2 * Mesa 3-D graphics library
5 * Copyright (C) 2010 LunarG Inc.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
26 * Chia-I Wu <olv@lunarg.com>
30 #include "u_current.h"
33 /* define macros for use by assembly dispatchers */
34 #define ENTRY_CURRENT_TABLE U_STRINGIFY(u_current_table)
36 /* in bridge mode, mapi is a user of glapi */
37 #ifdef MAPI_MODE_BRIDGE
38 #define ENTRY_CURRENT_TABLE_GET "_glapi_get_dispatch"
40 #define ENTRY_CURRENT_TABLE_GET U_STRINGIFY(u_current_get_internal)
43 #if defined(USE_X86_ASM) && defined(__GNUC__)
45 # include "entry_x86_tls.h"
47 # include "entry_x86_tsd.h"
49 #elif defined(USE_X86_64_ASM) && defined(__GNUC__) && defined(GLX_USE_TLS)
50 # include "entry_x86-64_tls.h"
55 static INLINE
const struct mapi_table
*
56 entry_current_get(void)
58 #ifdef MAPI_MODE_BRIDGE
59 return GET_DISPATCH();
61 return u_current_get();
65 /* C version of the public entries */
66 #define MAPI_TMP_DEFINES
67 #define MAPI_TMP_PUBLIC_DECLARES
68 #define MAPI_TMP_PUBLIC_ENTRIES
71 #ifndef MAPI_MODE_BRIDGE
74 entry_patch_public(void)
79 entry_get_public(int slot
)
81 /* pubic_entries are defined by MAPI_TMP_PUBLIC_ENTRIES */
82 return public_entries
[slot
];
86 entry_generate(int slot
)
92 entry_patch(mapi_func entry
, int slot
)
96 #endif /* MAPI_MODE_BRIDGE */