VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/Linux_i386_exports_dri.py@ 18882

Last change on this file since 18882 was 18882, checked in by vboxsync, 15 years ago

crOpenGL: exported the remaining Additions bits to OSE

  • Property svn:eol-style set to native
File size: 2.5 KB
Line 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6
7import sys
8
9import apiutil
10
11
12def GenerateEntrypoints():
13
14 #apiutil.CopyrightC()
15
16 # Get sorted list of dispatched functions.
17 # The order is very important - it must match cr_opcodes.h
18 # and spu_dispatch_table.h
19 print '%include "iprt/asmdefs.mac"'
20 print ""
21 print "%ifdef RT_ARCH_AMD64"
22 print "extern glim"
23 print "%else ; X86"
24 print "extern glim"
25 print "%endif"
26 print ""
27
28 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
29
30 for index in range(len(keys)):
31 func_name = keys[index]
32 if apiutil.Category(func_name) == "Chromium":
33 continue
34
35 print "BEGINPROC_EXPORTED cr_gl%s" % func_name
36 print "%ifdef RT_ARCH_AMD64"
37 print "\tmov \trax, qword glim+%d" % (8*index)
38 print "\tjmp \t[rax]"
39 print "%else ; X86"
40 print "\tmov \teax, dword glim+%d" % (4*index)
41 print "\tjmp \t[eax]"
42 print "%endif"
43 print "ENDPROC cr_gl%s" % func_name
44 print ""
45
46
47 print ';'
48 print '; Aliases'
49 print ';'
50
51 # Now loop over all the functions and take care of any aliases
52 allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
53 for func_name in allkeys:
54 if "omit" in apiutil.ChromiumProps(func_name):
55 continue
56
57 if func_name in keys:
58 # we already processed this function earlier
59 continue
60
61 # alias is the function we're aliasing
62 alias = apiutil.Alias(func_name)
63 if alias:
64 # this dict lookup should never fail (raise an exception)!
65 index = keys.index(alias)
66 print "BEGINPROC_EXPORTED cr_gl%s" % func_name
67 print "%ifdef RT_ARCH_AMD64"
68 print "\tmov \trax, qword glim+%d" % (8*index)
69 print "\tjmp \t[rax]"
70 print "%else ; X86"
71 print "\tmov \teax, dword glim+%d" % (4*index)
72 print "\tjmp \t[eax]"
73 print "%endif"
74 print "ENDPROC cr_gl%s" % func_name
75 print ""
76
77
78 print ';'
79 print '; No-op stubs'
80 print ';'
81
82 # Now generate no-op stub functions
83 for func_name in allkeys:
84 if "stub" in apiutil.ChromiumProps(func_name):
85 print "BEGINPROC_EXPORTED cr_gl%s" % func_name
86 print "\tleave"
87 print "\tret"
88 print "ENDPROC cr_gl%s" % func_name
89 print ""
90
91
92GenerateEntrypoints()
93
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use