VirtualBox

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

Last change on this file since 18139 was 18139, checked in by vboxsync, 16 years ago

crOpenGL: don't trash eax/rax in export stubs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.1 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 gl%s" % func_name
36 print "\tjmp \t[RTHCPTR_PRE glim + RTHCPTR_CB*%d]" % index
37 print "ENDPROC gl%s" % func_name
38 print ""
39
40
41 print ';'
42 print '; Aliases'
43 print ';'
44
45 # Now loop over all the functions and take care of any aliases
46 allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
47 for func_name in allkeys:
48 if "omit" in apiutil.ChromiumProps(func_name):
49 continue
50
51 if func_name in keys:
52 # we already processed this function earlier
53 continue
54
55 # alias is the function we're aliasing
56 alias = apiutil.Alias(func_name)
57 if alias:
58 # this dict lookup should never fail (raise an exception)!
59 index = keys.index(alias)
60 print "BEGINPROC_EXPORTED gl%s" % func_name
61 print "\tjmp \t[RTHCPTR_PRE glim + RTHCPTR_CB*%d]" % index
62 print "ENDPROC gl%s" % func_name
63 print ""
64
65
66 print ';'
67 print '; No-op stubs'
68 print ';'
69
70 # Now generate no-op stub functions
71 for func_name in allkeys:
72 if "stub" in apiutil.ChromiumProps(func_name):
73 print "BEGINPROC_EXPORTED gl%s" % func_name
74 print "\tleave"
75 print "\tret"
76 print "ENDPROC gl%s" % func_name
77 print ""
78
79
80GenerateEntrypoints()
81
Note: See TracBrowser for help on using the repository browser.

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