Linux_i386_exports.py revision bc32972cf8383f278e08cb0b480e8009babd15ca
d46ee884c41b808b239563b1978468aae12e33a2vboxsync# Copyright (c) 2001, Stanford University
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync# All rights reserved.
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync# See the file LICENSE.txt for information on redistributing this software.
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync #apiutil.CopyrightC()
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync # Get sorted list of dispatched functions.
d46ee884c41b808b239563b1978468aae12e33a2vboxsync # The order is very important - it must match cr_opcodes.h
d46ee884c41b808b239563b1978468aae12e33a2vboxsync # and spu_dispatch_table.h
d46ee884c41b808b239563b1978468aae12e33a2vboxsync print '%include "iprt/asmdefs.mac"'
d46ee884c41b808b239563b1978468aae12e33a2vboxsync print "%ifdef RT_ARCH_AMD64"
d46ee884c41b808b239563b1978468aae12e33a2vboxsync print "extern glim"
d46ee884c41b808b239563b1978468aae12e33a2vboxsync print "%else ; X86"
d46ee884c41b808b239563b1978468aae12e33a2vboxsync print "extern glim"
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync print "%endif"
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync print "%ifdef RT_ARCH_AMD64"
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync print "\tjmp \t[rax]"
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync print "%else ; X86"
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync print "\tjmp \t[eax]"
d46ee884c41b808b239563b1978468aae12e33a2vboxsync print "%endif"
3b70c9ab3cea93ab1a771d2db319311282041382vboxsync print '; Aliases'
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync # Now loop over all the functions and take care of any aliases
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync # we already processed this function earlier
e33247bff4fddfdba92538374bcc9e2753044a38vboxsync # alias is the function we're aliasing
d46ee884c41b808b239563b1978468aae12e33a2vboxsync # this dict lookup should never fail (raise an exception)!
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync print "%ifdef RT_ARCH_AMD64"
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync print "\tjmp \t[rax]"
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync print "%else ; X86"
e33247bff4fddfdba92538374bcc9e2753044a38vboxsync print "\tjmp \t[eax]"
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync print "%endif"
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync print '; No-op stubs'
358a99c385080f7f31166943f3ac3a2aea6b5263vboxsync # Now generate no-op stub functions
e33247bff4fddfdba92538374bcc9e2753044a38vboxsync print "\tleave"
8cd393943ea52545c4d063f5a94436639f0f80b6vboxsync print "\tret"