/*1* Mesa 3-D graphics library2*3* Copyright (C) 2010 LunarG Inc.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the "Software"),7* to deal in the Software without restriction, including without limitation8* the rights to use, copy, modify, merge, publish, distribute, sublicense,9* and/or sell copies of the Software, and to permit persons to whom the10* Software is furnished to do so, subject to the following conditions:11*12* The above copyright notice and this permission notice shall be included13* in all copies or substantial portions of the Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL18* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING20* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER21* DEALINGS IN THE SOFTWARE.22*23* Authors:24* Chia-I Wu <[email protected]>25*/2627#include <stdlib.h>28#include <stdint.h>2930#include "entry.h"31#include "u_current.h"32#include "util/u_endian.h"3334#define _U_STRINGIFY(x) #x35#define U_STRINGIFY(x) _U_STRINGIFY(x)3637/* define macros for use by assembly dispatchers */38#define ENTRY_CURRENT_TABLE U_STRINGIFY(u_current_table)3940/* in bridge mode, mapi is a user of glapi */41#ifdef MAPI_MODE_BRIDGE42#define ENTRY_CURRENT_TABLE_GET "_glapi_get_dispatch"43#else44#define ENTRY_CURRENT_TABLE_GET U_STRINGIFY(u_current_get_table_internal)45#endif4647#if defined(USE_X86_ASM) && defined(__GNUC__)48# ifdef USE_ELF_TLS49# include "entry_x86_tls.h"50# else51# include "entry_x86_tsd.h"52# endif53#elif defined(USE_X86_64_ASM) && defined(__GNUC__) && defined(USE_ELF_TLS)54# include "entry_x86-64_tls.h"55#elif defined(USE_PPC64LE_ASM) && defined(__GNUC__) && UTIL_ARCH_LITTLE_ENDIAN56# ifdef USE_ELF_TLS57# include "entry_ppc64le_tls.h"58# else59# include "entry_ppc64le_tsd.h"60# endif61#else6263static inline const struct _glapi_table *64entry_current_get(void)65{66#ifdef MAPI_MODE_BRIDGE67return GET_DISPATCH();68#else69return u_current_get_table_internal();70#endif71}7273/* C version of the public entries */74#define MAPI_TMP_DEFINES75#define MAPI_TMP_PUBLIC_DECLARES76#define MAPI_TMP_PUBLIC_ENTRIES77#include "mapi_tmp.h"7879#ifndef MAPI_MODE_BRIDGE8081void82entry_patch_public(void)83{84}8586mapi_func87entry_get_public(int slot)88{89/* pubic_entries are defined by MAPI_TMP_PUBLIC_ENTRIES */90return public_entries[slot];91}9293mapi_func94entry_generate(int slot)95{96return NULL;97}9899void100entry_patch(mapi_func entry, int slot)101{102}103104#endif /* MAPI_MODE_BRIDGE */105106#endif /* asm */107108109