⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 glapi_x86.s

📁 winNT技术操作系统,国外开放的原代码和LIUX一样
💻 S
📖 第 1 页 / 共 5 页
字号:
/* DO NOT EDIT - This file generated automatically by gl_x86_asm.py (from Mesa) script */

/*
 * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
 * (C) Copyright IBM Corporation 2004, 2005
 * All Rights Reserved.
 * 
 * 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, sub license,
 * 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 (including the next
 * paragraph) 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 NON-INFRINGEMENT.  IN NO EVENT SHALL
 * BRIAN PAUL, IBM,
 * AND/OR THEIR SUPPLIERS 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.
 */

#include "assyntax.h"
#include "glapioffsets.h"

#if defined(STDCALL_API)
# if defined(USE_MGL_NAMESPACE)
#  define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))
# else
#  define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))
# endif
#else
# if defined(USE_MGL_NAMESPACE)
#  define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))
# else
#  define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))
# endif
#endif

#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))

#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__)
#define GLOBL_FN(x) GLOBL x ; .type x, function
#else
#define GLOBL_FN(x) GLOBL x
#endif

#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)
#  define THREADS
#endif

#ifdef GLX_USE_TLS

#  define GL_STUB(fn,off,fn_alt)			\
ALIGNTEXT16;						\
GLOBL_FN(GL_PREFIX(fn, fn_alt));			\
GL_PREFIX(fn, fn_alt):					\
	CALL(_x86_get_dispatch) ;			\
	NOP ;						\
	JMP(GL_OFFSET(off))

#elif defined(PTHREADS)
#  define GL_STUB(fn,off,fn_alt)			\
ALIGNTEXT16;						\
GLOBL_FN(GL_PREFIX(fn, fn_alt));			\
GL_PREFIX(fn, fn_alt):					\
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;	\
	TEST_L(EAX, EAX) ;				\
	JE(1f) ;					\
	JMP(GL_OFFSET(off)) ;				\
1:	CALL(_x86_get_dispatch) ;			\
	JMP(GL_OFFSET(off))
#elif defined(THREADS)
#  define GL_STUB(fn,off,fn_alt)			\
ALIGNTEXT16;						\
GLOBL_FN(GL_PREFIX(fn, fn_alt));			\
GL_PREFIX(fn, fn_alt):					\
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;	\
	TEST_L(EAX, EAX) ;				\
	JE(1f) ;					\
	JMP(GL_OFFSET(off)) ;				\
1:	CALL(_glapi_get_dispatch) ;			\
	JMP(GL_OFFSET(off))
#else /* Non-threaded version. */
#  define GL_STUB(fn,off,fn_alt)			\
ALIGNTEXT16;						\
GLOBL_FN(GL_PREFIX(fn, fn_alt));			\
GL_PREFIX(fn, fn_alt):					\
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;	\
	JMP(GL_OFFSET(off))
#endif

#ifdef HAVE_ALIAS
#  define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)	\
	.globl	GL_PREFIX(fn, fn_alt) ;			\
	.set	GL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt)
#else
#  define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)	\
    GL_STUB(fn, off, fn_alt)
#endif

SEG_TEXT

#ifdef GLX_USE_TLS

	GLOBL	GLNAME(_x86_get_dispatch)
	HIDDEN(GLNAME(_x86_get_dispatch))
ALIGNTEXT16
GLNAME(_x86_get_dispatch):
	movl	%gs:_glapi_tls_Dispatch@NTPOFF, %eax
	ret

#elif defined(PTHREADS)
EXTERN GLNAME(_glapi_Dispatch)
EXTERN GLNAME(_gl_DispatchTSD)
EXTERN GLNAME(pthread_getspecific)

ALIGNTEXT16
GLNAME(_x86_get_dispatch):
	SUB_L(CONST(24), ESP)
	PUSH_L(GLNAME(_gl_DispatchTSD))
	CALL(GLNAME(pthread_getspecific))
	ADD_L(CONST(28), ESP)
	RET
#elif defined(THREADS)
EXTERN GLNAME(_glapi_get_dispatch)
#endif

#if defined( GLX_USE_TLS )
		.section	wtext, "awx", @progbits
#endif /* defined( GLX_USE_TLS ) */

		ALIGNTEXT16
		GLOBL GLNAME(gl_dispatch_functions_start)
		HIDDEN(GLNAME(gl_dispatch_functions_start))
GLNAME(gl_dispatch_functions_start):

	GL_STUB(NewList, _gloffset_NewList, NewList@8)
	GL_STUB(EndList, _gloffset_EndList, EndList@0)
	GL_STUB(CallList, _gloffset_CallList, CallList@4)
	GL_STUB(CallLists, _gloffset_CallLists, CallLists@12)
	GL_STUB(DeleteLists, _gloffset_DeleteLists, DeleteLists@8)
	GL_STUB(GenLists, _gloffset_GenLists, GenLists@4)
	GL_STUB(ListBase, _gloffset_ListBase, ListBase@4)
	GL_STUB(Begin, _gloffset_Begin, Begin@4)
	GL_STUB(Bitmap, _gloffset_Bitmap, Bitmap@28)
	GL_STUB(Color3b, _gloffset_Color3b, Color3b@12)
	GL_STUB(Color3bv, _gloffset_Color3bv, Color3bv@4)
	GL_STUB(Color3d, _gloffset_Color3d, Color3d@24)
	GL_STUB(Color3dv, _gloffset_Color3dv, Color3dv@4)
	GL_STUB(Color3f, _gloffset_Color3f, Color3f@12)
	GL_STUB(Color3fv, _gloffset_Color3fv, Color3fv@4)
	GL_STUB(Color3i, _gloffset_Color3i, Color3i@12)
	GL_STUB(Color3iv, _gloffset_Color3iv, Color3iv@4)
	GL_STUB(Color3s, _gloffset_Color3s, Color3s@12)
	GL_STUB(Color3sv, _gloffset_Color3sv, Color3sv@4)
	GL_STUB(Color3ub, _gloffset_Color3ub, Color3ub@12)
	GL_STUB(Color3ubv, _gloffset_Color3ubv, Color3ubv@4)
	GL_STUB(Color3ui, _gloffset_Color3ui, Color3ui@12)
	GL_STUB(Color3uiv, _gloffset_Color3uiv, Color3uiv@4)
	GL_STUB(Color3us, _gloffset_Color3us, Color3us@12)
	GL_STUB(Color3usv, _gloffset_Color3usv, Color3usv@4)
	GL_STUB(Color4b, _gloffset_Color4b, Color4b@16)
	GL_STUB(Color4bv, _gloffset_Color4bv, Color4bv@4)
	GL_STUB(Color4d, _gloffset_Color4d, Color4d@32)
	GL_STUB(Color4dv, _gloffset_Color4dv, Color4dv@4)
	GL_STUB(Color4f, _gloffset_Color4f, Color4f@16)
	GL_STUB(Color4fv, _gloffset_Color4fv, Color4fv@4)
	GL_STUB(Color4i, _gloffset_Color4i, Color4i@16)
	GL_STUB(Color4iv, _gloffset_Color4iv, Color4iv@4)
	GL_STUB(Color4s, _gloffset_Color4s, Color4s@16)
	GL_STUB(Color4sv, _gloffset_Color4sv, Color4sv@4)
	GL_STUB(Color4ub, _gloffset_Color4ub, Color4ub@16)
	GL_STUB(Color4ubv, _gloffset_Color4ubv, Color4ubv@4)
	GL_STUB(Color4ui, _gloffset_Color4ui, Color4ui@16)
	GL_STUB(Color4uiv, _gloffset_Color4uiv, Color4uiv@4)
	GL_STUB(Color4us, _gloffset_Color4us, Color4us@16)
	GL_STUB(Color4usv, _gloffset_Color4usv, Color4usv@4)
	GL_STUB(EdgeFlag, _gloffset_EdgeFlag, EdgeFlag@4)
	GL_STUB(EdgeFlagv, _gloffset_EdgeFlagv, EdgeFlagv@4)
	GL_STUB(End, _gloffset_End, End@0)
	GL_STUB(Indexd, _gloffset_Indexd, Indexd@8)
	GL_STUB(Indexdv, _gloffset_Indexdv, Indexdv@4)
	GL_STUB(Indexf, _gloffset_Indexf, Indexf@4)
	GL_STUB(Indexfv, _gloffset_Indexfv, Indexfv@4)
	GL_STUB(Indexi, _gloffset_Indexi, Indexi@4)
	GL_STUB(Indexiv, _gloffset_Indexiv, Indexiv@4)
	GL_STUB(Indexs, _gloffset_Indexs, Indexs@4)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -