mapi: replace mapi_table abstraction
Replace all instances of mapi_table with the actual struct _glapi_table. The former may have been needed when the OpenVG was around. But since that one is long gone, there' no point in having the current confusing mix of the two. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:

committed by
Emil Velikov

parent
424cb9d3ea
commit
4562d88c1d
@@ -53,7 +53,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static inline const struct mapi_table *
|
||||
static inline const struct _glapi_table *
|
||||
entry_current_get(void)
|
||||
{
|
||||
#ifdef MAPI_MODE_BRIDGE
|
||||
|
@@ -60,5 +60,5 @@ _glapi_set_context(void *context)
|
||||
void
|
||||
_glapi_set_dispatch(struct _glapi_table *dispatch)
|
||||
{
|
||||
u_current_set_table((const struct mapi_table *) dispatch);
|
||||
u_current_set_table((const struct _glapi_table *) dispatch);
|
||||
}
|
||||
|
@@ -437,7 +437,7 @@ class ABIPrinter(object):
|
||||
if ent.ret:
|
||||
ret = 'return '
|
||||
stmt1 = self.indent
|
||||
stmt1 += 'const struct mapi_table *_tbl = %s();' % (
|
||||
stmt1 += 'const struct _glapi_table *_tbl = %s();' % (
|
||||
self.current_get)
|
||||
stmt2 = self.indent
|
||||
stmt2 += 'mapi_func _func = ((const mapi_func *) _tbl)[%d];' % (
|
||||
|
@@ -65,7 +65,7 @@ _glapi_set_context(void *context)
|
||||
void
|
||||
_glapi_set_dispatch(struct _glapi_table *dispatch)
|
||||
{
|
||||
u_current_set_table((const struct mapi_table *) dispatch);
|
||||
u_current_set_table((const struct _glapi_table *) dispatch);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#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 mapi_table;
|
||||
struct _glapi_table;
|
||||
|
||||
extern const mapi_func table_noop_array[];
|
||||
|
||||
@@ -52,17 +52,17 @@ table_set_noop_handler(nop_handler_proc func);
|
||||
/**
|
||||
* Get the no-op dispatch table.
|
||||
*/
|
||||
static inline const struct mapi_table *
|
||||
static inline const struct _glapi_table *
|
||||
table_get_noop(void)
|
||||
{
|
||||
return (const struct mapi_table *) table_noop_array;
|
||||
return (const struct _glapi_table *) table_noop_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the function of a slot.
|
||||
*/
|
||||
static inline void
|
||||
table_set_func(struct mapi_table *tbl, int slot, mapi_func func)
|
||||
table_set_func(struct _glapi_table *tbl, int slot, mapi_func func)
|
||||
{
|
||||
mapi_func *funcs = (mapi_func *) tbl;
|
||||
funcs[slot] = func;
|
||||
@@ -72,7 +72,7 @@ table_set_func(struct mapi_table *tbl, int slot, mapi_func func)
|
||||
* Return the function of a slot.
|
||||
*/
|
||||
static inline mapi_func
|
||||
table_get_func(const struct mapi_table *tbl, int slot)
|
||||
table_get_func(const struct _glapi_table *tbl, int slot)
|
||||
{
|
||||
const mapi_func *funcs = (const mapi_func *) tbl;
|
||||
return funcs[slot];
|
||||
|
@@ -99,17 +99,17 @@ extern void (*__glapi_noop_table[])(void);
|
||||
/*@{*/
|
||||
#if defined(GLX_USE_TLS)
|
||||
|
||||
__thread struct mapi_table *u_current_table
|
||||
__thread struct _glapi_table *u_current_table
|
||||
__attribute__((tls_model("initial-exec")))
|
||||
= (struct mapi_table *) table_noop_array;
|
||||
= (struct _glapi_table *) table_noop_array;
|
||||
|
||||
__thread void *u_current_context
|
||||
__attribute__((tls_model("initial-exec")));
|
||||
|
||||
#else
|
||||
|
||||
struct mapi_table *u_current_table =
|
||||
(struct mapi_table *) table_noop_array;
|
||||
struct _glapi_table *u_current_table =
|
||||
(struct _glapi_table *) table_noop_array;
|
||||
void *u_current_context;
|
||||
|
||||
tss_t u_current_table_tsd;
|
||||
@@ -259,17 +259,17 @@ u_current_get_context_internal(void)
|
||||
* table (__glapi_noop_table).
|
||||
*/
|
||||
void
|
||||
u_current_set_table(const struct mapi_table *tbl)
|
||||
u_current_set_table(const struct _glapi_table *tbl)
|
||||
{
|
||||
u_current_init();
|
||||
|
||||
stub_init_once();
|
||||
|
||||
if (!tbl)
|
||||
tbl = (const struct mapi_table *) table_noop_array;
|
||||
tbl = (const struct _glapi_table *) table_noop_array;
|
||||
|
||||
#if defined(GLX_USE_TLS)
|
||||
u_current_table = (struct mapi_table *) tbl;
|
||||
u_current_table = (struct _glapi_table *) tbl;
|
||||
#else
|
||||
tss_set(u_current_table_tsd, (void *) tbl);
|
||||
u_current_table = (ThreadSafe) ? NULL : (void *) tbl;
|
||||
@@ -279,15 +279,15 @@ u_current_set_table(const struct mapi_table *tbl)
|
||||
/**
|
||||
* Return pointer to current dispatch table for calling thread.
|
||||
*/
|
||||
struct mapi_table *
|
||||
struct _glapi_table *
|
||||
u_current_get_table_internal(void)
|
||||
{
|
||||
#if defined(GLX_USE_TLS)
|
||||
return u_current_table;
|
||||
#else
|
||||
if (ThreadSafe)
|
||||
return (struct mapi_table *) tss_get(u_current_table_tsd);
|
||||
return (struct _glapi_table *) tss_get(u_current_table_tsd);
|
||||
else
|
||||
return (struct mapi_table *) u_current_table;
|
||||
return (struct _glapi_table *) u_current_table;
|
||||
#endif
|
||||
}
|
||||
|
@@ -10,9 +10,6 @@
|
||||
|
||||
#include "glapi/glapi.h"
|
||||
|
||||
/* ugly renames to match glapi.h */
|
||||
#define mapi_table _glapi_table
|
||||
|
||||
#ifdef GLX_USE_TLS
|
||||
#define u_current_table _glapi_tls_Dispatch
|
||||
#define u_current_context _glapi_tls_Context
|
||||
@@ -28,11 +25,11 @@
|
||||
|
||||
#else /* MAPI_MODE_UTIL || MAPI_MODE_GLAPI || MAPI_MODE_BRIDGE */
|
||||
|
||||
struct mapi_table;
|
||||
struct _glapi_table;
|
||||
|
||||
#ifdef GLX_USE_TLS
|
||||
|
||||
extern __thread struct mapi_table *u_current_table
|
||||
extern __thread struct _glapi_table *u_current_table
|
||||
__attribute__((tls_model("initial-exec")));
|
||||
|
||||
extern __thread void *u_current_context
|
||||
@@ -40,7 +37,7 @@ extern __thread void *u_current_context
|
||||
|
||||
#else /* GLX_USE_TLS */
|
||||
|
||||
extern struct mapi_table *u_current_table;
|
||||
extern struct _glapi_table *u_current_table;
|
||||
extern void *u_current_context;
|
||||
|
||||
#endif /* GLX_USE_TLS */
|
||||
@@ -54,9 +51,9 @@ void
|
||||
u_current_destroy(void);
|
||||
|
||||
void
|
||||
u_current_set_table(const struct mapi_table *tbl);
|
||||
u_current_set_table(const struct _glapi_table *tbl);
|
||||
|
||||
struct mapi_table *
|
||||
struct _glapi_table *
|
||||
u_current_get_table_internal(void);
|
||||
|
||||
void
|
||||
@@ -65,7 +62,7 @@ u_current_set_context(const void *ptr);
|
||||
void *
|
||||
u_current_get_context_internal(void);
|
||||
|
||||
static inline const struct mapi_table *
|
||||
static inline const struct _glapi_table *
|
||||
u_current_get_table(void)
|
||||
{
|
||||
#ifdef GLX_USE_TLS
|
||||
|
Reference in New Issue
Block a user