VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/Linux_i386_exports.py@ 38157

最後變更 在這個檔案從38157是 30457,由 vboxsync 提交於 14 年 前

crOpenGL: build fix

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 2.6 KB
 
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 if apiutil.Category(func_name) == "VBox":
35 continue
36
37 print "BEGINPROC_EXPORTED gl%s" % func_name
38 print "%ifdef RT_ARCH_AMD64"
39 print "\tmov \trax, qword glim+%d" % (8*index)
40 print "\tjmp \t[rax]"
41 print "%else ; X86"
42 print "\tmov \teax, dword glim+%d" % (4*index)
43 print "\tjmp \t[eax]"
44 print "%endif"
45 print "ENDPROC gl%s" % func_name
46 print ""
47
48
49 print ';'
50 print '; Aliases'
51 print ';'
52
53 # Now loop over all the functions and take care of any aliases
54 allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
55 for func_name in allkeys:
56 if "omit" in apiutil.ChromiumProps(func_name):
57 continue
58
59 if func_name in keys:
60 # we already processed this function earlier
61 continue
62
63 # alias is the function we're aliasing
64 alias = apiutil.Alias(func_name)
65 if alias:
66 # this dict lookup should never fail (raise an exception)!
67 index = keys.index(alias)
68 print "BEGINPROC_EXPORTED gl%s" % func_name
69 print "%ifdef RT_ARCH_AMD64"
70 print "\tmov \trax, qword glim+%d" % (8*index)
71 print "\tjmp \t[rax]"
72 print "%else ; X86"
73 print "\tmov \teax, dword glim+%d" % (4*index)
74 print "\tjmp \t[eax]"
75 print "%endif"
76 print "ENDPROC gl%s" % func_name
77 print ""
78
79
80 print ';'
81 print '; No-op stubs'
82 print ';'
83
84 # Now generate no-op stub functions
85 for func_name in allkeys:
86 if "stub" in apiutil.ChromiumProps(func_name):
87 print "BEGINPROC_EXPORTED gl%s" % func_name
88 print "\tleave"
89 print "\tret"
90 print "ENDPROC gl%s" % func_name
91 print ""
92
93
94GenerateEntrypoints()
95
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette