pkgsrc-wip/virtualbox-ose/patches/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py
Makoto Fujiwara f1d2fed01f Import virtualbox-ose as virtualbox-ose-4.3.30
- This wip version is purely experimental, it is on the way, not completed
    at all, or just started to compile by wip/kBuild-svn
    kBuild-0.1.5nb20150905 Build framework based on GNU make

 - This is ported from FreeBSD/ports (4.3.30)
    See http://svnweb.freebsd.org/ports/head/emulators/virtualbox-ose/
 - Thus there should be so many things to adjust from FreeBSD to pkgsrc

VirtualBox is a family of powerful x86 virtualization products for
enterprise as well as home use. Not only is VirtualBox an extremely
feature rich, high performance product for enterprise customers, it
is also the only professional solution that is freely available as
Open Source Software under the terms of the GNU General Public License.

WWW: http://www.virtualbox.org/
2015-09-22 19:37:32 +09:00

100 lines
2.9 KiB
Python

$NetBSD$
--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py.orig 2014-12-19 16:58:04.474417000 -0500
+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py 2014-11-21 10:16:35.000000000 -0500
@@ -0,0 +1,95 @@
+# Copyright (c) 2001, Stanford University
+# All rights reserved.
+#
+# See the file LICENSE.txt for information on redistributing this software.
+
+
+import sys
+
+import apiutil
+
+
+def GenerateEntrypoints():
+
+ #apiutil.CopyrightC()
+
+ # Get sorted list of dispatched functions.
+ # The order is very important - it must match cr_opcodes.h
+ # and spu_dispatch_table.h
+ print '%include "iprt/asmdefs.mac"'
+ print ""
+ print "%ifdef RT_ARCH_AMD64"
+ print "extern glim"
+ print "%else ; X86"
+ print "extern glim"
+ print "%endif"
+ print ""
+
+ keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
+
+ for index in range(len(keys)):
+ func_name = keys[index]
+ if apiutil.Category(func_name) == "Chromium":
+ continue
+ if apiutil.Category(func_name) == "VBox":
+ continue
+
+ print "BEGINPROC_EXPORTED cr_gl%s" % func_name
+ print "%ifdef RT_ARCH_AMD64"
+ print "\tmov \trax, qword glim+%d" % (8*index)
+ print "\tjmp \t[rax]"
+ print "%else ; X86"
+ print "\tmov \teax, dword glim+%d" % (4*index)
+ print "\tjmp \t[eax]"
+ print "%endif"
+ print "ENDPROC cr_gl%s" % func_name
+ print ""
+
+
+ print ';'
+ print '; Aliases'
+ print ';'
+
+ # Now loop over all the functions and take care of any aliases
+ allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
+ for func_name in allkeys:
+ if "omit" in apiutil.ChromiumProps(func_name):
+ continue
+
+ if func_name in keys:
+ # we already processed this function earlier
+ continue
+
+ # alias is the function we're aliasing
+ alias = apiutil.Alias(func_name)
+ if alias:
+ # this dict lookup should never fail (raise an exception)!
+ index = keys.index(alias)
+ print "BEGINPROC_EXPORTED cr_gl%s" % func_name
+ print "%ifdef RT_ARCH_AMD64"
+ print "\tmov \trax, qword glim+%d" % (8*index)
+ print "\tjmp \t[rax]"
+ print "%else ; X86"
+ print "\tmov \teax, dword glim+%d" % (4*index)
+ print "\tjmp \t[eax]"
+ print "%endif"
+ print "ENDPROC cr_gl%s" % func_name
+ print ""
+
+
+ print ';'
+ print '; No-op stubs'
+ print ';'
+
+ # Now generate no-op stub functions
+ for func_name in allkeys:
+ if "stub" in apiutil.ChromiumProps(func_name):
+ print "BEGINPROC_EXPORTED cr_gl%s" % func_name
+ print "\tleave"
+ print "\tret"
+ print "ENDPROC cr_gl%s" % func_name
+ print ""
+
+
+GenerateEntrypoints()
+