VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_exports.py@ 78581

Last change on this file since 78581 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 2.9 KB
Line 
1"""
2Copyright (C) 2009-2019 Oracle Corporation
3
4This file is part of VirtualBox Open Source Edition (OSE), as
5available from http://www.virtualbox.org. This file is free software;
6you can redistribute it and/or modify it under the terms of the GNU
7General Public License (GPL) as published by the Free Software
8Foundation, in version 2 as it comes in the "COPYING" file of the
9VirtualBox OSE distribution. VirtualBox OSE is distributed in the
10hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
11"""
12
13from __future__ import print_function
14import sys
15
16import apiutil
17
18
19def GenerateEntrypoints():
20
21 #apiutil.CopyrightC()
22
23 # Get sorted list of dispatched functions.
24 # The order is very important - it must match cr_opcodes.h
25 # and spu_dispatch_table.h
26 print('%include "iprt/asmdefs.mac"')
27 print("")
28 print("%ifdef RT_ARCH_AMD64")
29 print("extern glim")
30 print("%else ; X86")
31 print("extern glim")
32 print("%endif")
33 print("")
34
35 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
36
37 for index in range(len(keys)):
38 func_name = keys[index]
39 if apiutil.Category(func_name) == "Chromium":
40 continue
41 if apiutil.Category(func_name) == "VBox":
42 continue
43
44 print("BEGINPROC_EXPORTED gl%s" % func_name)
45 print("%ifdef RT_ARCH_AMD64")
46 print("\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index))
47 print("%else ; X86")
48 print("\tjmp \t[glim+%d wrt ..gotpc]" % (4*index))
49 print("%endif")
50 print("ENDPROC gl%s" % func_name)
51 print("")
52
53
54 print(';')
55 print('; Aliases')
56 print(';')
57
58 # Now loop over all the functions and take care of any aliases
59 allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
60 for func_name in allkeys:
61 if "omit" in apiutil.ChromiumProps(func_name):
62 continue
63
64 if func_name in keys:
65 # we already processed this function earlier
66 continue
67
68 # alias is the function we're aliasing
69 alias = apiutil.Alias(func_name)
70 if alias:
71 # this dict lookup should never fail (raise an exception)!
72 index = keys.index(alias)
73 print("BEGINPROC_EXPORTED gl%s" % func_name)
74 print("%ifdef RT_ARCH_AMD64")
75 print("\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index))
76 print("%else ; X86")
77 print("\tjmp \t[glim+%d wrt ..gotpc]" % (4*index))
78 print("%endif")
79 print("ENDPROC gl%s" % func_name)
80 print("")
81
82
83 print(';')
84 print('; No-op stubs')
85 print(';')
86
87 # Now generate no-op stub functions
88 for func_name in allkeys:
89 if "stub" in apiutil.ChromiumProps(func_name):
90 print("BEGINPROC_EXPORTED gl%s" % func_name)
91 print("\tleave")
92 print("\tret")
93 print("ENDPROC gl%s" % func_name)
94 print("")
95
96
97GenerateEntrypoints()
98
Note: See TracBrowser for help on using the repository browser.

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