VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/windows_i386_exports.py@ 63939

Last change on this file since 63939 was 63939, checked in by vboxsync, 8 years ago

Build/scripts (bugref:6627): Python build scripts updated to generate the same code when used with Python 2 and 3.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.3 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
7from __future__ import print_function
8import sys
9
10import apiutil
11
12
13def GenerateEntrypoints():
14
15 #apiutil.CopyrightC()
16 print('%include "iprt/asmdefs.mac"')
17 print("")
18 print("%ifdef RT_ARCH_AMD64")
19 print("extern glim")
20 print("%else ; X86")
21 print("extern _glim")
22 print("%endif")
23 print("")
24
25 # Get sorted list of dispatched functions.
26 # The order is very important - it must match cr_opcodes.h
27 # and spu_dispatch_table.h
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 cr_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 cr_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 cr_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 cr_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 cr_gl%s" % func_name)
88 print("\tleave")
89 print("\tret")
90 print("ENDPROC cr_gl%s" % func_name)
91 print("")
92
93
94GenerateEntrypoints()
95
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use