diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..637430b5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,55 @@ +# Contributing to this repository + +We welcome your contributions! There are multiple ways to contribute. + +## Opening issues + +For bugs or enhancement requests, please file a GitHub issue unless it's +security related. When filing a bug remember that the better written the bug is, +the more likely it is to be fixed. If you think you've found a security +vulnerability, do not raise a GitHub issue and follow the instructions in our +[security policy](./SECURITY.md). + +## Contributing code + +We welcome your code contributions. Before submitting code via a pull request, +you will need to have signed the [Oracle Contributor Agreement][OCA] (OCA) and +your commits need to include the following line using the name and e-mail +address you used to sign the OCA: + +```text +Signed-off-by: Your Name +``` + +This can be automatically added to pull requests by committing with `--sign-off` +or `-s`, e.g. + +```text +git commit --signoff +``` + +Only pull requests from committers that can be verified as having signed the OCA +can be accepted. + +## Pull request process + +1. Ensure there is an issue created to track and discuss the fix or enhancement + you intend to submit. +1. Fork this repository. +1. Create a branch in your fork to implement the changes. We recommend using + the issue number as part of your branch name, e.g. `1234-fixes`. +1. Ensure that any documentation is updated with the changes that are required + by your change. +1. Ensure that any samples are updated if the base image has been changed. +1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly + what your changes are meant to do and provide simple steps on how to validate. + your changes. Ensure that you reference the issue you created as well. +1. We will assign the pull request to 2-3 people for review before it is merged. + +## Code of conduct + +Follow the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule). If you'd +like more specific guidelines, see the [Contributor Covenant Code of Conduct][COC]. + +[OCA]: https://oca.opensource.oracle.com +[COC]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/ diff --git a/Config.kmk b/Config.kmk index cc014204..1e30bd17 100644 --- a/Config.kmk +++ b/Config.kmk @@ -880,8 +880,6 @@ if1of ($(KBUILD_TARGET), darwin linux solaris) # Enable Java<->JAX-WS bridge VBOX_WITH_JWS ?= 1 endif -# Use XPIDL instead of XSLT stylesheet -VBOX_WITH_JAVA_SUPPORT_IN_XPIDL ?= # Build against multiple Python versions present in the system (only up to 3.2, # unless VBOX_WITH_ONLY_PYTHON_LIMITED_API is overridden). VBOX_WITH_MULTIVERSION_PYTHON ?= 1 @@ -2649,7 +2647,7 @@ else endif # Makeself for the linux installers. -VBOX_MAKESELF ?= $(KBUILD_DEVTOOLS)/common/makeself/v2.4.5-r2/makeself.sh +VBOX_MAKESELF ?= $(KBUILD_DEVTOOLS)/common/makeself/v2.5.0-r2/makeself.sh # Microsoft HTML Help Workshop. VBOX_PATH_HTML_HELP_WORKSHOP ?= $(KBUILD_DEVTOOLS)/win.x86/HTML_Help_Workshop/v1.3/ @@ -2772,15 +2770,6 @@ ifneq ($(KBUILD_TARGET),win) $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \ $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \ $(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd - ifneq ($(KBUILD_TARGET),os2) - # libIDL-config (for xpcom18a4) - ifeq ($(origin VBOX_LIBIDL_CONFIG),undefined) - ifeq ($(KBUILD_HOST),solaris) - VBOX_LIBIDL_CONFIG_FALLBACK = $(lastword $(wildcard $(KBUILD_DEVTOOLS)/solaris.amd64/libIDL/*/bin/libIDL-config-2)) - endif - export VBOX_LIBIDL_CONFIG := $(firstword $(which libIDL-config-2 libIDL-config) $(VBOX_LIBIDL_CONFIG_FALLBACK) libIDL-config-2-not-found) - endif - endif endif # The X11 LIBPATH. (The amd64 hack is for RHEL4.) @@ -4230,9 +4219,11 @@ ifdef VBOX_SIGNING_MODE VBOX_CCS_CLIENT_JAR := $(firstword $(rsort \ $(wildcard $(KBUILD_DEVTOOLS)/common/ccs/v*/Client.jar)) \ $(KBUILD_DEVTOOLS)/common/ccs/notfound/Client.jar ) - VBOX_CCS_USER ?= virtualbox_grp - VBOX_CCS_GLOBAL_UID ?= non-of-your-business - VBOX_CCS_SERVER ?= UK + VBOX_CCS_USER ?= virtualbox_grp + VBOX_CCS_GLOBAL_UID ?= non-of-your-business + VBOX_CCS_SERVER.solaris ?= SCA + VBOX_CCS_SERVER.win ?= PHX + VBOX_CCS_SERVER.darwin ?= SCA ## # Corp Code Signing command line. # @param $1 Signing method: solaris_elf, solaris_pkg, driver (microsoft), ... @@ -4241,7 +4232,7 @@ ifdef VBOX_SIGNING_MODE # @param $4 Additional options. VBOX_CCS_SIGN_CMD = $(VBOX_RETRY) $(VBOX_JAVA) -Xmx256m -jar "$(VBOX_CCS_CLIENT_JAR)" \ sign -user "$(VBOX_CCS_USER)" -global_uid "$(VBOX_CCS_GLOBAL_UID)" \ - -job_timeout 90 -server_timeout 75 -server "$(VBOX_CCS_SERVER)" \ + -job_timeout 90 -server_timeout 75 -server "$(VBOX_CCS_SERVER.$(KBUILD_TARGET))" \ -sign_method "$1" -file_to_sign "$2" -signed_location "$(if $3,$3,$(call VBOX_DIRX,$2))" $4 ifeq ($(KBUILD_HOST),win) @@ -4661,7 +4652,7 @@ ifdef VBOX_SIGNING_MODE # @param 3 The directory to put the notarized file in. Defaults to $(dir $1). VBOX_CCS_NOTARIZE_CMD = $(VBOX_RETRY) $(VBOX_JAVA) -jar "$(VBOX_CCS_CLIENT_JAR)" \ mac_notarize -user "$(VBOX_CCS_USER)" -global_uid "$(VBOX_CCS_GLOBAL_UID)" \ - -job_timeout 90 -server_timeout 75 -server "$(VBOX_CCS_SERVER)" \ + -job_timeout 90 -server_timeout 75 -server "$(VBOX_CCS_SERVER.$(KBUILD_TARGET))" \ -file_to_notarize "$1" -bundle_id "$2" -download_location "$(if $3,$3,$(call VBOX_DIRX,$1))" ## Sign an application bundle, framework or kernel extension. @@ -5162,7 +5153,7 @@ endif # openssl SDK_VBoxOpenSslStatic := OpenSSL - Only for VBoxRT and/or statically linked programs. -SDK_VBoxOpenSslStatic_VBOX_DEFAULT_INCS := $(PATH_OUT)/obj/crypto-3.3.2-headers/include +SDK_VBoxOpenSslStatic_VBOX_DEFAULT_INCS := $(PATH_OUT)/obj/crypto-3.4.1-headers/include SDK_VBoxOpenSslStatic_INCS ?= $(SDK_VBoxOpenSslStatic_VBOX_DEFAULT_INCS) SDK_VBoxOpenSslStatic_ORDERDEPS ?= $(crypto-headers_1_TARGET) if !defined(VBOX_ONLY_SDK) \ @@ -5176,7 +5167,7 @@ SDK_VBoxOpenSslStatic_LIBS ?= \ $(PATH_STAGE_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB) SDK_VBoxOpenSslStatic-x86 := OpenSSL/x86 - Only for VBoxRT and/or statically linked programs. -SDK_VBoxOpenSslStatic-x86_VBOX_DEFAULT_INCS := $(PATH_OUT)/obj/crypto-3.3.2-headers/include +SDK_VBoxOpenSslStatic-x86_VBOX_DEFAULT_INCS := $(PATH_OUT)/obj/crypto-3.4.1-headers/include SDK_VBoxOpenSslStatic-x86_INCS ?= $(SDK_VBoxOpenSslStatic_VBOX_DEFAULT_INCS) SDK_VBoxOpenSslStatic-x86_ORDERDEPS ?= $(crypto-headers_1_TARGET) if ("$(SDK_VBoxOpenSslStatic_INCS)" == "$(SDK_VBoxOpenSslStatic_VBOX_DEFAULT_INCS)") @@ -5280,7 +5271,7 @@ endif ifdef VBOX_WITH_LIBLZMA SDK_VBoxLibLzma := liblzma for dll linking. - SDK_VBoxLibLzma_DEFAULT_INCS := $(PATH_ROOT)/src/libs/liblzma-5.4.1/api + SDK_VBoxLibLzma_DEFAULT_INCS := $(PATH_ROOT)/src/libs/liblzma-5.8.1/api SDK_VBoxLibLzma_INCS ?= $(SDK_VBoxLibLzma_DEFAULT_INCS) SDK_VBoxLibLzma_LIBS ?= $(PATH_STAGE_LIB)/VBox-liblzma$(VBOX_SUFF_LIB) @@ -9287,7 +9278,7 @@ endif SVN ?= svn$(HOSTSUFF_EXE) VBOX_SVN_REV_KMK = $(PATH_OUT)/revision.kmk ifndef VBOX_SVN_REV - VBOX_SVN_REV_CONFIG_FALLBACK := $(patsubst %:,, $Rev: 168374 $ ) + VBOX_SVN_REV_CONFIG_FALLBACK := $(patsubst %:,, $Rev: 168816 $ ) VBOX_SVN_REV_FALLBACK := $(if-expr $(VBOX_SVN_REV_CONFIG_FALLBACK) > $(VBOX_SVN_REV_VERSION_FALLBACK),$(VBOX_SVN_REV_CONFIG_FALLBACK),$(VBOX_SVN_REV_VERSION_FALLBACK)) VBOX_SVN_DEP := $(firstword $(wildcard $(PATH_ROOT)/.svn/wc.db $(abspath $(PATH_ROOT)/../.svn/wc.db) $(abspath $(PATH_ROOT)/../../.svn/wc.db) $(PATH_ROOT)/.svn/entries)) ifeq ($(which $(SVN)),) diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 00000000..6db1aaae --- /dev/null +++ b/README.md @@ -0,0 +1,91 @@ +# Oracle VirtualBox + +VirtualBox is a general-purpose full virtualization software for x86_64 +hardware (with version 7.1 additionally for macOS/Arm), targeted at laptop, +desktop, server and embedded use. + +It features a very user friendly graphical user interface and is available for +many popular operating systems (Linux, Windows, macOS and Solaris). Flexible +networking setup and interactive performance are the strong points. + +Anyone with the need to run multiple operating systems simultaneously with some +basic knowledge about PCs and operating system installation can use it to +reduce effort with a large number of tasks including software testing. + +## Getting started + +VirtualBox is a complex product with multiple dependencies, some of them +specific to the operating system on which you want to run it. + +The basics for building VirtualBox are described on the [build +instructions](https://www.virtualbox.org/wiki/Build_instructions) page. + +## Documentation + +The [VirtualBox User +Guide](https://docs.oracle.com/en/virtualization/virtualbox/index.html) +contains all information relevant for users, including the product features and +their configuration. + +For developers it is recommended to start with the [technical +documentation](https://www.virtualbox.org/wiki/Technical_documentation) which +contains links to a broad collection of pages related to development, covering +many aspects of the project and its features. + +## Examples + +Tutorials on how to install and use Oracle VirtualBox are available at +[Learn to Install Oracle VirtualBox and Run Virtual Machines](https://blogs.oracle.com/linux/post/learn-to-install-oracle-virtualbox-and-run-virtual-machines) +and [Use Oracle VirtualBox on Oracle Linux](https://docs.oracle.com/en/learn/ol-vbox/index.html). + +## Help + +Oracle customers with a support contract covering Oracle VirtualBox should +reach out to [Oracle Support](https://www.oracle.com/support/). + +Everyone can use the [VirtualBox Forums](https://forums.virtualbox.org/) +for questions about the product or discussing its functionality. Open an [issue](https://github.com/VirtualBox/virtualbox/issues) +for bug reports or request for enhancements. Report a security vulnerability +according to the [Reporting Vulnerabilities Guide](https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html). + +## Contributing + +This project welcomes contributions from the community. Before submitting a +pull request, please [review our contribution guide](./CONTRIBUTING.md) + +## Security + +Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process. + +## License + +The correct copyright notice format for both documentation and software is + + Copyright (C) [year-]year Oracle and/or its affiliates. + + This file is part of VirtualBox base platform packages, as + available from https://www.virtualbox.org. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, in version 3 of the + License. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + +You must include the year the content was first released (on any platform) and +the most recent year in which it was revised: + + Copyright (C) 2025 Oracle and/or its affiliates. + +Released under the GNU General Public License v3.0 as shown at +[COPYING](./COPYING) which contains clarifications regarding allowed licenses +for other code using parts of the project which are covered by multiple +licenses. + diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..bc08bf51 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,39 @@ +# Reporting security vulnerabilities + +Oracle values the independent security research community and believes that +responsible disclosure of security vulnerabilities helps us ensure the security +and privacy of all our users. + +Please do NOT raise a GitHub Issue to report a security vulnerability. If you +believe you have found a security vulnerability, please submit a report to +[secalert_us@oracle.com][1] preferably with a proof of concept. Please review +some additional information on [how to report security vulnerabilities to Oracle][2]. +We encourage people who contact Oracle Security to use email encryption using +[our encryption key][3]. + +We ask that you do not use other channels or contact the project maintainers +directly. + +Non-vulnerability related security issues including ideas for new or improved +security features are welcome on GitHub Issues. + +## Security updates, alerts and bulletins + +Security updates will be released on a regular cadence. Many of our projects +will typically release security fixes in conjunction with the +Oracle Critical Patch Update program. Additional +information, including past advisories, is available on our [security alerts][4] +page. + +## Security-related information + +We will provide security related information such as a threat model, considerations +for secure use, or any known security issues in our documentation. Please note +that labs and sample code are intended to demonstrate a concept and may not be +sufficiently hardened for production use. + +[1]: mailto:secalert_us@oracle.com +[2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html +[3]: https://www.oracle.com/security-alerts/encryptionkey.html +[4]: https://www.oracle.com/security-alerts/ + diff --git a/THIRD_PARTY_LICENSES.txt b/THIRD_PARTY_LICENSES.txt new file mode 100644 index 00000000..06a4b5fa --- /dev/null +++ b/THIRD_PARTY_LICENSES.txt @@ -0,0 +1 @@ +See doc/manual/en_US/dita/topics/licensing/vbox-base for all 3rd party licenses. diff --git a/Version.kmk b/Version.kmk index 3115378e..b0abd522 100644 --- a/Version.kmk +++ b/Version.kmk @@ -34,7 +34,7 @@ VBOX_VERSION_MINOR = 1 # This is the current build number. It should be increased every time we publish a # new build. The define is available in every source file. Only even build numbers # will be published, odd numbers are set during development. -VBOX_VERSION_BUILD = 8 +VBOX_VERSION_BUILD = 10 # This can be overridden in LocalConfig.kmk or elsewhere. # For the convention, see checks near the end of Config.kmk. VBOX_BUILD_PUBLISHER = @@ -45,4 +45,4 @@ VBOX_VERSION_PRERELEASE = VBOX_RELEASE_EXACT_MATCH = # Fallback revision when there is no other source. See Config.kmk. -VBOX_SVN_REV_VERSION_FALLBACK := $(patsubst %:,, $Rev: 168469 $ ) +VBOX_SVN_REV_VERSION_FALLBACK := $(patsubst %:,, $Rev: 169112 $ ) diff --git a/configure b/configure index 658c1740..e8459932 100755 --- a/configure +++ b/configure @@ -90,7 +90,6 @@ WITH_XPCOM=1 WITH_PYTHON=1 WITH_JAVA=1 WITH_VMMRAW=1 -WITH_LIBIDL=1 WITH_QT6=1 WITH_SDL=1 WITH_SDL_TTF=1 @@ -786,36 +785,6 @@ EOF } -# -# Check for libIDL, needed by xpcom -# -check_libidl() -{ - test_header libIDL - - if which_wrapper libIDL-config-2 > /dev/null; then - libidl_ver=`libIDL-config-2 --version` - if [ $? -ne 0 ]; then - log_failure "libIDL-config-2 not working" - fail - else - log_success "found version $libidl_ver" - cnf_append "VBOX_LIBIDL_CONFIG" \ - "PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/$LIB/pkgconfig `which_wrapper libIDL-config-2`" - fi - elif check_avail "libIDL-config" libIDL-config; then - libidl_ver=`libIDL-config --version` - if [ $? -ne 0 ]; then - log_failure "libIDL-config not working" - fail - else - log_success "found version $libidl_ver" - cnf_append "VBOX_LIBIDL_CONFIG" "`which_wrapper libIDL-config`" - fi - fi -} - - # # Check for libdevmapper, needed by the VBoxVolInfo # @@ -2632,7 +2601,6 @@ elif [ "$OS" = "haiku" ]; then WITH_PULSE=0 WITH_DBUS=0 WITH_KMODS=0 - WITH_LIBIDL=0 WITH_XPCOM=0 BUILD_LIBXSLT=1 BUILD_LIBXML2=1 @@ -3024,7 +2992,6 @@ fi if [ $ONLY_ADDITIONS -eq 0 ]; then [ "$OS" != "darwin" ] && check_pthread check_libxml2 - [ $WITH_LIBIDL -eq 1 ] && check_libidl check_z check_lzf check_ssl diff --git a/doc/manual/user_ChangeLogImpl.xml b/doc/manual/user_ChangeLogImpl.xml index 247f2ee6..01a1f6e0 100644 --- a/doc/manual/user_ChangeLogImpl.xml +++ b/doc/manual/user_ChangeLogImpl.xml @@ -71,6 +71,60 @@ Rules for adding a changelog entry to make them look more uniform: + + + Version 7.1.10 (2025-06-03) + + This is a maintenance release. The following items were fixed and/or + added: + + + + + VBoxManage: Fixed a crash when running 'guestcontrol run' on Windows + hosts (bug #22175) + + + + Audio: Fixed device switching on Windows hosts (bug #22267) + + + + Windows host installer: Fixed multiple installation entries in the + 'Add or remove programs' dialog and upgrade issues + + + + Linux host: Fixed issue which caused VM Selector process crash + due to missing libdl.so and libpthread.so libraries (bug #22193) + + + + Linux host: Removed libIDL as a build time dependency when + building VirtualBox from source code (bug #21169) + + + + Linux guest and host: Added initial support for kernel 6.15 (bug #22420) + + + + Linux guest: Added initial support for kernel 6.16-RC0 + + + + Linux guest and host: Fixed issue with building modules + for UEK8 kernel on Oracle Linux 9 distribution + + + + RDP: Fixed issue when it was not possible to paste clipboard buffer + into a guest over RDP remote session + + + + + Version 7.1.8 (2025-04-15) diff --git a/include/VBox/com/array.h b/include/VBox/com/array.h index 7c07a624..b669516d 100644 --- a/include/VBox/com/array.h +++ b/include/VBox/com/array.h @@ -833,14 +833,21 @@ public: if (!ensureCapacity(size() + 1)) return false; - for (size_t i = size(); i > 0; --i) - { #ifdef VBOX_WITH_XPCOM + /* For XPCOM, size() is 0 and capacity() is 16 for the first time + * this function is being called on an empty array. + * See implementation of ensureCapacity(). */ + for (size_t i = size(); i > 0; --i) SafeArray::Copy(m.arr[i - 1], m.arr[i]); #else + /* For Windows (COM), size() always matches the array's capacity. + * + * So we here need to make sure we don't read beyond the array + * if this function is being called on an empty array + * (size is 1 and there is no element on index 1 yet). */ + for (size_t i = size() - 1; i > 0; --i) SafeArray::Copy(m.raw[i - 1], m.raw[i]); #endif - } #ifdef VBOX_WITH_XPCOM SafeArray::Copy(aElement, m.arr[0]); diff --git a/include/iprt/mangling.h b/include/iprt/mangling.h index 4527d6ce..29c28ae4 100644 --- a/include/iprt/mangling.h +++ b/include/iprt/mangling.h @@ -2015,6 +2015,8 @@ # define RTScriptLexPeekCh RT_MANGLER(RTScriptLexPeekCh) # define RTScriptLexPeekChEx RT_MANGLER(RTScriptLexPeekChEx) # define RTScriptLexPeekNextTokenType RT_MANGLER(RTScriptLexPeekNextTokenType) +# define RTScriptLexProduceTokError RT_MANGLER(RTScriptLexProduceTokError) +# define RTScriptLexProduceTokIde RT_MANGLER(RTScriptLexProduceTokIde) # define RTScriptLexQueryToken RT_MANGLER(RTScriptLexQueryToken) # define RTScriptLexScanIdentifier RT_MANGLER(RTScriptLexScanIdentifier) # define RTScriptLexScanNumber RT_MANGLER(RTScriptLexScanNumber) diff --git a/include/iprt/script.h b/include/iprt/script.h index 02996789..0a4af006 100644 --- a/include/iprt/script.h +++ b/include/iprt/script.h @@ -97,6 +97,10 @@ typedef enum RTSCRIPTLEXTOKTYPE RTSCRIPTLEXTOKTYPE_KEYWORD, /** Some punctuator. */ RTSCRIPTLEXTOKTYPE_PUNCTUATOR, + /** A single line comment. */ + RTSCRIPTLEXTOKTYPE_COMMENT_SINGLE_LINE, + /** A multi line comment. */ + RTSCRIPTLEXTOKTYPE_COMMENT_MULTI_LINE, /** Special error token, conveying an error message from the lexer. */ RTSCRIPTLEXTOKTYPE_ERROR, /** End of stream token. */ @@ -211,6 +215,14 @@ typedef struct RTSCRIPTLEXTOKEN /** Pointer to the matched punctuator descriptor. */ PCRTSCRIPTLEXTOKMATCH pPunctuator; } Punctuator; + /** Comment */ + struct + { + /** Pointer to the start of the comment (including the symbols starting the comment). */ + const char *pszComment; + /** Number of characters of the comment, including the null terminator. */ + size_t cchComment; + } Comment; /** Error. */ struct { @@ -308,10 +320,15 @@ typedef RTSCRIPTLEXCFG *PRTSCRIPTLEXCFG; typedef const RTSCRIPTLEXCFG *PCRTSCRIPTLEXCFG; /** Default lexer config flags. */ -#define RTSCRIPT_LEX_CFG_F_DEFAULT 0 +#define RTSCRIPT_LEX_CFG_F_DEFAULT 0 /** Case insensitive lexing, keywords and so on must be used lowercase to match * as the lexer will convert everything to lowercase internally. */ -#define RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE RT_BIT(0) +#define RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_LOWER RT_BIT(0) +/** Case insensitive lexing, keywords and so on must be used uppercase to match + * as the lexer will convert everything to uppercase internally. */ +#define RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_UPPER RT_BIT(1) +/** Comments are not skipped but passed back as tokens. */ +#define RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS RT_BIT(2) /** Default character conversions (converting to lower case when the case insensitive flag is set). */ @@ -365,12 +382,17 @@ typedef FNRTSCRIPTLEXDTOR *PFNRTSCRIPTLEXDTOR; * scanned string literals on success, optional. * If not NULL the string cache must be freed by the caller when not used * anymore. + * @param phStrCacheComments Where to store the pointer to the string cache containing all + * comments on success when RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS + * is given, optional. + * If not NULL the string cache must be freed by the caller when not used + * anymore. * @param pCfg The lexer config to use for identifying the different tokens. */ RTDECL(int) RTScriptLexCreateFromReader(PRTSCRIPTLEX phScriptLex, PFNRTSCRIPTLEXRDR pfnReader, PFNRTSCRIPTLEXDTOR pfnDtor, void *pvUser, size_t cchBuf, PRTSTRCACHE phStrCacheId, PRTSTRCACHE phStrCacheStringLit, - PCRTSCRIPTLEXCFG pCfg); + PRTSTRCACHE phStrCacheComments, PCRTSCRIPTLEXCFG pCfg); /** @@ -387,10 +409,16 @@ RTDECL(int) RTScriptLexCreateFromReader(PRTSCRIPTLEX phScriptLex, PFNRTSCRIPTLEX * scanned string literals on success, optional. * If not NULL the string cache must be freed by the caller when not used * anymore. + * @param phStrCacheComments Where to store the pointer to the string cache containing all + * comments on success when RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS + * is given, optional. + * If not NULL the string cache must be freed by the caller when not used + * anymore. * @param pCfg The lexer config to use for identifying the different tokens. */ RTDECL(int) RTScriptLexCreateFromString(PRTSCRIPTLEX phScriptLex, const char *pszSrc, PRTSTRCACHE phStrCacheId, - PRTSTRCACHE phStrCacheStringLit, PCRTSCRIPTLEXCFG pCfg); + PRTSTRCACHE phStrCacheStringLit, PRTSTRCACHE phStrCacheComments, + PCRTSCRIPTLEXCFG pCfg); /** @@ -407,10 +435,16 @@ RTDECL(int) RTScriptLexCreateFromString(PRTSCRIPTLEX phScriptLex, const char *ps * scanned string literals on success, optional. * If not NULL the string cache must be freed by the caller when not used * anymore. + * @param phStrCacheComments Where to store the pointer to the string cache containing all + * comments on success when RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS + * is given, optional. + * If not NULL the string cache must be freed by the caller when not used + * anymore. * @param pCfg The lexer config to use for identifying the different tokens. */ RTDECL(int) RTScriptLexCreateFromFile(PRTSCRIPTLEX phScriptLex, const char *pszFilename, PRTSTRCACHE phStrCacheId, - PRTSTRCACHE phStrCacheStringLit, PCRTSCRIPTLEXCFG pCfg); + PRTSTRCACHE phStrCacheStringLit, PRTSTRCACHE phStrCacheComments, + PCRTSCRIPTLEXCFG pCfg); /** @@ -601,6 +635,30 @@ RTDECL(int) RTScriptLexScanStringLiteralC(RTSCRIPTLEX hScriptLex, char ch, PRTSC */ RTDECL(int) RTScriptLexScanStringLiteralPascal(RTSCRIPTLEX hScriptLex, char ch, PRTSCRIPTLEXTOKEN pTok, void *pvUser); + +/** + * Produces an error token with the given message, used for custom lexer rule implementations. + * + * @returns IPRT status code. + * @param hScriptLex The lexer handle. + * @param pTok The token to fill. + * @param rc The status code to use in the message. + * @param pszMsg The format string for the error message. + * @param ... Arguments to the format string. + */ +RTDECL(int) RTScriptLexProduceTokError(RTSCRIPTLEX hScriptLex, PRTSCRIPTLEXTOKEN pTok, int rc, const char *pszMsg, ...); + + +/** + * Produces an identifier token with the given identifier, used for custom lexer rule implementations. + * + * @returns IPRT status code. + * @param hScriptLex The lexer handle. + * @param pTok The token to fill. + * @param pszIde The identifier to add. + * @param cchIde Number of characters in the identifier. + */ +RTDECL(int) RTScriptLexProduceTokIde(RTSCRIPTLEX hScriptLex, PRTSCRIPTLEXTOKEN pTok, const char *pszIde, size_t cchIde); /** @} */ /** @} */ diff --git a/src/VBox/Additions/common/VBoxGuest/win/VBoxGuest.inf b/src/VBox/Additions/common/VBoxGuest/win/VBoxGuest.inf index 2e5ede02..b7986712 100644 --- a/src/VBox/Additions/common/VBoxGuest/win/VBoxGuest.inf +++ b/src/VBox/Additions/common/VBoxGuest/win/VBoxGuest.inf @@ -42,7 +42,7 @@ Class=System DriverPackageType=PlugAndPlay ;edit-DriverVer=08/26/2008,2.00.0000 ;cat CatalogFile=VBoxGuest.cat -;PnpLockdown=1 +PnpLockdown=1 [SourceDisksNames] 1 = %VBoxGuest_MediaDesc%,,, diff --git a/src/VBox/Additions/linux/drm/vbox_drv.c b/src/VBox/Additions/linux/drm/vbox_drv.c index 4516da24..008a8b38 100644 --- a/src/VBox/Additions/linux/drm/vbox_drv.c +++ b/src/VBox/Additions/linux/drm/vbox_drv.c @@ -43,6 +43,10 @@ # include #endif +#if RTLNX_VER_MIN(6,13,0) && defined(CONFIG_APERTURE_HELPERS) +# include +#endif + #if RTLNX_VER_RANGE(5,14,0, 6,13,0) || RTLNX_RHEL_RANGE(8,6, 8,99) # include #endif @@ -94,7 +98,9 @@ static int vbox_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } #endif -# if RTLNX_VER_RANGE(5,14,0, 6,13,0) || RTLNX_RHEL_RANGE(8,6, 8,99) +# if RTLNX_VER_MIN(6,13,0) && defined(CONFIG_APERTURE_HELPERS) + ret = aperture_remove_conflicting_pci_devices(pdev, driver.name); +# elif RTLNX_VER_RANGE(5,14,0, 6,13,0) || RTLNX_RHEL_RANGE(8,6, 8,99) # if RTLNX_VER_MIN(5,15,0) || RTLNX_RHEL_RANGE(8,7, 8,99) || RTLNX_RHEL_MIN(9,1) || RTLNX_SUSE_MAJ_PREREQ(15,4) ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver); # else @@ -391,6 +397,9 @@ static struct drm_driver driver = { .desc = DRIVER_DESC, #if RTLNX_VER_MAX(6,14,0) .date = DRIVER_DATE, +#endif +#if RTLNX_VER_MIN(6,15,0) + .fbdev_probe = vboxfb_create, #endif .major = DRIVER_MAJOR, .minor = DRIVER_MINOR, @@ -411,7 +420,9 @@ static struct drm_driver driver = { .prime_fd_to_handle = drm_gem_prime_fd_to_handle, #endif .gem_prime_import = drm_gem_prime_import, +#if RTLNX_VER_MAX(6,15,0) .gem_prime_import_sg_table = vbox_gem_prime_import_sg_table, +#endif #if RTLNX_VER_MAX(6,6,0) && !RTLNX_RHEL_RANGE(9,4, 9,99) && !RTLNX_SUSE_MAJ_PREREQ(15, 6) .gem_prime_mmap = vbox_gem_prime_mmap, #endif diff --git a/src/VBox/Additions/linux/drm/vbox_drv.h b/src/VBox/Additions/linux/drm/vbox_drv.h index ed38d1f3..c3651d21 100644 --- a/src/VBox/Additions/linux/drm/vbox_drv.h +++ b/src/VBox/Additions/linux/drm/vbox_drv.h @@ -433,6 +433,8 @@ int vbox_framebuffer_init(struct drm_device *dev, #endif struct drm_gem_object *obj); +int vboxfb_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes); + int vbox_fbdev_init(struct drm_device *dev); void vbox_fbdev_fini(struct drm_device *dev); void vbox_fbdev_set_base(struct vbox_private *vbox, unsigned long gpu_addr); diff --git a/src/VBox/Additions/linux/drm/vbox_fb.c b/src/VBox/Additions/linux/drm/vbox_fb.c index 7154a529..66bf7438 100644 --- a/src/VBox/Additions/linux/drm/vbox_fb.c +++ b/src/VBox/Additions/linux/drm/vbox_fb.c @@ -265,7 +265,7 @@ static struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *helper) } #endif -static int vboxfb_create(struct drm_fb_helper *helper, +int vboxfb_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { struct vbox_fbdev *fbdev = @@ -413,9 +413,11 @@ static int vboxfb_create(struct drm_fb_helper *helper, return 0; } +#if RTLNX_VER_MAX(6,15,0) static struct drm_fb_helper_funcs vbox_fb_helper_funcs = { .fb_probe = vboxfb_create, }; +#endif #if RTLNX_VER_MAX(4,3,0) && !RTLNX_RHEL_MAJ_PREREQ(7,3) static void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper) @@ -484,7 +486,9 @@ int vbox_fbdev_init(struct drm_device *dev) vbox->fbdev = fbdev; spin_lock_init(&fbdev->dirty_lock); -#if RTLNX_VER_MIN(6,3,0) || RTLNX_RHEL_RANGE(8,9, 8,99) || RTLNX_RHEL_RANGE(9,3, 9,99) +#if RTLNX_VER_MIN(6,15,0) + drm_fb_helper_prepare(dev, &fbdev->helper, 32, NULL); +#elif RTLNX_VER_MIN(6,3,0) || RTLNX_RHEL_RANGE(8,9, 8,99) || RTLNX_RHEL_RANGE(9,3, 9,99) drm_fb_helper_prepare(dev, &fbdev->helper, 32, &vbox_fb_helper_funcs); #elif RTLNX_VER_MIN(3,17,0) || RTLNX_RHEL_MIN(7,2) drm_fb_helper_prepare(dev, &fbdev->helper, &vbox_fb_helper_funcs); diff --git a/src/VBox/Additions/linux/drm/vbox_mode.c b/src/VBox/Additions/linux/drm/vbox_mode.c index 9d6add67..6284fa88 100644 --- a/src/VBox/Additions/linux/drm/vbox_mode.c +++ b/src/VBox/Additions/linux/drm/vbox_mode.c @@ -660,12 +660,13 @@ static int vbox_get_modes(struct drm_connector *connector) return num_modes; } -#if RTLNX_VER_MAX(3,14,0) && !RTLNX_RHEL_MAJ_PREREQ(7,1) -static int vbox_mode_valid(struct drm_connector *connector, +#if RTLNX_VER_MIN(6,15,0) +static enum drm_mode_status vbox_mode_valid(struct drm_connector *connector, const struct drm_display_mode *mode) +#elif RTLNX_VER_MIN(3,14,0) || RTLNX_RHEL_MAJ_PREREQ(7,1) +static enum drm_mode_status vbox_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) #else -static enum drm_mode_status vbox_mode_valid(struct drm_connector *connector, +static int vbox_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) #endif - struct drm_display_mode *mode) { return MODE_OK; } diff --git a/src/VBox/Additions/linux/drm/vbox_prime.c b/src/VBox/Additions/linux/drm/vbox_prime.c index a2a7467c..4567033d 100644 --- a/src/VBox/Additions/linux/drm/vbox_prime.c +++ b/src/VBox/Additions/linux/drm/vbox_prime.c @@ -49,18 +49,20 @@ struct sg_table *vbox_gem_prime_get_sg_table(struct drm_gem_object *obj) return ERR_PTR(-ENOSYS); } -#if RTLNX_VER_MAX(3,18,0) && !RTLNX_RHEL_MAJ_PREREQ(7,2) +#if RTLNX_VER_MAX(6,15,0) +# if RTLNX_VER_MAX(3,18,0) && !RTLNX_RHEL_MAJ_PREREQ(7,2) struct drm_gem_object *vbox_gem_prime_import_sg_table( struct drm_device *dev, size_t size, struct sg_table *table) -#else +# else struct drm_gem_object *vbox_gem_prime_import_sg_table( struct drm_device *dev, struct dma_buf_attachment *attach, struct sg_table *table) -#endif +# endif { WARN_ONCE(1, "not implemented"); return ERR_PTR(-ENOSYS); } +#endif void *vbox_gem_prime_vmap(struct drm_gem_object *obj) { diff --git a/src/VBox/Additions/linux/installer/vboxadd.sh b/src/VBox/Additions/linux/installer/vboxadd.sh index 6be49f50..3c203ecb 100755 --- a/src/VBox/Additions/linux/installer/vboxadd.sh +++ b/src/VBox/Additions/linux/installer/vboxadd.sh @@ -1,7 +1,7 @@ #! /bin/sh # $Id: vboxadd.sh $ ## @file -# Linux Additions kernel module init script ($Revision: 168394 $) +# Linux Additions kernel module init script ($Revision: 168899 $) # # @@ -536,9 +536,10 @@ setup_modules() export KERN_VER info "Building the modules for kernel $KERN_VER." - # Prepend PATH for building UEK7 on OL8 distribution. + # Prepend PATH for building UEK on OL8/9 distributions. case "$KERN_VER" in 5.15.0-*.el8uek*) PATH="/opt/rh/gcc-toolset-11/root/usr/bin:$PATH";; + 6.12.0-*.el9uek*)PATH="/opt/rh/gcc-toolset-14/root/usr/bin:$PATH";; esac # Detect if kernel was built with clang. @@ -1041,6 +1042,8 @@ check_status_kernel() # Do not spoil $?. true fi + else + false fi # Module vboxvideo is optional and expected to be loaded only when VM is diff --git a/src/VBox/Additions/linux/sharedfolders/dirops.c b/src/VBox/Additions/linux/sharedfolders/dirops.c index c56c0d19..40fa4391 100644 --- a/src/VBox/Additions/linux/sharedfolders/dirops.c +++ b/src/VBox/Additions/linux/sharedfolders/dirops.c @@ -1088,7 +1088,9 @@ static int vbsf_inode_create(struct inode *parent, struct dentry *dentry, int mo * @param mode file mode * @returns 0 on success, Linux error code otherwise */ -#if RTLNX_VER_MIN(6,3,0) || RTLNX_RHEL_RANGE(9,6, 9,99) || defined(DOXYGEN_RUNNING) +#if RTLNX_VER_MIN(6,15,0) +static struct dentry *vbsf_inode_mkdir(struct mnt_idmap *idmap, struct inode *parent, struct dentry *dentry, umode_t mode) +#elif RTLNX_VER_MIN(6,3,0) || RTLNX_RHEL_RANGE(9,6, 9,99) || defined(DOXYGEN_RUNNING) static int vbsf_inode_mkdir(struct mnt_idmap *idmap, struct inode *parent, struct dentry *dentry, umode_t mode) #elif RTLNX_VER_MIN(5,12,0) static int vbsf_inode_mkdir(struct user_namespace *ns, struct inode *parent, struct dentry *dentry, umode_t mode) @@ -1098,14 +1100,22 @@ static int vbsf_inode_mkdir(struct inode *parent, struct dentry *dentry, umode_t static int vbsf_inode_mkdir(struct inode *parent, struct dentry *dentry, int mode) #endif { + int rc; + TRACE(); AssertMsg(!(mode & S_IFMT) || (mode & S_IFMT) == S_IFDIR, ("0%o\n", mode)); - return vbsf_create_worker(parent, dentry, (mode & ~S_IFMT) | S_IFDIR, - SHFL_CF_ACT_CREATE_IF_NEW - | SHFL_CF_ACT_FAIL_IF_EXISTS - | SHFL_CF_ACCESS_READWRITE - | SHFL_CF_DIRECTORY, - false /*fStashHandle*/, false /*fDoLookup*/, NULL /*phHandle*/, NULL /*fCreated*/); + + rc = vbsf_create_worker(parent, dentry, (mode & ~S_IFMT) | S_IFDIR, + SHFL_CF_ACT_CREATE_IF_NEW + | SHFL_CF_ACT_FAIL_IF_EXISTS + | SHFL_CF_ACCESS_READWRITE + | SHFL_CF_DIRECTORY, + false /*fStashHandle*/, false /*fDoLookup*/, NULL /*phHandle*/, NULL /*fCreated*/); +#if RTLNX_VER_MIN(6,15,0) + return ERR_PTR(rc); +#else + return rc; +#endif } diff --git a/src/VBox/Additions/linux/sharedfolders/regops.c b/src/VBox/Additions/linux/sharedfolders/regops.c index a72d0370..f252ee33 100644 --- a/src/VBox/Additions/linux/sharedfolders/regops.c +++ b/src/VBox/Additions/linux/sharedfolders/regops.c @@ -3695,11 +3695,12 @@ static int vbsf_readpage(struct file *file, struct page *page) * Needed for mmap and writes when the file is mmapped in a shared+writeable * fashion. */ -#if RTLNX_VER_MIN(2,5,52) +#if RTLNX_VER_MAX(6,16,0) +# if RTLNX_VER_MIN(2,5,52) static int vbsf_writepage(struct page *page, struct writeback_control *wbc) -#else +# else static int vbsf_writepage(struct page *page) -#endif +# endif { struct address_space *mapping = page->mapping; struct inode *inode = mapping->host; @@ -3742,11 +3743,11 @@ static int vbsf_writepage(struct page *page) && offEndOfWrite > i_size_read(inode)) i_size_write(inode, offEndOfWrite); -#if RTLNX_VER_MAX(6,12,0) +# if RTLNX_VER_MAX(6,12,0) /* Update and unlock the page. */ if (PageError(page)) ClearPageError(page); -#endif +# endif SetPageUptodate(page); unlock_page(page); @@ -3768,12 +3769,13 @@ static int vbsf_writepage(struct page *page) printk("vbsf_writepage: no writable handle for %s..\n", sf_i->path->String.ach); err = -EIO; } -#if RTLNX_VER_MAX(6,12,0) +# if RTLNX_VER_MAX(6,12,0) SetPageError(page); -#endif +# endif unlock_page(page); return err; } +#endif /* < 6.16.0 */ #if RTLNX_VER_MIN(2,6,24) @@ -3905,7 +3907,9 @@ struct address_space_operations vbsf_reg_aops = { #else .readpage = vbsf_readpage, #endif +#if RTLNX_VER_MAX(6,16,0) .writepage = vbsf_writepage, +#endif /** @todo Need .writepages if we want msync performance... */ #if RTLNX_VER_MIN(5,18,0) || RTLNX_RHEL_RANGE(9,2, 9,99) .dirty_folio = filemap_dirty_folio, diff --git a/src/VBox/Devices/Audio/DrvAudio.cpp b/src/VBox/Devices/Audio/DrvAudio.cpp index 874d9ace..8f4b17d3 100644 --- a/src/VBox/Devices/Audio/DrvAudio.cpp +++ b/src/VBox/Devices/Audio/DrvAudio.cpp @@ -3168,8 +3168,8 @@ static int drvAudioStreamPreBufComitting(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStrea uint32_t cbPreBufWritten = 0; rc = pThis->pHostDrvAudio->pfnStreamPlay(pThis->pHostDrvAudio, pStreamEx->pBackend, &pStreamEx->Out.pbPreBuf[off], cbToWrite, &cbPreBufWritten); - AssertRCBreak(rc); - if (!cbPreBufWritten) + if ( RT_FAILURE(rc) + || !cbPreBufWritten) break; AssertStmt(cbPreBufWritten <= cbToWrite, cbPreBufWritten = cbToWrite); off = (off + cbPreBufWritten) % cbAlloc; diff --git a/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp b/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp index 6917f320..ab8cfd89 100644 --- a/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp +++ b/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp @@ -154,6 +154,10 @@ typedef struct DRVHOSTAUDIOWASCACHEDEV /** Support for AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY: -1=unknown, 0=no, 1=yes. */ int8_t fSupportsSrcDefaultQuality; #endif + /** Flag indicating whether this device is considered as being 'stale' + * (non-working / outdated interface / whatever) and can be removed + * from the cache (if enabled). */ + bool fStale; /** List of cached configurations (DRVHOSTAUDIOWASCACHEDEVCFG). */ RTLISTANCHOR ConfigList; /** The device ID length in RTUTF16 units. */ @@ -276,10 +280,10 @@ typedef struct DRVHOSTAUDIOWAS /** Semaphore for signalling that cache purge is done and that the destructor * can do cleanups. */ RTSEMEVENTMULTI hEvtCachePurge; - /** Total number of device config entire for capturing. + /** Total number of device config entries for capturing. * This includes in-use ones. */ uint32_t volatile cCacheEntriesIn; - /** Total number of device config entire for playback. + /** Total number of device config entries for playback. * This includes in-use ones. */ uint32_t volatile cCacheEntriesOut; @@ -577,7 +581,7 @@ public: * of a device role, so we try avoiding that by only caring about eMultimedia. * * See @bugref{10844} */ - && (enmRole == eMultimedia) + && enmRole == eMultimedia ) { pIEnumerator = m_pDrvWas->pIEnumerator; @@ -1158,6 +1162,7 @@ static int drvHostAudioWasCacheLookupOrCreateConfig(PDRVHOSTAUDIOWAS pThis, PDRV PCPDMAUDIOSTREAMCFG pCfgReq, bool fUseCache, bool fOnWorker, PDRVHOSTAUDIOWASCACHEDEVCFG *ppDevCfg) { + Assert(!pDevEntry->fStale); PDRVHOSTAUDIOWASCACHEDEVCFG pDevCfg; /* @@ -1234,6 +1239,40 @@ static int drvHostAudioWasCacheLookupOrCreateConfig(PDRVHOSTAUDIOWAS pThis, PDRV } +/** + * Invalidates device cache entry configurations. + * + * @param pThis The WASAPI host audio driver instance data. + * @param pDevEntry The device entry to invalidate. + */ +static void drvHostAudioWasCacheInvalidateDevEntryConfig(PDRVHOSTAUDIOWAS pThis, PDRVHOSTAUDIOWASCACHEDEV pDevEntry) +{ + RT_NOREF(pThis); + + LogRelFunc(("Invalidating cache entry configurations: %p - '%ls'\n", pDevEntry, pDevEntry->wszDevId)); + + PDRVHOSTAUDIOWASCACHEDEVCFG pDevCfg, pDevCfgNext; + RTListForEachSafe(&pDevEntry->ConfigList, pDevCfg, pDevCfgNext, DRVHOSTAUDIOWASCACHEDEVCFG, ListEntry) + { + if (pDevCfg->pIAudioClient) + { + pDevCfg->pIAudioClient->Reset(); + pDevCfg->pIAudioClient->Release(); + pDevCfg->pIAudioClient = NULL; + + } + + if (pDevCfg->pIAudioRenderClient) + { + pDevCfg->pIAudioRenderClient->Release(); + pDevCfg->pIAudioRenderClient = NULL; + } + + pDevCfg->rcSetup = VERR_AUDIO_STREAM_INIT_IN_PROGRESS; + } +} + + /** * Looks up the given device + config combo in the cache, creating a new entry * if missing. @@ -1256,13 +1295,12 @@ static int drvHostAudioWasCacheLookupOrCreate(PDRVHOSTAUDIOWAS pThis, IMMDevice { *ppDevCfg = NULL; - LogRel2(("WasAPI: Looking up or creating cache entry (caching is set to %s, iface %p)\n", - pThis->fCacheEnabled ? "enabled" : "disabled", pIDevice)); + LogRel(("WasAPI: Looking up or creating cache entry (caching is set to %s, iface %p, %s init)\n", + pThis->fCacheEnabled ? "enabled" : "disabled", pIDevice, fOnWorker ? "on worker" : "async")); /* * Get the device ID so we can perform the lookup. */ - int rc = VERR_AUDIO_STREAM_COULD_NOT_CREATE; LPWSTR pwszDevId = NULL; HRESULT hrc = pIDevice->GetId(&pwszDevId); if (SUCCEEDED(hrc)) @@ -1295,13 +1333,12 @@ static int drvHostAudioWasCacheLookupOrCreate(PDRVHOSTAUDIOWAS pThis, IMMDevice { LogRel2(("WasAPI: Checking for cached device '%ls' ...\n", pwszDevId)); -#define DEVICE_STALE_OR_INVALID_BREAK(a_LogRel2What) \ - { \ +#define DEVICE_STALE_OR_INVALID(a_LogRel2What) \ + do { \ LogRel2(a_LogRel2What); \ LogRel(("WasAPI: Stale or invalid audio interface '%ls' detected!\n", pDevEntry->wszDevId)); \ - rc = VERR_AUDIO_STREAM_NOT_READY; \ - break; \ - } + pDevEntry->fStale = true; \ + } while (0) /* * The cache has two levels, so first the device entry. */ @@ -1311,43 +1348,55 @@ static int drvHostAudioWasCacheLookupOrCreate(PDRVHOSTAUDIOWAS pThis, IMMDevice { if ( pDevEntry->cwcDevId == cwcDevId && pDevEntry->enmDir == pCfgReq->enmDir - && RTUtf16Cmp(pDevEntry->wszDevId, pwszDevId) == 0) + && !pDevEntry->fStale + && memcmp(pDevEntry->wszDevId, pwszDevId, cwcDevId * sizeof(RTUTF16)) == 0) { /* * Cache hit. - * First we need to check if the cached device interface is in a working (active) shape. - */ - AssertPtrBreakStmt(pDevEntry->pIDevice, rc = VERR_AUDIO_STREAM_NOT_READY); /* Paranoia. */ - hrc = pDevEntry->pIDevice->GetState(&dwState); - if (SUCCEEDED(hrc)) - { - if (dwState != DEVICE_STATE_ACTIVE) - DEVICE_STALE_OR_INVALID_BREAK(("WasAPI: Cache hit for device '%ls': Is in non-active state (state is %s)\n", - pDevEntry->wszDevId, drvHostAudioWasMMDeviceStateToString(dwState))); - } - else - DEVICE_STALE_OR_INVALID_BREAK(("WasAPI: Cache hit for device '%ls': Unable to retrieve state (hr=%#x)\n", - pDevEntry->wszDevId, hrc)); - /* - * Next we now need to also check if the device interface we want to look up - * actually matches the one we have in the cache entry. * - * If it doesn't, bail out and add a new device entry to the cache with the new interface below then. + * First we need to check if the device interface we want to look up + * actually matches the one we have in the cache entry. If it doesn't, + * mark it as stale and continue looking. (We'll probably end up adding a + * new device entry to the cache with the new interface below.) * - * This is needed when switching audio interfaces and the device interface becomes invalid via - * AUDCLNT_E_DEVICE_INVALIDATED. See @bugref{10503} + * This is needed when switching audio interfaces and the device interface + * becomes invalid via AUDCLNT_E_DEVICE_INVALIDATED. See @bugref{10503}. */ if (pDevEntry->pIDevice != pIDevice) - DEVICE_STALE_OR_INVALID_BREAK(("WasAPI: Cache hit for device '%ls': Stale interface detected (new: %p, old: %p)\n", - pDevEntry->wszDevId, pIDevice, pDevEntry->pIDevice)); + DEVICE_STALE_OR_INVALID(("WasAPI: Cache hit for device '%ls': Stale interface detected (new: %p, old: %p)\n", + pDevEntry->wszDevId, pIDevice, pDevEntry->pIDevice)); + else + { + /* + * Second, we need to check if the cached device interface is in a + * working (active) shape. + */ +#if 0 /* However we've already checked this above, outside the loop and the pDevEntry->pIDevice == pIDevice! */ + hrc = pDevEntry->pIDevice->GetState(&dwState); + if (SUCCEEDED(hrc)) + { + if (dwState != DEVICE_STATE_ACTIVE) + DEVICE_STALE_OR_INVALID(("WasAPI: Cache hit for device '%ls': Is in non-active state (state is %s)\n", + pDevEntry->wszDevId, drvHostAudioWasMMDeviceStateToString(dwState))); + } + else + DEVICE_STALE_OR_INVALID(("WasAPI: Cache hit for device '%ls': Unable to retrieve state (hr=%#x)\n", + pDevEntry->wszDevId, hrc)); +#endif + } - LogRel2(("WasAPI: Cache hit for device '%ls' (iface %p)\n", pwszDevId, pIDevice)); + LogRelFunc(("WasAPI: fOnWorker=%RTbool, fStaleDevice=%RTbool\n", fOnWorker, pDevEntry->fStale)); - CoTaskMemFree(pwszDevId); - pwszDevId = NULL; + if (!pDevEntry->fStale) + { + LogRel2(("WasAPI: Cache hit for device '%ls' (iface %p)\n", pwszDevId, pIDevice)); - return drvHostAudioWasCacheLookupOrCreateConfig(pThis, pDevEntry, pCfgReq, - true /* fUseCache */, fOnWorker, ppDevCfg); + CoTaskMemFree(pwszDevId); + pwszDevId = NULL; + + return drvHostAudioWasCacheLookupOrCreateConfig(pThis, pDevEntry, pCfgReq, + true /* fUseCache */, fOnWorker, ppDevCfg); + } } } RTCritSectLeave(&pThis->CritSectCache); @@ -1355,27 +1404,11 @@ static int drvHostAudioWasCacheLookupOrCreate(PDRVHOSTAUDIOWAS pThis, IMMDevice if (!pDevEntry) LogRel2(("WasAPI: Cache miss for device '%ls' (iface %p)\n", pwszDevId, pIDevice)); -#undef DEVICE_STALE_OR_INVALID_BREAK +#undef DEVICE_STALE_OR_INVALID } - /* - * If we got a stale or somehow other invalid cache entry, remove it first. - */ - if ( pThis->fCacheEnabled - && pDevEntry /* Cache hit? */ - && rc == VERR_AUDIO_STREAM_NOT_READY) - { - LogRel2(("WasAPI: Removing stale device '%ls' from cache (iface %p)\n", pDevEntry->wszDevId, pDevEntry->pIDevice)); - - RTCritSectEnter(&pThis->CritSectCache); - RTListNodeRemove(&pDevEntry->ListEntry); - RTCritSectLeave(&pThis->CritSectCache); - - drvHostAudioWasCacheDestroyDevEntry(pThis, pDevEntry); - pDevEntry = NULL; - - rc = VINF_SUCCESS; - } + /* Note: An active device marked as being stale will be removed from the cache + after the device switch has been completed. */ /* * Device not in the cache (anymore), (re-)add it. @@ -1411,11 +1444,13 @@ static int drvHostAudioWasCacheLookupOrCreate(PDRVHOSTAUDIOWAS pThis, IMMDevice RTListForEach(&pThis->CacheHead, pDevEntry2, DRVHOSTAUDIOWASCACHEDEV, ListEntry) { if ( pDevEntry2->cwcDevId == cwcDevId + && !pDevEntry->fStale /* Note: We have to compare the device interface here as well, as a cached device entry might - * have a stale audio interface for the same device. In such a case a new device entry will be created below. */ + have a stale audio interface for the same device. In such a case a new device entry will be created below. + Update: This predates the fStale flag and is just kept for safety. */ && pDevEntry2->pIDevice == pIDevice && pDevEntry2->enmDir == pCfgReq->enmDir - && RTUtf16Cmp(pDevEntry2->wszDevId, pDevEntry->wszDevId) == 0) + && memcmp(pDevEntry2->wszDevId, pDevEntry->wszDevId, cwcDevId * sizeof(RTUTF16)) == 0) { pIDevice->Release(); RTMemFree(pDevEntry); @@ -1440,7 +1475,7 @@ static int drvHostAudioWasCacheLookupOrCreate(PDRVHOSTAUDIOWAS pThis, IMMDevice } else LogRelMax(64, ("WasAPI: GetId failed (lookup): %Rhrc\n", hrc)); - return rc; + return VERR_AUDIO_STREAM_COULD_NOT_CREATE; } @@ -2000,6 +2035,17 @@ static void drvHostAudioWasCompleteStreamDevSwitch(PDRVHOSTAUDIOWAS pThis, PDRVH /* Put the old config back into the cache. */ drvHostAudioWasCachePutBack(pThis, pDevCfgOld); + AssertPtr(pDevCfgOld->pDevEntry); + if (pDevCfgOld->pDevEntry->fStale) + { + LogRelFunc(("Removing stale device from cache\n")); + RTListNodeRemove(&pDevCfgOld->pDevEntry->ListEntry); + + drvHostAudioWasCacheInvalidateDevEntryConfig(pThis, pDevCfgOld->pDevEntry); + drvHostAudioWasCacheDestroyDevEntry(pThis, pDevCfgOld->pDevEntry); + pDevCfgOld = NULL; /* Got invalid due to drvHostAudioWasCacheDestroyDevEntry() above. */ + } + LogFlowFunc(("returns with '%s' state: %s\n", pStreamWas->Cfg.szName, drvHostWasStreamStatusString(pStreamWas) )); } @@ -2041,6 +2087,7 @@ static DECLCALLBACK(void) drvHostAudioWasHA_DoOnWorkerThread(PPDMIHOSTAUDIO pInt switch (uUser) { case DRVHOSTAUDIOWAS_DO_PURGE_CACHE: + LogFlowFunc(("DRVHOSTAUDIOWAS_DO_PURGE_CACHE\n")); Assert(pStream == NULL); Assert(pvUser == NULL); Assert(pThis->fCacheEnabled); @@ -2048,6 +2095,7 @@ static DECLCALLBACK(void) drvHostAudioWasHA_DoOnWorkerThread(PPDMIHOSTAUDIO pInt break; case DRVHOSTAUDIOWAS_DO_PRUNE_CACHE: + LogFlowFunc(("DRVHOSTAUDIOWAS_DO_PRUNE_CACHE\n")); Assert(pStream == NULL); Assert(pvUser == NULL); Assert(pThis->fCacheEnabled); @@ -2055,6 +2103,7 @@ static DECLCALLBACK(void) drvHostAudioWasHA_DoOnWorkerThread(PPDMIHOSTAUDIO pInt break; case DRVHOSTAUDIOWAS_DO_STREAM_DEV_SWITCH: + LogFlowFunc(("DRVHOSTAUDIOWAS_DO_STREAM_DEV_SWITCH\n")); AssertPtr(pStream); AssertPtr(pvUser); drvHostAudioWasDoStreamDevSwitch(pThis, (PDRVHOSTAUDIOWASSTREAM)pStream, (PDRVHOSTAUDIOWASCACHEDEVCFG)pvUser); diff --git a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd index 73442401..144b376c 100644 Binary files a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd and b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd differ diff --git a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd index 801b2e7d..1619c103 100644 Binary files a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd and b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd differ diff --git a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFIAArch32.fd b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFIAArch32.fd index 6bc4a00b..751f2dc4 100644 Binary files a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFIAArch32.fd and b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFIAArch32.fd differ diff --git a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFIAArch64.fd b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFIAArch64.fd index 63974d85..3669ab4e 100644 Binary files a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFIAArch64.fd and b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFIAArch64.fd differ diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative286.asm b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative286.asm index 1c3c702a..89248f94 100644 --- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative286.asm +++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative286.asm @@ -1513,7 +1513,7 @@ init_bios_area: ; 0xc0a27 LB 0x3e mov word [es:bx+00087h], 0f960h ; 26 c7 87 87 00 60 f9 ; 0xc0a44 vgabios.c:234 mov byte [es:bx+00089h], 051h ; 26 c6 87 89 00 51 ; 0xc0a4b vgabios.c:238 mov byte [es:bx+065h], 009h ; 26 c6 47 65 09 ; 0xc0a51 vgabios.c:240 - mov word [es:bx+000a8h], 0554dh ; 26 c7 87 a8 00 4d 55 ; 0xc0a56 vgabios.c:242 + mov word [es:bx+000a8h], 0554eh ; 26 c7 87 a8 00 4e 55 ; 0xc0a56 vgabios.c:242 mov [es:bx+000aah], ds ; 26 8c 9f aa 00 ; 0xc0a5d pop bp ; 5d ; 0xc0a62 vgabios.c:243 pop bx ; 5b ; 0xc0a63 @@ -2002,7 +2002,7 @@ vga_read_char_attr: ; 0xc0dd6 LB 0x130 mov bl, byte [bp-00ch] ; 8a 5e f4 ; 0xc0e40 vgabios.c:557 xor bh, bh ; 30 ff ; 0xc0e43 sal bx, 003h ; c1 e3 03 ; 0xc0e45 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc0e48 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc0e48 jne short 00e7fh ; 75 30 ; 0xc0e4d mov ax, di ; 89 f8 ; 0xc0e4f vgabios.c:559 mul word [bp-014h] ; f7 66 ec ; 0xc0e51 @@ -2020,13 +2020,13 @@ vga_read_char_attr: ; 0xc0dd6 LB 0x130 add di, dx ; 01 d7 ; 0xc0e6b add di, di ; 01 ff ; 0xc0e6d add di, cx ; 01 cf ; 0xc0e6f - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc0e71 vgabios.c:55 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc0e71 vgabios.c:55 mov ax, word [es:di] ; 26 8b 05 ; 0xc0e75 push SS ; 16 ; 0xc0e78 vgabios.c:58 pop ES ; 07 ; 0xc0e79 mov word [es:si], ax ; 26 89 04 ; 0xc0e7a jmp short 00dffh ; eb 80 ; 0xc0e7d vgabios.c:561 - mov bl, byte [bx+047adh] ; 8a 9f ad 47 ; 0xc0e7f vgabios.c:562 + mov bl, byte [bx+047aeh] ; 8a 9f ae 47 ; 0xc0e7f vgabios.c:562 cmp bl, 005h ; 80 fb 05 ; 0xc0e83 je short 00ed6h ; 74 4e ; 0xc0e86 cmp bl, 002h ; 80 fb 02 ; 0xc0e88 @@ -2129,18 +2129,18 @@ vga_get_font_info: ; 0xc0f16 LB 0x83 retn 00002h ; c2 02 00 ; 0xc0f6f mov bx, 0010ch ; bb 0c 01 ; 0xc0f72 vgabios.c:67 jmp short 00f30h ; eb b9 ; 0xc0f75 - mov dx, 05d69h ; ba 69 5d ; 0xc0f77 vgabios.c:601 + mov dx, 05d6ah ; ba 6a 5d ; 0xc0f77 vgabios.c:601 mov ax, ds ; 8c d8 ; 0xc0f7a jmp short 00f3bh ; eb bd ; 0xc0f7c vgabios.c:602 - mov dx, 05569h ; ba 69 55 ; 0xc0f7e vgabios.c:604 + mov dx, 0556ah ; ba 6a 55 ; 0xc0f7e vgabios.c:604 jmp short 00f7ah ; eb f7 ; 0xc0f81 - mov dx, 05969h ; ba 69 59 ; 0xc0f83 vgabios.c:607 + mov dx, 0596ah ; ba 6a 59 ; 0xc0f83 vgabios.c:607 jmp short 00f7ah ; eb f2 ; 0xc0f86 - mov dx, 07b69h ; ba 69 7b ; 0xc0f88 vgabios.c:610 + mov dx, 07b6ah ; ba 6a 7b ; 0xc0f88 vgabios.c:610 jmp short 00f7ah ; eb ed ; 0xc0f8b - mov dx, 06b69h ; ba 69 6b ; 0xc0f8d vgabios.c:613 + mov dx, 06b6ah ; ba 6a 6b ; 0xc0f8d vgabios.c:613 jmp short 00f7ah ; eb e8 ; 0xc0f90 - mov dx, 07c96h ; ba 96 7c ; 0xc0f92 vgabios.c:616 + mov dx, 07c97h ; ba 97 7c ; 0xc0f92 vgabios.c:616 jmp short 00f7ah ; eb e3 ; 0xc0f95 jmp short 00f6ch ; eb d3 ; 0xc0f97 vgabios.c:622 ; disGetNextSymbol 0xc0f99 LB 0x3599 -> off=0x0 cb=0000000000000166 uValue=00000000000c0f99 'vga_read_pixel' @@ -2166,10 +2166,10 @@ vga_read_pixel: ; 0xc0f99 LB 0x166 mov bl, al ; 88 c3 ; 0xc0fc1 vgabios.c:645 xor bh, bh ; 30 ff ; 0xc0fc3 sal bx, 003h ; c1 e3 03 ; 0xc0fc5 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc0fc8 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc0fc8 jne short 00fd2h ; 75 03 ; 0xc0fcd jmp near 010f8h ; e9 26 01 ; 0xc0fcf vgabios.c:646 - mov ch, byte [bx+047adh] ; 8a af ad 47 ; 0xc0fd2 vgabios.c:649 + mov ch, byte [bx+047aeh] ; 8a af ae 47 ; 0xc0fd2 vgabios.c:649 cmp ch, 003h ; 80 fd 03 ; 0xc0fd6 jc short 00feah ; 72 0f ; 0xc0fd9 jbe short 00ff2h ; 76 15 ; 0xc0fdb @@ -2225,7 +2225,7 @@ vga_read_pixel: ; 0xc0f99 LB 0x166 inc byte [bp-006h] ; fe 46 fa ; 0xc1058 vgabios.c:661 jmp short 0102ch ; eb cf ; 0xc105b jmp near 010f0h ; e9 90 00 ; 0xc105d - mov cl, byte [bx+047aeh] ; 8a 8f ae 47 ; 0xc1060 vgabios.c:664 + mov cl, byte [bx+047afh] ; 8a 8f af 47 ; 0xc1060 vgabios.c:664 xor ch, ch ; 30 ed ; 0xc1064 mov bx, strict word 00004h ; bb 04 00 ; 0xc1066 sub bx, cx ; 29 cb ; 0xc1069 @@ -2246,7 +2246,7 @@ vga_read_pixel: ; 0xc0f99 LB 0x166 mov bl, ah ; 88 e3 ; 0xc108c vgabios.c:668 xor bh, bh ; 30 ff ; 0xc108e sal bx, 003h ; c1 e3 03 ; 0xc1090 - cmp byte [bx+047aeh], 002h ; 80 bf ae 47 02 ; 0xc1093 + cmp byte [bx+047afh], 002h ; 80 bf af 47 02 ; 0xc1093 jne short 010b5h ; 75 1b ; 0xc1098 mov cx, si ; 89 f1 ; 0xc109a vgabios.c:669 xor ch, ch ; 30 ed ; 0xc109c @@ -2610,7 +2610,7 @@ biosfn_set_active_page: ; 0xc1322 LB 0xd8 xor bh, bh ; 30 ff ; 0xc135b mov si, bx ; 89 de ; 0xc135d sal si, 003h ; c1 e6 03 ; 0xc135f - cmp byte [si+047ach], 000h ; 80 bc ac 47 00 ; 0xc1362 + cmp byte [si+047adh], 000h ; 80 bc ad 47 00 ; 0xc1362 jne short 013a8h ; 75 3f ; 0xc1367 mov bx, strict word 0004ah ; bb 4a 00 ; 0xc1369 vgabios.c:57 mov ax, strict word 00040h ; b8 40 00 ; 0xc136c @@ -2637,11 +2637,11 @@ biosfn_set_active_page: ; 0xc1322 LB 0xd8 lea ax, [di+001h] ; 8d 45 01 ; 0xc13a0 mul word [bp-00ch] ; f7 66 f4 ; 0xc13a3 jmp short 013b7h ; eb 0f ; 0xc13a6 vgabios.c:860 - mov bl, byte [bx+0482bh] ; 8a 9f 2b 48 ; 0xc13a8 vgabios.c:862 + mov bl, byte [bx+0482ch] ; 8a 9f 2c 48 ; 0xc13a8 vgabios.c:862 sal bx, 006h ; c1 e3 06 ; 0xc13ac mov al, cl ; 88 c8 ; 0xc13af xor ah, ah ; 30 e4 ; 0xc13b1 - mul word [bx+04842h] ; f7 a7 42 48 ; 0xc13b3 + mul word [bx+04843h] ; f7 a7 43 48 ; 0xc13b3 mov bx, ax ; 89 c3 ; 0xc13b7 mov si, strict word 00063h ; be 63 00 ; 0xc13b9 vgabios.c:57 mov ax, strict word 00040h ; b8 40 00 ; 0xc13bc @@ -2686,7 +2686,7 @@ find_vpti: ; 0xc13fa LB 0x45 xor bh, bh ; 30 ff ; 0xc1401 mov si, bx ; 89 de ; 0xc1403 sal si, 003h ; c1 e6 03 ; 0xc1405 - cmp byte [si+047ach], 000h ; 80 bc ac 47 00 ; 0xc1408 + cmp byte [si+047adh], 000h ; 80 bc ad 47 00 ; 0xc1408 jne short 01435h ; 75 26 ; 0xc140d mov si, 00089h ; be 89 00 ; 0xc140f vgabios.c:47 mov ax, strict word 00040h ; b8 40 00 ; 0xc1412 @@ -2694,16 +2694,16 @@ find_vpti: ; 0xc13fa LB 0x45 mov al, byte [es:si] ; 26 8a 04 ; 0xc1417 test AL, strict byte 010h ; a8 10 ; 0xc141a vgabios.c:923 je short 01424h ; 74 06 ; 0xc141c - mov al, byte [bx+07df2h] ; 8a 87 f2 7d ; 0xc141e vgabios.c:924 + mov al, byte [bx+07df3h] ; 8a 87 f3 7d ; 0xc141e vgabios.c:924 jmp short 01432h ; eb 0e ; 0xc1422 vgabios.c:925 test AL, strict byte 080h ; a8 80 ; 0xc1424 je short 0142eh ; 74 06 ; 0xc1426 - mov al, byte [bx+07de2h] ; 8a 87 e2 7d ; 0xc1428 vgabios.c:926 + mov al, byte [bx+07de3h] ; 8a 87 e3 7d ; 0xc1428 vgabios.c:926 jmp short 01432h ; eb 04 ; 0xc142c vgabios.c:927 - mov al, byte [bx+07deah] ; 8a 87 ea 7d ; 0xc142e vgabios.c:928 + mov al, byte [bx+07debh] ; 8a 87 eb 7d ; 0xc142e vgabios.c:928 cbw ; 98 ; 0xc1432 jmp short 0143bh ; eb 06 ; 0xc1433 vgabios.c:929 - mov al, byte [bx+0482bh] ; 8a 87 2b 48 ; 0xc1435 vgabios.c:930 + mov al, byte [bx+0482ch] ; 8a 87 2c 48 ; 0xc1435 vgabios.c:930 xor ah, ah ; 30 e4 ; 0xc1439 pop bp ; 5d ; 0xc143b vgabios.c:933 pop si ; 5e ; 0xc143c @@ -2765,13 +2765,13 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 jne short 01501h ; 75 46 ; 0xc14b9 mov di, cx ; 89 cf ; 0xc14bb vgabios.c:999 sal di, 003h ; c1 e7 03 ; 0xc14bd - mov al, byte [di+047b1h] ; 8a 85 b1 47 ; 0xc14c0 + mov al, byte [di+047b2h] ; 8a 85 b2 47 ; 0xc14c0 mov dx, 003c6h ; ba c6 03 ; 0xc14c4 out DX, AL ; ee ; 0xc14c7 xor al, al ; 30 c0 ; 0xc14c8 vgabios.c:1002 mov dx, 003c8h ; ba c8 03 ; 0xc14ca out DX, AL ; ee ; 0xc14cd - mov cl, byte [di+047b2h] ; 8a 8d b2 47 ; 0xc14ce vgabios.c:1005 + mov cl, byte [di+047b3h] ; 8a 8d b3 47 ; 0xc14ce vgabios.c:1005 cmp cl, 001h ; 80 f9 01 ; 0xc14d2 jc short 014e8h ; 72 11 ; 0xc14d5 jbe short 014f3h ; 76 1a ; 0xc14d7 @@ -2783,24 +2783,24 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 jmp near 0190ah ; e9 22 04 ; 0xc14e5 test cl, cl ; 84 c9 ; 0xc14e8 jne short 01509h ; 75 1d ; 0xc14ea - mov word [bp-014h], 04fbfh ; c7 46 ec bf 4f ; 0xc14ec vgabios.c:1007 + mov word [bp-014h], 04fc0h ; c7 46 ec c0 4f ; 0xc14ec vgabios.c:1007 jmp short 01509h ; eb 16 ; 0xc14f1 vgabios.c:1008 - mov word [bp-014h], 0507fh ; c7 46 ec 7f 50 ; 0xc14f3 vgabios.c:1010 + mov word [bp-014h], 05080h ; c7 46 ec 80 50 ; 0xc14f3 vgabios.c:1010 jmp short 01509h ; eb 0f ; 0xc14f8 vgabios.c:1011 - mov word [bp-014h], 0513fh ; c7 46 ec 3f 51 ; 0xc14fa vgabios.c:1013 + mov word [bp-014h], 05140h ; c7 46 ec 40 51 ; 0xc14fa vgabios.c:1013 jmp short 01509h ; eb 08 ; 0xc14ff vgabios.c:1014 jmp near 01578h ; e9 74 00 ; 0xc1501 - mov word [bp-014h], 051ffh ; c7 46 ec ff 51 ; 0xc1504 vgabios.c:1016 + mov word [bp-014h], 05200h ; c7 46 ec 00 52 ; 0xc1504 vgabios.c:1016 mov al, byte [bp-012h] ; 8a 46 ee ; 0xc1509 vgabios.c:1020 xor ah, ah ; 30 e4 ; 0xc150c mov di, ax ; 89 c7 ; 0xc150e sal di, 003h ; c1 e7 03 ; 0xc1510 - cmp byte [di+047ach], 000h ; 80 bd ac 47 00 ; 0xc1513 + cmp byte [di+047adh], 000h ; 80 bd ad 47 00 ; 0xc1513 jne short 01529h ; 75 0f ; 0xc1518 mov es, [bp-01eh] ; 8e 46 e2 ; 0xc151a vgabios.c:1022 cmp byte [es:si+002h], 008h ; 26 80 7c 02 08 ; 0xc151d jne short 01529h ; 75 05 ; 0xc1522 - mov word [bp-014h], 0507fh ; c7 46 ec 7f 50 ; 0xc1524 vgabios.c:1023 + mov word [bp-014h], 05080h ; c7 46 ec 80 50 ; 0xc1524 vgabios.c:1023 xor cx, cx ; 31 c9 ; 0xc1529 vgabios.c:1026 jmp short 0153ch ; eb 0f ; 0xc152b xor al, al ; 30 c0 ; 0xc152d vgabios.c:1033 @@ -2815,9 +2815,9 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 xor ah, ah ; 30 e4 ; 0xc153f mov di, ax ; 89 c7 ; 0xc1541 sal di, 003h ; c1 e7 03 ; 0xc1543 - mov al, byte [di+047b2h] ; 8a 85 b2 47 ; 0xc1546 + mov al, byte [di+047b3h] ; 8a 85 b3 47 ; 0xc1546 mov di, ax ; 89 c7 ; 0xc154a - mov al, byte [di+0483bh] ; 8a 85 3b 48 ; 0xc154c + mov al, byte [di+0483ch] ; 8a 85 3c 48 ; 0xc154c cmp cx, ax ; 39 c1 ; 0xc1550 jnbe short 0152dh ; 77 d9 ; 0xc1552 imul di, cx, strict byte 00003h ; 6b f9 03 ; 0xc1554 @@ -2928,7 +2928,7 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 xor ah, ah ; 30 e4 ; 0xc1647 mov di, ax ; 89 c7 ; 0xc1649 sal di, 003h ; c1 e7 03 ; 0xc164b - cmp byte [di+047adh], 001h ; 80 bd ad 47 01 ; 0xc164e + cmp byte [di+047aeh], 001h ; 80 bd ae 47 01 ; 0xc164e jne short 0165ah ; 75 05 ; 0xc1653 mov cx, 003b4h ; b9 b4 03 ; 0xc1655 jmp short 0165dh ; eb 03 ; 0xc1658 @@ -2970,9 +2970,9 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 xor ah, ah ; 30 e4 ; 0xc16a8 mov di, ax ; 89 c7 ; 0xc16aa sal di, 003h ; c1 e7 03 ; 0xc16ac - cmp byte [di+047ach], 000h ; 80 bd ac 47 00 ; 0xc16af + cmp byte [di+047adh], 000h ; 80 bd ad 47 00 ; 0xc16af jne short 016c8h ; 75 12 ; 0xc16b4 - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc16b6 vgabios.c:1102 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc16b6 vgabios.c:1102 mov cx, 04000h ; b9 00 40 ; 0xc16ba mov ax, 00720h ; b8 20 07 ; 0xc16bd xor di, di ; 31 ff ; 0xc16c0 @@ -2981,7 +2981,7 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 jmp short 01704h ; eb 3c ; 0xc16c6 vgabios.c:1104 cmp byte [bp-010h], 00dh ; 80 7e f0 0d ; 0xc16c8 vgabios.c:1106 jnc short 016dfh ; 73 11 ; 0xc16cc - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc16ce vgabios.c:1108 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc16ce vgabios.c:1108 mov cx, 04000h ; b9 00 40 ; 0xc16d2 xor al, al ; 30 c0 ; 0xc16d5 xor di, di ; 31 ff ; 0xc16d7 @@ -2998,7 +2998,7 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 mov word [bp-020h], ax ; 89 46 e0 ; 0xc16eb mov AL, strict byte 00fh ; b0 0f ; 0xc16ee vgabios.c:1114 out DX, AL ; ee ; 0xc16f0 - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc16f1 vgabios.c:1115 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc16f1 vgabios.c:1115 mov cx, 08000h ; b9 00 80 ; 0xc16f5 xor ax, ax ; 31 c0 ; 0xc16f8 xor di, di ; 31 ff ; 0xc16fa @@ -3049,7 +3049,7 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 cmp AL, strict byte 007h ; 3c 07 ; 0xc1779 jnbe short 017a2h ; 77 25 ; 0xc177b mov di, ax ; 89 c7 ; 0xc177d vgabios.c:1136 - mov al, byte [di+07ddah] ; 8a 85 da 7d ; 0xc177f + mov al, byte [di+07ddbh] ; 8a 85 db 7d ; 0xc177f mov di, strict word 00065h ; bf 65 00 ; 0xc1783 vgabios.c:52 mov byte [es:di], al ; 26 88 05 ; 0xc1786 cmp byte [bp-010h], 006h ; 80 7e f0 06 ; 0xc1789 vgabios.c:1137 @@ -3065,7 +3065,7 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 xor ah, ah ; 30 e4 ; 0xc17a5 mov di, ax ; 89 c7 ; 0xc17a7 sal di, 003h ; c1 e7 03 ; 0xc17a9 - cmp byte [di+047ach], 000h ; 80 bd ac 47 00 ; 0xc17ac + cmp byte [di+047adh], 000h ; 80 bd ad 47 00 ; 0xc17ac jne short 017bch ; 75 09 ; 0xc17b1 mov dx, strict word 00007h ; ba 07 00 ; 0xc17b3 vgabios.c:1143 mov ax, strict word 00006h ; b8 06 00 ; 0xc17b6 @@ -3086,7 +3086,7 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 xor ah, ah ; 30 e4 ; 0xc17d9 mov di, ax ; 89 c7 ; 0xc17db sal di, 003h ; c1 e7 03 ; 0xc17dd - cmp byte [di+047ach], 000h ; 80 bd ac 47 00 ; 0xc17e0 + cmp byte [di+047adh], 000h ; 80 bd ad 47 00 ; 0xc17e0 jne short 01851h ; 75 6a ; 0xc17e5 mov es, [bp-018h] ; 8e 46 e8 ; 0xc17e7 vgabios.c:1157 mov di, word [es:bx+008h] ; 26 8b 7f 08 ; 0xc17ea @@ -3105,7 +3105,7 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 push strict byte 00000h ; 6a 00 ; 0xc1810 push strict byte 00000h ; 6a 00 ; 0xc1812 mov cx, 00100h ; b9 00 01 ; 0xc1814 - mov bx, 05569h ; bb 69 55 ; 0xc1817 + mov bx, 0556ah ; bb 6a 55 ; 0xc1817 mov dx, 0c000h ; ba 00 c0 ; 0xc181a xor al, al ; 30 c0 ; 0xc181d call 02e1ah ; e8 f8 15 ; 0xc181f @@ -3116,7 +3116,7 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 push strict byte 00000h ; 6a 00 ; 0xc1829 push strict byte 00000h ; 6a 00 ; 0xc182b mov cx, 00100h ; b9 00 01 ; 0xc182d - mov bx, 05d69h ; bb 69 5d ; 0xc1830 + mov bx, 05d6ah ; bb 6a 5d ; 0xc1830 mov dx, 0c000h ; ba 00 c0 ; 0xc1833 xor al, al ; 30 c0 ; 0xc1836 call 02e1ah ; e8 df 15 ; 0xc1838 @@ -3124,7 +3124,7 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 jne short 01879h ; 75 38 ; 0xc183f mov cx, strict word 0000eh ; b9 0e 00 ; 0xc1841 vgabios.c:1166 xor bx, bx ; 31 db ; 0xc1844 - mov dx, 07b69h ; ba 69 7b ; 0xc1846 + mov dx, 07b6ah ; ba 6a 7b ; 0xc1846 mov ax, 0c000h ; b8 00 c0 ; 0xc1849 call 02da5h ; e8 56 15 ; 0xc184c jmp short 01879h ; eb 28 ; 0xc184f vgabios.c:1167 @@ -3135,13 +3135,13 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 push strict byte 00000h ; 6a 00 ; 0xc1859 push strict byte 00000h ; 6a 00 ; 0xc185b mov cx, 00100h ; b9 00 01 ; 0xc185d - mov bx, 06b69h ; bb 69 6b ; 0xc1860 + mov bx, 06b6ah ; bb 6a 6b ; 0xc1860 mov dx, 0c000h ; ba 00 c0 ; 0xc1863 xor al, al ; 30 c0 ; 0xc1866 call 02e1ah ; e8 af 15 ; 0xc1868 mov cx, strict word 00010h ; b9 10 00 ; 0xc186b vgabios.c:1170 xor bx, bx ; 31 db ; 0xc186e - mov dx, 07c96h ; ba 96 7c ; 0xc1870 + mov dx, 07c97h ; ba 97 7c ; 0xc1870 mov ax, 0c000h ; b8 00 c0 ; 0xc1873 call 02da5h ; e8 2c 15 ; 0xc1876 cmp word [bp-01ch], strict byte 00000h ; 83 7e e4 00 ; 0xc1879 vgabios.c:1172 @@ -3180,7 +3180,7 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 mov AL, strict byte 003h ; b0 03 ; 0xc18cf mov AH, strict byte 011h ; b4 11 ; 0xc18d1 int 06dh ; cd 6d ; 0xc18d3 - mov bx, 05969h ; bb 69 59 ; 0xc18d5 vgabios.c:1199 + mov bx, 0596ah ; bb 6a 59 ; 0xc18d5 vgabios.c:1199 mov cx, ds ; 8c d9 ; 0xc18d8 mov ax, strict word 0001fh ; b8 1f 00 ; 0xc18da call 009f0h ; e8 10 f1 ; 0xc18dd @@ -3192,14 +3192,14 @@ biosfn_set_video_mode: ; 0xc143f LB 0x4d5 je short 01900h ; 74 11 ; 0xc18ed cmp AL, strict byte 008h ; 3c 08 ; 0xc18ef jne short 0190ah ; 75 17 ; 0xc18f1 - mov bx, 05569h ; bb 69 55 ; 0xc18f3 vgabios.c:1203 + mov bx, 0556ah ; bb 6a 55 ; 0xc18f3 vgabios.c:1203 mov cx, ds ; 8c d9 ; 0xc18f6 mov ax, strict word 00043h ; b8 43 00 ; 0xc18f8 call 009f0h ; e8 f2 f0 ; 0xc18fb jmp short 0190ah ; eb 0a ; 0xc18fe vgabios.c:1204 - mov bx, 05d69h ; bb 69 5d ; 0xc1900 vgabios.c:1206 + mov bx, 05d6ah ; bb 6a 5d ; 0xc1900 vgabios.c:1206 jmp short 018f6h ; eb f1 ; 0xc1903 - mov bx, 06b69h ; bb 69 6b ; 0xc1905 vgabios.c:1209 + mov bx, 06b6ah ; bb 6a 6b ; 0xc1905 vgabios.c:1209 jmp short 018f6h ; eb ec ; 0xc1908 lea sp, [bp-00ah] ; 8d 66 f6 ; 0xc190a vgabios.c:1212 pop di ; 5f ; 0xc190d @@ -3676,7 +3676,7 @@ biosfn_scroll: ; 0xc1c55 LB 0x688 mov ax, word [bp-01eh] ; 8b 46 e2 ; 0xc1d0d mul word [bp-016h] ; f7 66 ea ; 0xc1d10 mov cx, ax ; 89 c1 ; 0xc1d13 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc1d15 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc1d15 jne short 01d65h ; 75 49 ; 0xc1d1a add ax, ax ; 01 c0 ; 0xc1d1c vgabios.c:1345 or AL, strict byte 0ffh ; 0c ff ; 0xc1d1e @@ -3701,7 +3701,7 @@ biosfn_scroll: ; 0xc1c55 LB 0x688 mov al, byte [bp-010h] ; 8a 46 f0 ; 0xc1d4e vgabios.c:1352 sal ax, 008h ; c1 e0 08 ; 0xc1d51 add ax, strict word 00020h ; 05 20 00 ; 0xc1d54 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc1d57 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc1d57 mov di, word [bp-020h] ; 8b 7e e0 ; 0xc1d5b jcxz 01d62h ; e3 02 ; 0xc1d5e rep stosw ; f3 ab ; 0xc1d60 @@ -3742,7 +3742,7 @@ biosfn_scroll: ; 0xc1c55 LB 0x688 mov bl, byte [bp-012h] ; 8a 5e ee ; 0xc1dba xor bh, bh ; 30 ff ; 0xc1dbd sal bx, 003h ; c1 e3 03 ; 0xc1dbf - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc1dc2 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc1dc2 mov ax, si ; 89 f0 ; 0xc1dc6 jcxz 01dcch ; e3 02 ; 0xc1dc8 rep stosw ; f3 ab ; 0xc1dca @@ -3761,7 +3761,7 @@ biosfn_scroll: ; 0xc1c55 LB 0x688 mov bl, byte [bp-012h] ; 8a 5e ee ; 0xc1deb xor bh, bh ; 30 ff ; 0xc1dee sal bx, 003h ; c1 e3 03 ; 0xc1df0 - mov bx, word [bx+047afh] ; 8b 9f af 47 ; 0xc1df3 + mov bx, word [bx+047b0h] ; 8b 9f b0 47 ; 0xc1df3 mov ax, word [bp-01ch] ; 8b 46 e4 ; 0xc1df7 mul word [bp-01eh] ; f7 66 e2 ; 0xc1dfa add ax, word [bp-018h] ; 03 46 e8 ; 0xc1dfd @@ -3811,7 +3811,7 @@ biosfn_scroll: ; 0xc1c55 LB 0x688 mov bl, byte [bp-012h] ; 8a 5e ee ; 0xc1e67 xor bh, bh ; 30 ff ; 0xc1e6a sal bx, 003h ; c1 e3 03 ; 0xc1e6c - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc1e6f + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc1e6f mov ax, si ; 89 f0 ; 0xc1e73 jcxz 01e79h ; e3 02 ; 0xc1e75 rep stosw ; f3 ab ; 0xc1e77 @@ -3833,7 +3833,7 @@ biosfn_scroll: ; 0xc1c55 LB 0x688 mov bl, byte [bp-012h] ; 8a 5e ee ; 0xc1e9e xor bh, bh ; 30 ff ; 0xc1ea1 sal bx, 003h ; c1 e3 03 ; 0xc1ea3 - mov bx, word [bx+047afh] ; 8b 9f af 47 ; 0xc1ea6 + mov bx, word [bx+047b0h] ; 8b 9f b0 47 ; 0xc1ea6 mov ax, word [bp-01ch] ; 8b 46 e4 ; 0xc1eaa mul word [bp-01eh] ; f7 66 e2 ; 0xc1ead add ax, cx ; 01 c8 ; 0xc1eb0 @@ -3855,13 +3855,13 @@ biosfn_scroll: ; 0xc1c55 LB 0x688 dec word [bp-01ch] ; ff 4e e4 ; 0xc1ed2 vgabios.c:1373 jmp near 01e21h ; e9 49 ff ; 0xc1ed5 mov si, word [bp-01ah] ; 8b 76 e6 ; 0xc1ed8 vgabios.c:1379 - mov al, byte [si+0482bh] ; 8a 84 2b 48 ; 0xc1edb + mov al, byte [si+0482ch] ; 8a 84 2c 48 ; 0xc1edb xor ah, ah ; 30 e4 ; 0xc1edf mov si, ax ; 89 c6 ; 0xc1ee1 sal si, 006h ; c1 e6 06 ; 0xc1ee3 - mov al, byte [si+04841h] ; 8a 84 41 48 ; 0xc1ee6 + mov al, byte [si+04842h] ; 8a 84 42 48 ; 0xc1ee6 mov byte [bp-00eh], al ; 88 46 f2 ; 0xc1eea - mov al, byte [bx+047adh] ; 8a 87 ad 47 ; 0xc1eed vgabios.c:1380 + mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc1eed vgabios.c:1380 cmp AL, strict byte 003h ; 3c 03 ; 0xc1ef1 jc short 01f01h ; 72 0c ; 0xc1ef3 jbe short 01f08h ; 76 11 ; 0xc1ef5 @@ -3907,7 +3907,7 @@ biosfn_scroll: ; 0xc1c55 LB 0x688 mov bl, byte [bp-012h] ; 8a 5e ee ; 0xc1f55 xor bh, bh ; 30 ff ; 0xc1f58 sal bx, 003h ; c1 e3 03 ; 0xc1f5a - mov bx, word [bx+047afh] ; 8b 9f af 47 ; 0xc1f5d + mov bx, word [bx+047b0h] ; 8b 9f b0 47 ; 0xc1f5d mov cx, ax ; 89 c1 ; 0xc1f61 mov ax, dx ; 89 d0 ; 0xc1f63 xor di, di ; 31 ff ; 0xc1f65 @@ -4015,7 +4015,7 @@ biosfn_scroll: ; 0xc1c55 LB 0x688 jc short 020afh ; 72 4e ; 0xc205f dec word [bp-01ch] ; ff 4e e4 ; 0xc2061 vgabios.c:1409 jmp short 01ff9h ; eb 93 ; 0xc2064 - mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc2066 vgabios.c:1414 + mov al, byte [bx+047afh] ; 8a 87 af 47 ; 0xc2066 vgabios.c:1414 mov byte [bp-014h], al ; 88 46 ec ; 0xc206a cmp byte [bp-006h], 000h ; 80 7e fa 00 ; 0xc206d vgabios.c:1415 jne short 020b2h ; 75 3f ; 0xc2071 @@ -4039,7 +4039,7 @@ biosfn_scroll: ; 0xc1c55 LB 0x688 mov cx, ax ; 89 c1 ; 0xc209e mov al, byte [bp-010h] ; 8a 46 f0 ; 0xc20a0 xor ah, ah ; 30 e4 ; 0xc20a3 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc20a5 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc20a5 xor di, di ; 31 ff ; 0xc20a9 jcxz 020afh ; e3 02 ; 0xc20ab rep stosb ; f3 aa ; 0xc20ad @@ -4165,7 +4165,7 @@ biosfn_scroll: ; 0xc1c55 LB 0x688 sal cx, 003h ; c1 e1 03 ; 0xc21d8 mov al, byte [bp-010h] ; 8a 46 f0 ; 0xc21db xor ah, ah ; 30 e4 ; 0xc21de - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc21e0 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc21e0 xor di, di ; 31 ff ; 0xc21e4 jcxz 021eah ; e3 02 ; 0xc21e6 rep stosb ; f3 aa ; 0xc21e8 @@ -4392,7 +4392,7 @@ write_gfx_char_cga: ; 0xc23ee LB 0x112 mov bh, al ; 88 c7 ; 0xc23f4 mov ch, dl ; 88 d5 ; 0xc23f6 mov al, bl ; 88 d8 ; 0xc23f8 - mov di, 05569h ; bf 69 55 ; 0xc23fa vgabios.c:1541 + mov di, 0556ah ; bf 6a 55 ; 0xc23fa vgabios.c:1541 xor ah, ah ; 30 e4 ; 0xc23fd vgabios.c:1542 mov dl, byte [bp+00ah] ; 8a 56 0a ; 0xc23ff xor dh, dh ; 30 f6 ; 0xc2402 @@ -4509,7 +4509,7 @@ write_gfx_char_lin: ; 0xc2500 LB 0x9b mov bh, al ; 88 c7 ; 0xc2506 mov ch, dl ; 88 d5 ; 0xc2508 mov al, cl ; 88 c8 ; 0xc250a - mov di, 05569h ; bf 69 55 ; 0xc250c vgabios.c:1605 + mov di, 0556ah ; bf 6a 55 ; 0xc250c vgabios.c:1605 xor ah, ah ; 30 e4 ; 0xc250f vgabios.c:1606 mov dl, byte [bp+008h] ; 8a 56 08 ; 0xc2511 xor dh, dh ; 30 f6 ; 0xc2514 @@ -4624,7 +4624,7 @@ biosfn_write_char_attr: ; 0xc259b LB 0x187 xor bh, bh ; 30 ff ; 0xc260c mov di, bx ; 89 df ; 0xc260e sal di, 003h ; c1 e7 03 ; 0xc2610 - cmp byte [di+047ach], 000h ; 80 bd ac 47 00 ; 0xc2613 + cmp byte [di+047adh], 000h ; 80 bd ad 47 00 ; 0xc2613 jne short 02663h ; 75 49 ; 0xc2618 mul dx ; f7 e2 ; 0xc261a vgabios.c:1648 add ax, ax ; 01 c0 ; 0xc261c @@ -4651,17 +4651,17 @@ biosfn_write_char_attr: ; 0xc259b LB 0x187 add bx, ax ; 01 c3 ; 0xc264c mov word [bp-020h], bx ; 89 5e e0 ; 0xc264e mov ax, word [bp-020h] ; 8b 46 e0 ; 0xc2651 vgabios.c:1651 - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc2654 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc2654 mov cx, si ; 89 f1 ; 0xc2658 mov di, dx ; 89 d7 ; 0xc265a jcxz 02660h ; e3 02 ; 0xc265c rep stosw ; f3 ab ; 0xc265e jmp near 0271bh ; e9 b8 00 ; 0xc2660 vgabios.c:1653 - mov bl, byte [bx+0482bh] ; 8a 9f 2b 48 ; 0xc2663 vgabios.c:1656 + mov bl, byte [bx+0482ch] ; 8a 9f 2c 48 ; 0xc2663 vgabios.c:1656 sal bx, 006h ; c1 e3 06 ; 0xc2667 - mov al, byte [bx+04841h] ; 8a 87 41 48 ; 0xc266a + mov al, byte [bx+04842h] ; 8a 87 42 48 ; 0xc266a mov byte [bp-012h], al ; 88 46 ee ; 0xc266e - mov al, byte [di+047aeh] ; 8a 85 ae 47 ; 0xc2671 vgabios.c:1657 + mov al, byte [di+047afh] ; 8a 85 af 47 ; 0xc2671 vgabios.c:1657 mov byte [bp-014h], al ; 88 46 ec ; 0xc2675 dec si ; 4e ; 0xc2678 vgabios.c:1658 cmp si, strict byte 0ffffh ; 83 fe ff ; 0xc2679 @@ -4669,7 +4669,7 @@ biosfn_write_char_attr: ; 0xc259b LB 0x187 mov bl, byte [bp-010h] ; 8a 5e f0 ; 0xc267e vgabios.c:1660 xor bh, bh ; 30 ff ; 0xc2681 sal bx, 003h ; c1 e3 03 ; 0xc2683 - mov bl, byte [bx+047adh] ; 8a 9f ad 47 ; 0xc2686 + mov bl, byte [bx+047aeh] ; 8a 9f ae 47 ; 0xc2686 cmp bl, 003h ; 80 fb 03 ; 0xc268a jc short 0269eh ; 72 0f ; 0xc268d jbe short 026a5h ; 76 14 ; 0xc268f @@ -4782,7 +4782,7 @@ biosfn_write_char_only: ; 0xc2722 LB 0x181 mov al, byte [bp-010h] ; 8a 46 f0 ; 0xc278f vgabios.c:1703 mov bx, ax ; 89 c3 ; 0xc2792 sal bx, 003h ; c1 e3 03 ; 0xc2794 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc2797 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc2797 jne short 027e0h ; 75 42 ; 0xc279c mov ax, cx ; 89 c8 ; 0xc279e vgabios.c:1706 mul dx ; f7 e2 ; 0xc27a0 @@ -4808,19 +4808,19 @@ biosfn_write_char_only: ; 0xc2722 LB 0x181 xor ah, ah ; 30 e4 ; 0xc27cb mov di, ax ; 89 c7 ; 0xc27cd sal di, 003h ; c1 e7 03 ; 0xc27cf - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc27d2 vgabios.c:50 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc27d2 vgabios.c:50 mov al, byte [bp-00ah] ; 8a 46 f6 ; 0xc27d6 vgabios.c:52 mov byte [es:bx], al ; 26 88 07 ; 0xc27d9 inc bx ; 43 ; 0xc27dc vgabios.c:1710 inc bx ; 43 ; 0xc27dd jmp short 027c2h ; eb e2 ; 0xc27de vgabios.c:1711 mov di, ax ; 89 c7 ; 0xc27e0 vgabios.c:1716 - mov al, byte [di+0482bh] ; 8a 85 2b 48 ; 0xc27e2 + mov al, byte [di+0482ch] ; 8a 85 2c 48 ; 0xc27e2 mov di, ax ; 89 c7 ; 0xc27e6 sal di, 006h ; c1 e7 06 ; 0xc27e8 - mov al, byte [di+04841h] ; 8a 85 41 48 ; 0xc27eb + mov al, byte [di+04842h] ; 8a 85 42 48 ; 0xc27eb mov byte [bp-014h], al ; 88 46 ec ; 0xc27ef - mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc27f2 vgabios.c:1717 + mov al, byte [bx+047afh] ; 8a 87 af 47 ; 0xc27f2 vgabios.c:1717 mov byte [bp-016h], al ; 88 46 ea ; 0xc27f6 dec si ; 4e ; 0xc27f9 vgabios.c:1718 cmp si, strict byte 0ffffh ; 83 fe ff ; 0xc27fa @@ -4828,7 +4828,7 @@ biosfn_write_char_only: ; 0xc2722 LB 0x181 mov bl, byte [bp-012h] ; 8a 5e ee ; 0xc27ff vgabios.c:1720 xor bh, bh ; 30 ff ; 0xc2802 sal bx, 003h ; c1 e3 03 ; 0xc2804 - mov bl, byte [bx+047adh] ; 8a 9f ad 47 ; 0xc2807 + mov bl, byte [bx+047aeh] ; 8a 9f ae 47 ; 0xc2807 cmp bl, 003h ; 80 fb 03 ; 0xc280b jc short 0281fh ; 72 0f ; 0xc280e jbe short 02826h ; 76 14 ; 0xc2810 @@ -4915,9 +4915,9 @@ biosfn_write_pixel: ; 0xc28a3 LB 0x173 mov bl, al ; 88 c3 ; 0xc28cb vgabios.c:1753 xor bh, bh ; 30 ff ; 0xc28cd sal bx, 003h ; c1 e3 03 ; 0xc28cf - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc28d2 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc28d2 je short 028f1h ; 74 18 ; 0xc28d7 - mov al, byte [bx+047adh] ; 8a 87 ad 47 ; 0xc28d9 vgabios.c:1755 + mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc28d9 vgabios.c:1755 cmp AL, strict byte 003h ; 3c 03 ; 0xc28dd jc short 028edh ; 72 0c ; 0xc28df jbe short 028f7h ; 76 14 ; 0xc28e1 @@ -4979,7 +4979,7 @@ biosfn_write_pixel: ; 0xc28a3 LB 0x173 mov ax, dx ; 89 d0 ; 0xc2968 vgabios.c:1775 shr ax, 1 ; d1 e8 ; 0xc296a imul ax, ax, strict byte 00050h ; 6b c0 50 ; 0xc296c - cmp byte [bx+047aeh], 002h ; 80 bf ae 47 02 ; 0xc296f + cmp byte [bx+047afh], 002h ; 80 bf af 47 02 ; 0xc296f jne short 0297eh ; 75 08 ; 0xc2974 mov bx, word [bp-008h] ; 8b 5e f8 ; 0xc2976 vgabios.c:1777 shr bx, 002h ; c1 eb 02 ; 0xc2979 @@ -4997,7 +4997,7 @@ biosfn_write_pixel: ; 0xc28a3 LB 0x173 xor ah, ah ; 30 e4 ; 0xc2998 mov si, ax ; 89 c6 ; 0xc299a sal si, 003h ; c1 e6 03 ; 0xc299c - cmp byte [si+047aeh], 002h ; 80 bc ae 47 02 ; 0xc299f + cmp byte [si+047afh], 002h ; 80 bc af 47 02 ; 0xc299f jne short 029bfh ; 75 19 ; 0xc29a4 mov al, byte [bp-008h] ; 8a 46 f8 ; 0xc29a6 vgabios.c:1787 and AL, strict byte 003h ; 24 03 ; 0xc29a9 @@ -5119,7 +5119,7 @@ biosfn_write_teletype: ; 0xc2a16 LB 0x258 xor ah, ah ; 30 e4 ; 0xc2ac2 mov bx, ax ; 89 c3 ; 0xc2ac4 sal bx, 003h ; c1 e3 03 ; 0xc2ac6 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc2ac9 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc2ac9 jne short 02b12h ; 75 42 ; 0xc2ace mov ax, word [bp-010h] ; 8b 46 f0 ; 0xc2ad0 vgabios.c:1865 mul word [bp-012h] ; f7 66 ee ; 0xc2ad3 @@ -5139,22 +5139,22 @@ biosfn_write_teletype: ; 0xc2a16 LB 0x258 add ax, dx ; 01 d0 ; 0xc2af3 add ax, ax ; 01 c0 ; 0xc2af5 add si, ax ; 01 c6 ; 0xc2af7 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc2af9 vgabios.c:50 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc2af9 vgabios.c:50 mov byte [es:si], ch ; 26 88 2c ; 0xc2afd vgabios.c:52 cmp cl, 003h ; 80 f9 03 ; 0xc2b00 vgabios.c:1870 jne short 02b41h ; 75 3c ; 0xc2b03 inc si ; 46 ; 0xc2b05 vgabios.c:1871 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc2b06 vgabios.c:50 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc2b06 vgabios.c:50 mov al, byte [bp-00ah] ; 8a 46 f6 ; 0xc2b0a mov byte [es:si], al ; 26 88 04 ; 0xc2b0d jmp short 02b41h ; eb 2f ; 0xc2b10 vgabios.c:1873 mov si, ax ; 89 c6 ; 0xc2b12 vgabios.c:1876 - mov al, byte [si+0482bh] ; 8a 84 2b 48 ; 0xc2b14 + mov al, byte [si+0482ch] ; 8a 84 2c 48 ; 0xc2b14 mov si, ax ; 89 c6 ; 0xc2b18 sal si, 006h ; c1 e6 06 ; 0xc2b1a - mov dl, byte [si+04841h] ; 8a 94 41 48 ; 0xc2b1d - mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc2b21 vgabios.c:1877 - mov bl, byte [bx+047adh] ; 8a 9f ad 47 ; 0xc2b25 vgabios.c:1878 + mov dl, byte [si+04842h] ; 8a 94 42 48 ; 0xc2b1d + mov al, byte [bx+047afh] ; 8a 87 af 47 ; 0xc2b21 vgabios.c:1877 + mov bl, byte [bx+047aeh] ; 8a 9f ae 47 ; 0xc2b25 vgabios.c:1878 cmp bl, 003h ; 80 fb 03 ; 0xc2b29 jc short 02b3ch ; 72 0e ; 0xc2b2c jbe short 02b43h ; 76 13 ; 0xc2b2e @@ -5231,7 +5231,7 @@ biosfn_write_teletype: ; 0xc2a16 LB 0x258 mov cl, byte [bp-010h] ; 8a 4e f0 ; 0xc2bdc db 0feh, 0c9h ; dec cl ; fe c9 ; 0xc2bdf - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc2be1 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc2be1 jne short 02c32h ; 75 4a ; 0xc2be6 mov ax, word [bp-010h] ; 8b 46 f0 ; 0xc2be8 vgabios.c:1910 mul word [bp-012h] ; f7 66 ee ; 0xc2beb @@ -5253,7 +5253,7 @@ biosfn_write_teletype: ; 0xc2a16 LB 0x258 add ax, ax ; 01 c0 ; 0xc2c0e add si, ax ; 01 c6 ; 0xc2c10 inc si ; 46 ; 0xc2c12 vgabios.c:1911 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc2c13 vgabios.c:45 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc2c13 vgabios.c:45 mov dl, byte [es:si] ; 26 8a 14 ; 0xc2c17 push strict byte 00001h ; 6a 01 ; 0xc2c1a vgabios.c:1912 mov al, byte [bp-008h] ; 8a 46 f8 ; 0xc2c1c @@ -5616,7 +5616,7 @@ set_gfx_font: ; 0xc2eaf LB 0x4d mov DL, strict byte 002h ; b2 02 ; 0xc2ecf vgabios.c:2033 mov bl, dl ; 88 d3 ; 0xc2ed1 vgabios.c:2034 xor bh, bh ; 30 ff ; 0xc2ed3 - mov al, byte [bx+07dfah] ; 8a 87 fa 7d ; 0xc2ed5 + mov al, byte [bx+07dfbh] ; 8a 87 fb 7d ; 0xc2ed5 mov byte [bp+004h], al ; 88 46 04 ; 0xc2ed9 mov bx, 00085h ; bb 85 00 ; 0xc2edc vgabios.c:62 mov ax, strict word 00040h ; b8 40 00 ; 0xc2edf @@ -5662,7 +5662,7 @@ biosfn_load_gfx_8_14_chars: ; 0xc2f19 LB 0x22 mov al, bl ; 88 d8 ; 0xc2f25 mov cx, ax ; 89 c1 ; 0xc2f27 mov bx, strict word 0000eh ; bb 0e 00 ; 0xc2f29 - mov ax, 05d69h ; b8 69 5d ; 0xc2f2c + mov ax, 05d6ah ; b8 6a 5d ; 0xc2f2c mov dx, ds ; 8c da ; 0xc2f2f call 02eafh ; e8 7b ff ; 0xc2f31 lea sp, [bp-004h] ; 8d 66 fc ; 0xc2f34 vgabios.c:2054 @@ -5683,7 +5683,7 @@ biosfn_load_gfx_8_8_dd_chars: ; 0xc2f3b LB 0x22 mov al, bl ; 88 d8 ; 0xc2f47 mov cx, ax ; 89 c1 ; 0xc2f49 mov bx, strict word 00008h ; bb 08 00 ; 0xc2f4b - mov ax, 05569h ; b8 69 55 ; 0xc2f4e + mov ax, 0556ah ; b8 6a 55 ; 0xc2f4e mov dx, ds ; 8c da ; 0xc2f51 call 02eafh ; e8 59 ff ; 0xc2f53 lea sp, [bp-004h] ; 8d 66 fc ; 0xc2f56 vgabios.c:2058 @@ -5704,7 +5704,7 @@ biosfn_load_gfx_8_16_chars: ; 0xc2f5d LB 0x22 mov al, bl ; 88 d8 ; 0xc2f69 mov cx, ax ; 89 c1 ; 0xc2f6b mov bx, strict word 00010h ; bb 10 00 ; 0xc2f6d - mov ax, 06b69h ; b8 69 6b ; 0xc2f70 + mov ax, 06b6ah ; b8 6a 6b ; 0xc2f70 mov dx, ds ; 8c da ; 0xc2f73 call 02eafh ; e8 37 ff ; 0xc2f75 lea sp, [bp-004h] ; 8d 66 fc ; 0xc2f78 vgabios.c:2062 @@ -5843,7 +5843,7 @@ biosfn_read_state_info: ; 0xc305d LB 0x1ef mov word [bp-00ah], ax ; 89 46 f6 ; 0xc307a vgabios.c:58 mov ax, ds ; 8c d8 ; 0xc307d vgabios.c:2150 mov es, dx ; 8e c2 ; 0xc307f vgabios.c:72 - mov word [es:bx], 054ffh ; 26 c7 07 ff 54 ; 0xc3081 + mov word [es:bx], 05500h ; 26 c7 07 00 55 ; 0xc3081 mov [es:bx+002h], ds ; 26 8c 5f 02 ; 0xc3086 lea di, [bx+004h] ; 8d 7f 04 ; 0xc308a vgabios.c:2155 mov cx, strict word 0001eh ; b9 1e 00 ; 0xc308d @@ -6724,7 +6724,7 @@ find_vga_entry: ; 0xc3819 LB 0x28 mov bl, al ; 88 c3 ; 0xc382c xor bh, bh ; 30 ff ; 0xc382e sal bx, 003h ; c1 e3 03 ; 0xc3830 - cmp dl, byte [bx+047abh] ; 3a 97 ab 47 ; 0xc3833 + cmp dl, byte [bx+047ach] ; 3a 97 ac 47 ; 0xc3833 jne short 03826h ; 75 ed ; 0xc3837 mov ah, al ; 88 c4 ; 0xc3839 mov al, ah ; 88 e0 ; 0xc383b vgabios.c:2438 @@ -6975,7 +6975,7 @@ int10_func: ; 0xc38d9 LB 0x49f push strict byte 00000h ; 6a 00 ; 0xc3afc mov al, byte [bp+012h] ; 8a 46 12 ; 0xc3afe mov cx, 00100h ; b9 00 01 ; 0xc3b01 - mov bx, 05d69h ; bb 69 5d ; 0xc3b04 + mov bx, 05d6ah ; bb 6a 5d ; 0xc3b04 mov dx, 0c000h ; ba 00 c0 ; 0xc3b07 call 02e1ah ; e8 0d f3 ; 0xc3b0a jmp short 03b2ch ; eb 1d ; 0xc3b0d @@ -6986,7 +6986,7 @@ int10_func: ; 0xc38d9 LB 0x49f push strict byte 00000h ; 6a 00 ; 0xc3b17 mov al, byte [bp+012h] ; 8a 46 12 ; 0xc3b19 mov cx, 00100h ; b9 00 01 ; 0xc3b1c - mov bx, 05569h ; bb 69 55 ; 0xc3b1f + mov bx, 0556ah ; bb 6a 55 ; 0xc3b1f jmp short 03b07h ; eb e3 ; 0xc3b22 mov al, byte [bp+00ch] ; 8a 46 0c ; 0xc3b24 vgabios.c:2629 xor ah, ah ; 30 e4 ; 0xc3b27 @@ -6999,7 +6999,7 @@ int10_func: ; 0xc38d9 LB 0x49f push strict byte 00000h ; 6a 00 ; 0xc3b37 mov al, byte [bp+012h] ; 8a 46 12 ; 0xc3b39 mov cx, 00100h ; b9 00 01 ; 0xc3b3c - mov bx, 06b69h ; bb 69 6b ; 0xc3b3f + mov bx, 06b6ah ; bb 6a 6b ; 0xc3b3f jmp short 03b07h ; eb c3 ; 0xc3b42 mov dx, word [bp+008h] ; 8b 56 08 ; 0xc3b44 vgabios.c:2636 mov ax, word [bp+016h] ; 8b 46 16 ; 0xc3b47 @@ -7523,7 +7523,7 @@ vbe_biosfn_return_controller_information: ; 0xc3f42 LB 0x12b mov word [es:bx], 04556h ; 26 c7 07 56 45 ; 0xc3fad mov word [es:bx+002h], 04153h ; 26 c7 47 02 53 41 ; 0xc3fb2 vbe.c:334 mov word [es:bx+004h], 00200h ; 26 c7 47 04 00 02 ; 0xc3fb8 vbe.c:338 - mov word [es:bx+006h], 07dfeh ; 26 c7 47 06 fe 7d ; 0xc3fbe vbe.c:341 + mov word [es:bx+006h], 07e00h ; 26 c7 47 06 00 7e ; 0xc3fbe vbe.c:341 mov [es:bx+008h], ds ; 26 8c 5f 08 ; 0xc3fc4 mov word [es:bx+00ah], strict word 00001h ; 26 c7 47 0a 01 00 ; 0xc3fc8 vbe.c:344 mov word [es:bx+00ch], strict word 00000h ; 26 c7 47 0c 00 00 ; 0xc3fce vbe.c:346 @@ -7539,11 +7539,11 @@ vbe_biosfn_return_controller_information: ; 0xc3f42 LB 0x12b cmp word [bp-00eh], strict byte 00000h ; 83 7e f2 00 ; 0xc3ff2 vbe.c:356 je short 0401ch ; 74 24 ; 0xc3ff6 mov word [es:bx+014h], strict word 00003h ; 26 c7 47 14 03 00 ; 0xc3ff8 vbe.c:359 - mov word [es:bx+016h], 07e13h ; 26 c7 47 16 13 7e ; 0xc3ffe vbe.c:360 + mov word [es:bx+016h], 07e15h ; 26 c7 47 16 15 7e ; 0xc3ffe vbe.c:360 mov [es:bx+018h], ds ; 26 8c 5f 18 ; 0xc4004 - mov word [es:bx+01ah], 07e30h ; 26 c7 47 1a 30 7e ; 0xc4008 vbe.c:361 + mov word [es:bx+01ah], 07e32h ; 26 c7 47 1a 32 7e ; 0xc4008 vbe.c:361 mov [es:bx+01ch], ds ; 26 8c 5f 1c ; 0xc400e - mov word [es:bx+01eh], 07e4eh ; 26 c7 47 1e 4e 7e ; 0xc4012 vbe.c:362 + mov word [es:bx+01eh], 07e50h ; 26 c7 47 1e 50 7e ; 0xc4012 vbe.c:362 mov [es:bx+020h], ds ; 26 8c 5f 20 ; 0xc4018 mov dx, cx ; 89 ca ; 0xc401c vbe.c:369 add dx, strict byte 0001bh ; 83 c2 1b ; 0xc401e @@ -8278,12 +8278,12 @@ vesa_pm_end: ; 0xc4754 LB 0x1 ; Padding 0x2b bytes at 0xc4755 times 43 db 0 -section _DATA progbits vstart=0x4780 align=1 ; size=0x3742 class=DATA group=DGROUP - ; disGetNextSymbol 0xc4780 LB 0x3742 -> off=0x0 cb=000000000000002b uValue=00000000000c0000 '_msg_vga_init' -_msg_vga_init: ; 0xc4780 LB 0x2b - db 'Oracle VirtualBox Version 7.1.8 VGA BIOS', 00dh, 00ah, 000h - ; disGetNextSymbol 0xc47ab LB 0x3717 -> off=0x0 cb=0000000000000080 uValue=00000000000c002b 'vga_modes' -vga_modes: ; 0xc47ab LB 0x80 +section _DATA progbits vstart=0x4780 align=1 ; size=0x3745 class=DATA group=DGROUP + ; disGetNextSymbol 0xc4780 LB 0x3745 -> off=0x0 cb=000000000000002c uValue=00000000000c0000 '_msg_vga_init' +_msg_vga_init: ; 0xc4780 LB 0x2c + db 'Oracle VirtualBox Version 7.1.10 VGA BIOS', 00dh, 00ah, 000h + ; disGetNextSymbol 0xc47ac LB 0x3719 -> off=0x0 cb=0000000000000080 uValue=00000000000c002c 'vga_modes' +vga_modes: ; 0xc47ac LB 0x80 db 000h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 001h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h db 002h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 003h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h db 004h, 001h, 002h, 002h, 000h, 0b8h, 0ffh, 001h, 005h, 001h, 002h, 002h, 000h, 0b8h, 0ffh, 001h @@ -8292,14 +8292,14 @@ vga_modes: ; 0xc47ab LB 0x80 db 00fh, 001h, 003h, 001h, 000h, 0a0h, 0ffh, 000h, 010h, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h db 011h, 001h, 003h, 001h, 000h, 0a0h, 0ffh, 002h, 012h, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h db 013h, 001h, 005h, 008h, 000h, 0a0h, 0ffh, 003h, 06ah, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h - ; disGetNextSymbol 0xc482b LB 0x3697 -> off=0x0 cb=0000000000000010 uValue=00000000000c00ab 'line_to_vpti' -line_to_vpti: ; 0xc482b LB 0x10 + ; disGetNextSymbol 0xc482c LB 0x3699 -> off=0x0 cb=0000000000000010 uValue=00000000000c00ac 'line_to_vpti' +line_to_vpti: ; 0xc482c LB 0x10 db 017h, 017h, 018h, 018h, 004h, 005h, 006h, 007h, 00dh, 00eh, 011h, 012h, 01ah, 01bh, 01ch, 01dh - ; disGetNextSymbol 0xc483b LB 0x3687 -> off=0x0 cb=0000000000000004 uValue=00000000000c00bb 'dac_regs' -dac_regs: ; 0xc483b LB 0x4 + ; disGetNextSymbol 0xc483c LB 0x3689 -> off=0x0 cb=0000000000000004 uValue=00000000000c00bc 'dac_regs' +dac_regs: ; 0xc483c LB 0x4 dd 0ff3f3f3fh - ; disGetNextSymbol 0xc483f LB 0x3683 -> off=0x0 cb=0000000000000780 uValue=00000000000c00bf 'video_param_table' -video_param_table: ; 0xc483f LB 0x780 + ; disGetNextSymbol 0xc4840 LB 0x3685 -> off=0x0 cb=0000000000000780 uValue=00000000000c00c0 'video_param_table' +video_param_table: ; 0xc4840 LB 0x780 db 028h, 018h, 008h, 000h, 008h, 009h, 003h, 000h, 002h, 063h, 02dh, 027h, 028h, 090h, 02bh, 0a0h db 0bfh, 01fh, 000h, 0c7h, 006h, 007h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 014h, 01fh, 096h db 0b9h, 0a3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h, 010h, 011h, 012h, 013h, 014h @@ -8420,8 +8420,8 @@ video_param_table: ; 0xc483f LB 0x780 db 072h, 0f0h, 000h, 060h, 000h, 000h, 000h, 000h, 000h, 000h, 059h, 08dh, 057h, 032h, 000h, 057h db 073h, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch db 03dh, 03eh, 03fh, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh - ; disGetNextSymbol 0xc4fbf LB 0x2f03 -> off=0x0 cb=00000000000000c0 uValue=00000000000c083f 'palette0' -palette0: ; 0xc4fbf LB 0xc0 + ; disGetNextSymbol 0xc4fc0 LB 0x2f05 -> off=0x0 cb=00000000000000c0 uValue=00000000000c0840 'palette0' +palette0: ; 0xc4fc0 LB 0xc0 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah @@ -8434,8 +8434,8 @@ palette0: ; 0xc4fbf LB 0xc0 db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh db 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh - ; disGetNextSymbol 0xc507f LB 0x2e43 -> off=0x0 cb=00000000000000c0 uValue=00000000000c08ff 'palette1' -palette1: ; 0xc507f LB 0xc0 + ; disGetNextSymbol 0xc5080 LB 0x2e45 -> off=0x0 cb=00000000000000c0 uValue=00000000000c0900 'palette1' +palette1: ; 0xc5080 LB 0xc0 db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah db 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah, 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah @@ -8448,8 +8448,8 @@ palette1: ; 0xc507f LB 0xc0 db 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh, 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh db 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh - ; disGetNextSymbol 0xc513f LB 0x2d83 -> off=0x0 cb=00000000000000c0 uValue=00000000000c09bf 'palette2' -palette2: ; 0xc513f LB 0xc0 + ; disGetNextSymbol 0xc5140 LB 0x2d85 -> off=0x0 cb=00000000000000c0 uValue=00000000000c09c0 'palette2' +palette2: ; 0xc5140 LB 0xc0 db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah db 000h, 02ah, 02ah, 02ah, 000h, 02ah, 02ah, 02ah, 000h, 000h, 015h, 000h, 000h, 03fh, 000h, 02ah db 015h, 000h, 02ah, 03fh, 02ah, 000h, 015h, 02ah, 000h, 03fh, 02ah, 02ah, 015h, 02ah, 02ah, 03fh @@ -8462,8 +8462,8 @@ palette2: ; 0xc513f LB 0xc0 db 015h, 015h, 000h, 015h, 015h, 02ah, 015h, 03fh, 000h, 015h, 03fh, 02ah, 03fh, 015h, 000h, 03fh db 015h, 02ah, 03fh, 03fh, 000h, 03fh, 03fh, 02ah, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh - ; disGetNextSymbol 0xc51ff LB 0x2cc3 -> off=0x0 cb=0000000000000300 uValue=00000000000c0a7f 'palette3' -palette3: ; 0xc51ff LB 0x300 + ; disGetNextSymbol 0xc5200 LB 0x2cc5 -> off=0x0 cb=0000000000000300 uValue=00000000000c0a80 'palette3' +palette3: ; 0xc5200 LB 0x300 db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh @@ -8512,24 +8512,24 @@ palette3: ; 0xc51ff LB 0x300 db 00bh, 010h, 00bh, 00bh, 010h, 00ch, 00bh, 010h, 00dh, 00bh, 010h, 00fh, 00bh, 010h, 010h, 00bh db 00fh, 010h, 00bh, 00dh, 010h, 00bh, 00ch, 010h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc54ff LB 0x29c3 -> off=0x0 cb=0000000000000010 uValue=00000000000c0d7f 'static_functionality' -static_functionality: ; 0xc54ff LB 0x10 + ; disGetNextSymbol 0xc5500 LB 0x29c5 -> off=0x0 cb=0000000000000010 uValue=00000000000c0d80 'static_functionality' +static_functionality: ; 0xc5500 LB 0x10 db 0ffh, 0e0h, 00fh, 000h, 000h, 000h, 000h, 007h, 002h, 008h, 0e7h, 00ch, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc550f LB 0x29b3 -> off=0x0 cb=0000000000000024 uValue=00000000000c0d8f '_dcc_table' -_dcc_table: ; 0xc550f LB 0x24 + ; disGetNextSymbol 0xc5510 LB 0x29b5 -> off=0x0 cb=0000000000000024 uValue=00000000000c0d90 '_dcc_table' +_dcc_table: ; 0xc5510 LB 0x24 db 010h, 001h, 007h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc5533 LB 0x298f -> off=0x0 cb=000000000000001a uValue=00000000000c0db3 '_secondary_save_area' -_secondary_save_area: ; 0xc5533 LB 0x1a - db 01ah, 000h, 00fh, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h + ; disGetNextSymbol 0xc5534 LB 0x2991 -> off=0x0 cb=000000000000001a uValue=00000000000c0db4 '_secondary_save_area' +_secondary_save_area: ; 0xc5534 LB 0x1a + db 01ah, 000h, 010h, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc554d LB 0x2975 -> off=0x0 cb=000000000000001c uValue=00000000000c0dcd '_video_save_pointer_table' -_video_save_pointer_table: ; 0xc554d LB 0x1c - db 03fh, 048h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - db 033h, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc5569 LB 0x2959 -> off=0x0 cb=0000000000000800 uValue=00000000000c0de9 'vgafont8' -vgafont8: ; 0xc5569 LB 0x800 + ; disGetNextSymbol 0xc554e LB 0x2977 -> off=0x0 cb=000000000000001c uValue=00000000000c0dce '_video_save_pointer_table' +_video_save_pointer_table: ; 0xc554e LB 0x1c + db 040h, 048h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h + db 034h, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h + ; disGetNextSymbol 0xc556a LB 0x295b -> off=0x0 cb=0000000000000800 uValue=00000000000c0dea 'vgafont8' +vgafont8: ; 0xc556a LB 0x800 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07eh, 081h, 0a5h, 081h, 0bdh, 099h, 081h, 07eh db 07eh, 0ffh, 0dbh, 0ffh, 0c3h, 0e7h, 0ffh, 07eh, 06ch, 0feh, 0feh, 0feh, 07ch, 038h, 010h, 000h db 010h, 038h, 07ch, 0feh, 07ch, 038h, 010h, 000h, 038h, 07ch, 038h, 0feh, 0feh, 07ch, 038h, 07ch @@ -8658,8 +8658,8 @@ vgafont8: ; 0xc5569 LB 0x800 db 000h, 000h, 000h, 000h, 018h, 000h, 000h, 000h, 00fh, 00ch, 00ch, 00ch, 0ech, 06ch, 03ch, 01ch db 078h, 06ch, 06ch, 06ch, 06ch, 000h, 000h, 000h, 070h, 018h, 030h, 060h, 078h, 000h, 000h, 000h db 000h, 000h, 03ch, 03ch, 03ch, 03ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc5d69 LB 0x2159 -> off=0x0 cb=0000000000000e00 uValue=00000000000c15e9 'vgafont14' -vgafont14: ; 0xc5d69 LB 0xe00 + ; disGetNextSymbol 0xc5d6a LB 0x215b -> off=0x0 cb=0000000000000e00 uValue=00000000000c15ea 'vgafont14' +vgafont14: ; 0xc5d6a LB 0xe00 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 07eh, 081h, 0a5h, 081h, 081h, 0bdh, 099h, 081h, 07eh, 000h, 000h, 000h, 000h, 000h, 07eh, 0ffh db 0dbh, 0ffh, 0ffh, 0c3h, 0e7h, 0ffh, 07eh, 000h, 000h, 000h, 000h, 000h, 000h, 06ch, 0feh, 0feh @@ -8884,8 +8884,8 @@ vgafont14: ; 0xc5d69 LB 0xe00 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 070h, 0d8h, 030h, 060h, 0c8h, 0f8h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc6b69 LB 0x1359 -> off=0x0 cb=0000000000001000 uValue=00000000000c23e9 'vgafont16' -vgafont16: ; 0xc6b69 LB 0x1000 + ; disGetNextSymbol 0xc6b6a LB 0x135b -> off=0x0 cb=0000000000001000 uValue=00000000000c23ea 'vgafont16' +vgafont16: ; 0xc6b6a LB 0x1000 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 07eh, 081h, 0a5h, 081h, 081h, 0bdh, 099h, 081h, 081h, 07eh, 000h, 000h, 000h, 000h db 000h, 000h, 07eh, 0ffh, 0dbh, 0ffh, 0ffh, 0c3h, 0e7h, 0ffh, 0ffh, 07eh, 000h, 000h, 000h, 000h @@ -9142,8 +9142,8 @@ vgafont16: ; 0xc6b69 LB 0x1000 db 000h, 070h, 0d8h, 030h, 060h, 0c8h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc7b69 LB 0x359 -> off=0x0 cb=000000000000012d uValue=00000000000c33e9 'vgafont14alt' -vgafont14alt: ; 0xc7b69 LB 0x12d + ; disGetNextSymbol 0xc7b6a LB 0x35b -> off=0x0 cb=000000000000012d uValue=00000000000c33ea 'vgafont14alt' +vgafont14alt: ; 0xc7b6a LB 0x12d db 01dh, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h, 022h db 000h, 063h, 063h, 063h, 022h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02bh, 000h db 000h, 000h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 02dh, 000h, 000h @@ -9163,8 +9163,8 @@ vgafont14alt: ; 0xc7b69 LB 0x12d db 000h, 0fch, 066h, 066h, 07ch, 062h, 066h, 06fh, 066h, 066h, 0f3h, 000h, 000h, 000h, 0f1h, 000h db 000h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 000h, 0ffh, 000h, 000h, 000h, 0f6h, 000h, 000h db 018h, 018h, 000h, 000h, 0ffh, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc7c96 LB 0x22c -> off=0x0 cb=0000000000000144 uValue=00000000000c3516 'vgafont16alt' -vgafont16alt: ; 0xc7c96 LB 0x144 + ; disGetNextSymbol 0xc7c97 LB 0x22e -> off=0x0 cb=0000000000000144 uValue=00000000000c3517 'vgafont16alt' +vgafont16alt: ; 0xc7c97 LB 0x144 db 01dh, 000h, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h db 000h, 030h, 000h, 000h, 03ch, 066h, 0c3h, 0c3h, 0dbh, 0dbh, 0c3h, 0c3h, 066h, 03ch, 000h, 000h db 000h, 000h, 04dh, 000h, 000h, 0c3h, 0e7h, 0ffh, 0ffh, 0dbh, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 000h @@ -9186,53 +9186,56 @@ vgafont16alt: ; 0xc7c96 LB 0x144 db 000h, 0abh, 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 060h, 0ceh, 09bh, 006h, 00ch, 01fh db 000h, 000h, 0ach, 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 066h, 0ceh, 096h, 03eh, 006h db 006h, 000h, 000h, 000h - ; disGetNextSymbol 0xc7dda LB 0xe8 -> off=0x0 cb=0000000000000008 uValue=00000000000c365a '_cga_msr' -_cga_msr: ; 0xc7dda LB 0x8 + ; disGetNextSymbol 0xc7ddb LB 0xea -> off=0x0 cb=0000000000000008 uValue=00000000000c365b '_cga_msr' +_cga_msr: ; 0xc7ddb LB 0x8 db 02ch, 028h, 02dh, 029h, 02ah, 02eh, 01eh, 029h - ; disGetNextSymbol 0xc7de2 LB 0xe0 -> off=0x0 cb=0000000000000008 uValue=00000000000c3662 'line_to_vpti_200' -line_to_vpti_200: ; 0xc7de2 LB 0x8 + ; disGetNextSymbol 0xc7de3 LB 0xe2 -> off=0x0 cb=0000000000000008 uValue=00000000000c3663 'line_to_vpti_200' +line_to_vpti_200: ; 0xc7de3 LB 0x8 db 000h, 001h, 002h, 003h, 0ffh, 0ffh, 0ffh, 007h - ; disGetNextSymbol 0xc7dea LB 0xd8 -> off=0x0 cb=0000000000000008 uValue=00000000000c366a 'line_to_vpti_350' -line_to_vpti_350: ; 0xc7dea LB 0x8 + ; disGetNextSymbol 0xc7deb LB 0xda -> off=0x0 cb=0000000000000008 uValue=00000000000c366b 'line_to_vpti_350' +line_to_vpti_350: ; 0xc7deb LB 0x8 db 013h, 014h, 015h, 016h, 0ffh, 0ffh, 0ffh, 007h - ; disGetNextSymbol 0xc7df2 LB 0xd0 -> off=0x0 cb=0000000000000008 uValue=00000000000c3672 'line_to_vpti_400' -line_to_vpti_400: ; 0xc7df2 LB 0x8 + ; disGetNextSymbol 0xc7df3 LB 0xd2 -> off=0x0 cb=0000000000000008 uValue=00000000000c3673 'line_to_vpti_400' +line_to_vpti_400: ; 0xc7df3 LB 0x8 db 017h, 017h, 018h, 018h, 0ffh, 0ffh, 0ffh, 019h - ; disGetNextSymbol 0xc7dfa LB 0xc8 -> off=0x0 cb=0000000000000004 uValue=00000000000c367a 'row_tbl' -row_tbl: ; 0xc7dfa LB 0x4 - dd 02b190e00h - ; disGetNextSymbol 0xc7dfe LB 0xc4 -> off=0x0 cb=0000000000000015 uValue=00000000000c367e '_vbebios_copyright' -_vbebios_copyright: ; 0xc7dfe LB 0x15 + ; disGetNextSymbol 0xc7dfb LB 0xca -> off=0x0 cb=0000000000000005 uValue=00000000000c367b 'row_tbl' +row_tbl: ; 0xc7dfb LB 0x5 + db 000h, 00eh, 019h, 02bh, 000h + ; disGetNextSymbol 0xc7e00 LB 0xc5 -> off=0x0 cb=0000000000000015 uValue=00000000000c3680 '_vbebios_copyright' +_vbebios_copyright: ; 0xc7e00 LB 0x15 db 'VirtualBox VESA BIOS', 000h - ; disGetNextSymbol 0xc7e13 LB 0xaf -> off=0x0 cb=000000000000001d uValue=00000000000c3693 '_vbebios_vendor_name' -_vbebios_vendor_name: ; 0xc7e13 LB 0x1d + ; disGetNextSymbol 0xc7e15 LB 0xb0 -> off=0x0 cb=000000000000001d uValue=00000000000c3695 '_vbebios_vendor_name' +_vbebios_vendor_name: ; 0xc7e15 LB 0x1d db 'Oracle and/or its affiliates', 000h - ; disGetNextSymbol 0xc7e30 LB 0x92 -> off=0x0 cb=000000000000001e uValue=00000000000c36b0 '_vbebios_product_name' -_vbebios_product_name: ; 0xc7e30 LB 0x1e + ; disGetNextSymbol 0xc7e32 LB 0x93 -> off=0x0 cb=000000000000001e uValue=00000000000c36b2 '_vbebios_product_name' +_vbebios_product_name: ; 0xc7e32 LB 0x1e db 'Oracle VirtualBox VBE Adapter', 000h - ; disGetNextSymbol 0xc7e4e LB 0x74 -> off=0x0 cb=0000000000000020 uValue=00000000000c36ce '_vbebios_product_revision' -_vbebios_product_revision: ; 0xc7e4e LB 0x20 - db 'Oracle VirtualBox Version 7.1.8', 000h - ; disGetNextSymbol 0xc7e6e LB 0x54 -> off=0x0 cb=000000000000002b uValue=00000000000c36ee '_vbebios_info_string' -_vbebios_info_string: ; 0xc7e6e LB 0x2b + ; disGetNextSymbol 0xc7e50 LB 0x75 -> off=0x0 cb=0000000000000021 uValue=00000000000c36d0 '_vbebios_product_revision' +_vbebios_product_revision: ; 0xc7e50 LB 0x21 + db 'Oracle VirtualBox Version 7.1.10', 000h + ; disGetNextSymbol 0xc7e71 LB 0x54 -> off=0x0 cb=000000000000002b uValue=00000000000c36f1 '_vbebios_info_string' +_vbebios_info_string: ; 0xc7e71 LB 0x2b db 'VirtualBox VBE Display Adapter enabled', 00dh, 00ah, 00dh, 00ah, 000h - ; disGetNextSymbol 0xc7e99 LB 0x29 -> off=0x0 cb=0000000000000029 uValue=00000000000c3719 '_no_vbebios_info_string' -_no_vbebios_info_string: ; 0xc7e99 LB 0x29 + ; disGetNextSymbol 0xc7e9c LB 0x29 -> off=0x0 cb=0000000000000029 uValue=00000000000c371c '_no_vbebios_info_string' +_no_vbebios_info_string: ; 0xc7e9c LB 0x29 db 'No VirtualBox VBE support available!', 00dh, 00ah, 00dh, 00ah, 000h -section CONST progbits vstart=0x7ec2 align=1 ; size=0x0 class=DATA group=DGROUP + ; Padding 0x1 bytes at 0xc7ec5 + db 001h -section CONST2 progbits vstart=0x7ec2 align=1 ; size=0x0 class=DATA group=DGROUP +section CONST progbits vstart=0x7ec6 align=1 ; size=0x0 class=DATA group=DGROUP - ; Padding 0x13e bytes at 0xc7ec2 - db 001h, 000h, 000h, 000h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 02fh, 068h, 06fh, 06dh - db 065h, 02fh, 067h, 061h, 06ch, 069h, 074h, 073h, 079h, 06eh, 02fh, 063h, 06fh, 06dh, 070h, 069h - db 06ch, 065h, 02dh, 063h, 061h, 063h, 068h, 065h, 02fh, 076h, 062h, 06fh, 078h, 02fh, 062h, 072h - db 061h, 06eh, 063h, 068h, 065h, 073h, 02fh, 056h, 042h, 06fh, 078h, 02dh, 037h, 02eh, 031h, 02fh - db 06fh, 075h, 074h, 02fh, 06ch, 069h, 06eh, 075h, 078h, 02eh, 061h, 06dh, 064h, 036h, 034h, 02fh - db 072h, 065h, 06ch, 065h, 061h, 073h, 065h, 02fh, 06fh, 062h, 06ah, 02fh, 056h, 042h, 06fh, 078h - db 056h, 067h, 061h, 042h, 069h, 06fh, 073h, 032h, 038h, 036h, 02fh, 056h, 042h, 06fh, 078h, 056h - db 067h, 061h, 042h, 069h, 06fh, 073h, 032h, 038h, 036h, 02eh, 073h, 079h, 06dh, 000h, 000h, 000h +section CONST2 progbits vstart=0x7ec6 align=1 ; size=0x0 class=DATA group=DGROUP + + ; Padding 0x13a bytes at 0xc7ec6 + db 000h, 000h, 000h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 02fh, 068h, 06fh, 06dh, 065h + db 02fh, 067h, 061h, 06ch, 069h, 074h, 073h, 079h, 06eh, 02fh, 063h, 06fh, 06dh, 070h, 069h, 06ch + db 065h, 02dh, 063h, 061h, 063h, 068h, 065h, 02fh, 076h, 062h, 06fh, 078h, 02fh, 062h, 072h, 061h + db 06eh, 063h, 068h, 065h, 073h, 02fh, 056h, 042h, 06fh, 078h, 02dh, 037h, 02eh, 031h, 02fh, 06fh + db 075h, 074h, 02fh, 06ch, 069h, 06eh, 075h, 078h, 02eh, 061h, 06dh, 064h, 036h, 034h, 02fh, 072h + db 065h, 06ch, 065h, 061h, 073h, 065h, 02fh, 06fh, 062h, 06ah, 02fh, 056h, 042h, 06fh, 078h, 056h + db 067h, 061h, 042h, 069h, 06fh, 073h, 032h, 038h, 036h, 02fh, 056h, 042h, 06fh, 078h, 056h, 067h + db 061h, 042h, 069h, 06fh, 073h, 032h, 038h, 036h, 02eh, 073h, 079h, 06dh, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h @@ -9244,4 +9247,4 @@ section CONST2 progbits vstart=0x7ec2 align=1 ; size=0x0 class=DATA group=DGROUP db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0a4h + db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0e2h diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative286.md5sum b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative286.md5sum index 764f87c0..3b95ce4f 100644 --- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative286.md5sum +++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative286.md5sum @@ -1 +1 @@ -0bdccfc777369284b7a55153fa821a6e *VBoxVgaBios286.rom +29abc1e3e7d19d109b66388fcf76f7fb *VBoxVgaBios286.rom diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative386.asm b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative386.asm index aefe4e19..0b1d1882 100644 --- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative386.asm +++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative386.asm @@ -1503,7 +1503,7 @@ init_bios_area: ; 0xc0a26 LB 0x3e mov word [es:bx+00087h], 0f960h ; 26 c7 87 87 00 60 f9 ; 0xc0a43 vgabios.c:234 mov byte [es:bx+00089h], 051h ; 26 c6 87 89 00 51 ; 0xc0a4a vgabios.c:238 mov byte [es:bx+065h], 009h ; 26 c6 47 65 09 ; 0xc0a50 vgabios.c:240 - mov word [es:bx+000a8h], 0554dh ; 26 c7 87 a8 00 4d 55 ; 0xc0a55 vgabios.c:242 + mov word [es:bx+000a8h], 0554eh ; 26 c7 87 a8 00 4e 55 ; 0xc0a55 vgabios.c:242 mov [es:bx+000aah], ds ; 26 8c 9f aa 00 ; 0xc0a5c pop bp ; 5d ; 0xc0a61 vgabios.c:243 pop bx ; 5b ; 0xc0a62 @@ -1969,7 +1969,7 @@ vga_read_char_attr: ; 0xc0db0 LB 0x127 mov word [bp-014h], di ; 89 7e ec ; 0xc0e0f vgabios.c:58 movzx bx, byte [bp-012h] ; 0f b6 5e ee ; 0xc0e12 vgabios.c:557 sal bx, 003h ; c1 e3 03 ; 0xc0e16 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc0e19 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc0e19 jne short 00e56h ; 75 36 ; 0xc0e1e imul dx, di ; 0f af d7 ; 0xc0e20 vgabios.c:559 add dx, dx ; 01 d2 ; 0xc0e23 @@ -1986,13 +1986,13 @@ vga_read_char_attr: ; 0xc0db0 LB 0x127 add ax, ax ; 01 c0 ; 0xc0e41 mov di, dx ; 89 d7 ; 0xc0e43 add di, ax ; 01 c7 ; 0xc0e45 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc0e47 vgabios.c:55 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc0e47 vgabios.c:55 mov ax, word [es:di] ; 26 8b 05 ; 0xc0e4b push SS ; 16 ; 0xc0e4e vgabios.c:58 pop ES ; 07 ; 0xc0e4f mov word [es:si], ax ; 26 89 04 ; 0xc0e50 jmp near 00eceh ; e9 78 00 ; 0xc0e53 vgabios.c:561 - mov bl, byte [bx+047adh] ; 8a 9f ad 47 ; 0xc0e56 vgabios.c:562 + mov bl, byte [bx+047aeh] ; 8a 9f ae 47 ; 0xc0e56 vgabios.c:562 cmp bl, 005h ; 80 fb 05 ; 0xc0e5a je short 00eaah ; 74 4b ; 0xc0e5d cmp bl, 002h ; 80 fb 02 ; 0xc0e5f @@ -2091,18 +2091,18 @@ vga_get_font_info: ; 0xc0ee7 LB 0x83 retn 00002h ; c2 02 00 ; 0xc0f40 mov bx, 0010ch ; bb 0c 01 ; 0xc0f43 vgabios.c:67 jmp short 00f01h ; eb b9 ; 0xc0f46 - mov dx, 05d69h ; ba 69 5d ; 0xc0f48 vgabios.c:601 + mov dx, 05d6ah ; ba 6a 5d ; 0xc0f48 vgabios.c:601 mov ax, ds ; 8c d8 ; 0xc0f4b jmp short 00f0ch ; eb bd ; 0xc0f4d vgabios.c:602 - mov dx, 05569h ; ba 69 55 ; 0xc0f4f vgabios.c:604 + mov dx, 0556ah ; ba 6a 55 ; 0xc0f4f vgabios.c:604 jmp short 00f4bh ; eb f7 ; 0xc0f52 - mov dx, 05969h ; ba 69 59 ; 0xc0f54 vgabios.c:607 + mov dx, 0596ah ; ba 6a 59 ; 0xc0f54 vgabios.c:607 jmp short 00f4bh ; eb f2 ; 0xc0f57 - mov dx, 07b69h ; ba 69 7b ; 0xc0f59 vgabios.c:610 + mov dx, 07b6ah ; ba 6a 7b ; 0xc0f59 vgabios.c:610 jmp short 00f4bh ; eb ed ; 0xc0f5c - mov dx, 06b69h ; ba 69 6b ; 0xc0f5e vgabios.c:613 + mov dx, 06b6ah ; ba 6a 6b ; 0xc0f5e vgabios.c:613 jmp short 00f4bh ; eb e8 ; 0xc0f61 - mov dx, 07c96h ; ba 96 7c ; 0xc0f63 vgabios.c:616 + mov dx, 07c97h ; ba 97 7c ; 0xc0f63 vgabios.c:616 jmp short 00f4bh ; eb e3 ; 0xc0f66 jmp short 00f3dh ; eb d3 ; 0xc0f68 vgabios.c:622 ; disGetNextSymbol 0xc0f6a LB 0x334f -> off=0x0 cb=0000000000000156 uValue=00000000000c0f6a 'vga_read_pixel' @@ -2126,9 +2126,9 @@ vga_read_pixel: ; 0xc0f6a LB 0x156 je near 010b9h ; 0f 84 27 01 ; 0xc0f8e movzx bx, al ; 0f b6 d8 ; 0xc0f92 vgabios.c:645 sal bx, 003h ; c1 e3 03 ; 0xc0f95 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc0f98 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc0f98 je near 010b9h ; 0f 84 18 01 ; 0xc0f9d - mov ch, byte [bx+047adh] ; 8a af ad 47 ; 0xc0fa1 vgabios.c:649 + mov ch, byte [bx+047aeh] ; 8a af ae 47 ; 0xc0fa1 vgabios.c:649 cmp ch, 003h ; 80 fd 03 ; 0xc0fa5 jc short 00fbbh ; 72 11 ; 0xc0fa8 jbe short 00fc3h ; 76 17 ; 0xc0faa @@ -2180,7 +2180,7 @@ vga_read_pixel: ; 0xc0f6a LB 0x156 or ch, al ; 08 c5 ; 0xc1027 inc byte [bp-006h] ; fe 46 fa ; 0xc1029 vgabios.c:661 jmp short 00ffch ; eb ce ; 0xc102c - movzx cx, byte [bx+047aeh] ; 0f b6 8f ae 47 ; 0xc102e vgabios.c:664 + movzx cx, byte [bx+047afh] ; 0f b6 8f af 47 ; 0xc102e vgabios.c:664 mov bx, strict word 00004h ; bb 04 00 ; 0xc1033 sub bx, cx ; 29 cb ; 0xc1036 mov cx, bx ; 89 d9 ; 0xc1038 @@ -2199,7 +2199,7 @@ vga_read_pixel: ; 0xc0f6a LB 0x156 mov al, byte [es:bx] ; 26 8a 07 ; 0xc1058 movzx bx, ah ; 0f b6 dc ; 0xc105b vgabios.c:668 sal bx, 003h ; c1 e3 03 ; 0xc105e - cmp byte [bx+047aeh], 002h ; 80 bf ae 47 02 ; 0xc1061 + cmp byte [bx+047afh], 002h ; 80 bf af 47 02 ; 0xc1061 jne short 0107dh ; 75 15 ; 0xc1066 and dx, strict byte 00003h ; 83 e2 03 ; 0xc1068 vgabios.c:669 mov cx, strict word 00003h ; b9 03 00 ; 0xc106b @@ -2534,7 +2534,7 @@ biosfn_set_active_page: ; 0xc12cb LB 0xcd movzx bx, ch ; 0f b6 dd ; 0xc1301 vgabios.c:847 mov si, bx ; 89 de ; 0xc1304 sal si, 003h ; c1 e6 03 ; 0xc1306 - cmp byte [si+047ach], 000h ; 80 bc ac 47 00 ; 0xc1309 + cmp byte [si+047adh], 000h ; 80 bc ad 47 00 ; 0xc1309 jne short 01344h ; 75 34 ; 0xc130e mov bx, strict word 0004ah ; bb 4a 00 ; 0xc1310 vgabios.c:57 mov ax, strict word 00040h ; b8 40 00 ; 0xc1313 @@ -2558,10 +2558,10 @@ biosfn_set_active_page: ; 0xc12cb LB 0xcd mov bx, dx ; 89 d3 ; 0xc133f inc bx ; 43 ; 0xc1341 jmp short 01353h ; eb 0f ; 0xc1342 vgabios.c:860 - movzx bx, byte [bx+0482bh] ; 0f b6 9f 2b 48 ; 0xc1344 vgabios.c:862 + movzx bx, byte [bx+0482ch] ; 0f b6 9f 2c 48 ; 0xc1344 vgabios.c:862 sal bx, 006h ; c1 e3 06 ; 0xc1349 movzx ax, cl ; 0f b6 c1 ; 0xc134c - mov bx, word [bx+04842h] ; 8b 9f 42 48 ; 0xc134f + mov bx, word [bx+04843h] ; 8b 9f 43 48 ; 0xc134f imul bx, ax ; 0f af d8 ; 0xc1353 mov si, strict word 00063h ; be 63 00 ; 0xc1356 vgabios.c:57 mov ax, strict word 00040h ; b8 40 00 ; 0xc1359 @@ -2605,7 +2605,7 @@ find_vpti: ; 0xc1398 LB 0x45 movzx bx, al ; 0f b6 d8 ; 0xc139d vgabios.c:921 mov si, bx ; 89 de ; 0xc13a0 sal si, 003h ; c1 e6 03 ; 0xc13a2 - cmp byte [si+047ach], 000h ; 80 bc ac 47 00 ; 0xc13a5 + cmp byte [si+047adh], 000h ; 80 bc ad 47 00 ; 0xc13a5 jne short 013d4h ; 75 28 ; 0xc13aa mov si, 00089h ; be 89 00 ; 0xc13ac vgabios.c:47 mov ax, strict word 00040h ; b8 40 00 ; 0xc13af @@ -2613,15 +2613,15 @@ find_vpti: ; 0xc1398 LB 0x45 mov al, byte [es:si] ; 26 8a 04 ; 0xc13b4 test AL, strict byte 010h ; a8 10 ; 0xc13b7 vgabios.c:923 je short 013c2h ; 74 07 ; 0xc13b9 - movsx ax, byte [bx+07df2h] ; 0f be 87 f2 7d ; 0xc13bb vgabios.c:924 + movsx ax, byte [bx+07df3h] ; 0f be 87 f3 7d ; 0xc13bb vgabios.c:924 jmp short 013d9h ; eb 17 ; 0xc13c0 vgabios.c:925 test AL, strict byte 080h ; a8 80 ; 0xc13c2 je short 013cdh ; 74 07 ; 0xc13c4 - movsx ax, byte [bx+07de2h] ; 0f be 87 e2 7d ; 0xc13c6 vgabios.c:926 + movsx ax, byte [bx+07de3h] ; 0f be 87 e3 7d ; 0xc13c6 vgabios.c:926 jmp short 013d9h ; eb 0c ; 0xc13cb vgabios.c:927 - movsx ax, byte [bx+07deah] ; 0f be 87 ea 7d ; 0xc13cd vgabios.c:928 + movsx ax, byte [bx+07debh] ; 0f be 87 eb 7d ; 0xc13cd vgabios.c:928 jmp short 013d9h ; eb 05 ; 0xc13d2 vgabios.c:929 - movzx ax, byte [bx+0482bh] ; 0f b6 87 2b 48 ; 0xc13d4 vgabios.c:930 + movzx ax, byte [bx+0482ch] ; 0f b6 87 2c 48 ; 0xc13d4 vgabios.c:930 pop bp ; 5d ; 0xc13d9 vgabios.c:933 pop si ; 5e ; 0xc13da pop bx ; 5b ; 0xc13db @@ -2680,13 +2680,13 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 jne near 01509h ; 0f 85 b0 00 ; 0xc1455 mov di, cx ; 89 cf ; 0xc1459 vgabios.c:999 sal di, 003h ; c1 e7 03 ; 0xc145b - mov al, byte [di+047b1h] ; 8a 85 b1 47 ; 0xc145e + mov al, byte [di+047b2h] ; 8a 85 b2 47 ; 0xc145e mov dx, 003c6h ; ba c6 03 ; 0xc1462 out DX, AL ; ee ; 0xc1465 xor al, al ; 30 c0 ; 0xc1466 vgabios.c:1002 mov dx, 003c8h ; ba c8 03 ; 0xc1468 out DX, AL ; ee ; 0xc146b - mov cl, byte [di+047b2h] ; 8a 8d b2 47 ; 0xc146c vgabios.c:1005 + mov cl, byte [di+047b3h] ; 8a 8d b3 47 ; 0xc146c vgabios.c:1005 cmp cl, 001h ; 80 f9 01 ; 0xc1470 jc short 01483h ; 72 0e ; 0xc1473 jbe short 0148eh ; 76 17 ; 0xc1475 @@ -2697,21 +2697,21 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 jmp short 014a1h ; eb 1e ; 0xc1481 test cl, cl ; 84 c9 ; 0xc1483 jne short 014a1h ; 75 1a ; 0xc1485 - mov word [bp-016h], 04fbfh ; c7 46 ea bf 4f ; 0xc1487 vgabios.c:1007 + mov word [bp-016h], 04fc0h ; c7 46 ea c0 4f ; 0xc1487 vgabios.c:1007 jmp short 014a1h ; eb 13 ; 0xc148c vgabios.c:1008 - mov word [bp-016h], 0507fh ; c7 46 ea 7f 50 ; 0xc148e vgabios.c:1010 + mov word [bp-016h], 05080h ; c7 46 ea 80 50 ; 0xc148e vgabios.c:1010 jmp short 014a1h ; eb 0c ; 0xc1493 vgabios.c:1011 - mov word [bp-016h], 0513fh ; c7 46 ea 3f 51 ; 0xc1495 vgabios.c:1013 + mov word [bp-016h], 05140h ; c7 46 ea 40 51 ; 0xc1495 vgabios.c:1013 jmp short 014a1h ; eb 05 ; 0xc149a vgabios.c:1014 - mov word [bp-016h], 051ffh ; c7 46 ea ff 51 ; 0xc149c vgabios.c:1016 + mov word [bp-016h], 05200h ; c7 46 ea 00 52 ; 0xc149c vgabios.c:1016 movzx di, byte [bp-010h] ; 0f b6 7e f0 ; 0xc14a1 vgabios.c:1020 sal di, 003h ; c1 e7 03 ; 0xc14a5 - cmp byte [di+047ach], 000h ; 80 bd ac 47 00 ; 0xc14a8 + cmp byte [di+047adh], 000h ; 80 bd ad 47 00 ; 0xc14a8 jne short 014beh ; 75 0f ; 0xc14ad mov es, [bp-01ah] ; 8e 46 e6 ; 0xc14af vgabios.c:1022 cmp byte [es:si+002h], 008h ; 26 80 7c 02 08 ; 0xc14b2 jne short 014beh ; 75 05 ; 0xc14b7 - mov word [bp-016h], 0507fh ; c7 46 ea 7f 50 ; 0xc14b9 vgabios.c:1023 + mov word [bp-016h], 05080h ; c7 46 ea 80 50 ; 0xc14b9 vgabios.c:1023 xor cx, cx ; 31 c9 ; 0xc14be vgabios.c:1026 jmp short 014d1h ; eb 0f ; 0xc14c0 xor al, al ; 30 c0 ; 0xc14c2 vgabios.c:1033 @@ -2724,8 +2724,8 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 jnc short 014fch ; 73 2b ; 0xc14cf movzx di, byte [bp-010h] ; 0f b6 7e f0 ; 0xc14d1 sal di, 003h ; c1 e7 03 ; 0xc14d5 - movzx di, byte [di+047b2h] ; 0f b6 bd b2 47 ; 0xc14d8 - movzx di, byte [di+0483bh] ; 0f b6 bd 3b 48 ; 0xc14dd + movzx di, byte [di+047b3h] ; 0f b6 bd b3 47 ; 0xc14d8 + movzx di, byte [di+0483ch] ; 0f b6 bd 3c 48 ; 0xc14dd cmp cx, di ; 39 f9 ; 0xc14e2 jnbe short 014c2h ; 77 dc ; 0xc14e4 imul di, cx, strict byte 00003h ; 6b f9 03 ; 0xc14e6 @@ -2835,7 +2835,7 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 jmp short 015bbh ; eb e3 ; 0xc15d6 movzx di, byte [bp-010h] ; 0f b6 7e f0 ; 0xc15d8 vgabios.c:1081 sal di, 003h ; c1 e7 03 ; 0xc15dc - cmp byte [di+047adh], 001h ; 80 bd ad 47 01 ; 0xc15df + cmp byte [di+047aeh], 001h ; 80 bd ae 47 01 ; 0xc15df jne short 015ebh ; 75 05 ; 0xc15e4 mov cx, 003b4h ; b9 b4 03 ; 0xc15e6 jmp short 015eeh ; eb 03 ; 0xc15e9 @@ -2875,9 +2875,9 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 jne short 01692h ; 75 5c ; 0xc1634 movzx di, byte [bp-010h] ; 0f b6 7e f0 ; 0xc1636 vgabios.c:1100 sal di, 003h ; c1 e7 03 ; 0xc163a - cmp byte [di+047ach], 000h ; 80 bd ac 47 00 ; 0xc163d + cmp byte [di+047adh], 000h ; 80 bd ad 47 00 ; 0xc163d jne short 01656h ; 75 12 ; 0xc1642 - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc1644 vgabios.c:1102 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc1644 vgabios.c:1102 mov cx, 04000h ; b9 00 40 ; 0xc1648 mov ax, 00720h ; b8 20 07 ; 0xc164b xor di, di ; 31 ff ; 0xc164e @@ -2886,7 +2886,7 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 jmp short 01692h ; eb 3c ; 0xc1654 vgabios.c:1104 cmp byte [bp-00eh], 00dh ; 80 7e f2 0d ; 0xc1656 vgabios.c:1106 jnc short 0166dh ; 73 11 ; 0xc165a - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc165c vgabios.c:1108 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc165c vgabios.c:1108 mov cx, 04000h ; b9 00 40 ; 0xc1660 xor ax, ax ; 31 c0 ; 0xc1663 xor di, di ; 31 ff ; 0xc1665 @@ -2903,7 +2903,7 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 mov word [bp-01eh], ax ; 89 46 e2 ; 0xc1679 mov AL, strict byte 00fh ; b0 0f ; 0xc167c vgabios.c:1114 out DX, AL ; ee ; 0xc167e - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc167f vgabios.c:1115 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc167f vgabios.c:1115 mov cx, 08000h ; b9 00 80 ; 0xc1683 xor ax, ax ; 31 c0 ; 0xc1686 xor di, di ; 31 ff ; 0xc1688 @@ -2952,7 +2952,7 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 cmp AL, strict byte 007h ; 3c 07 ; 0xc1705 jnbe short 0172fh ; 77 26 ; 0xc1707 movzx di, al ; 0f b6 f8 ; 0xc1709 vgabios.c:1136 - mov al, byte [di+07ddah] ; 8a 85 da 7d ; 0xc170c vgabios.c:50 + mov al, byte [di+07ddbh] ; 8a 85 db 7d ; 0xc170c vgabios.c:50 mov di, strict word 00065h ; bf 65 00 ; 0xc1710 vgabios.c:52 mov byte [es:di], al ; 26 88 05 ; 0xc1713 cmp byte [bp-00eh], 006h ; 80 7e f2 06 ; 0xc1716 vgabios.c:1137 @@ -2966,7 +2966,7 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 mov byte [es:di], dl ; 26 88 15 ; 0xc172c movzx di, byte [bp-010h] ; 0f b6 7e f0 ; 0xc172f vgabios.c:1141 sal di, 003h ; c1 e7 03 ; 0xc1733 - cmp byte [di+047ach], 000h ; 80 bd ac 47 00 ; 0xc1736 + cmp byte [di+047adh], 000h ; 80 bd ad 47 00 ; 0xc1736 jne short 01746h ; 75 09 ; 0xc173b mov dx, strict word 00007h ; ba 07 00 ; 0xc173d vgabios.c:1143 mov ax, strict word 00006h ; b8 06 00 ; 0xc1740 @@ -2984,7 +2984,7 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 call 012cbh ; e8 6c fb ; 0xc175c movzx di, byte [bp-010h] ; 0f b6 7e f0 ; 0xc175f vgabios.c:1155 sal di, 003h ; c1 e7 03 ; 0xc1763 - cmp byte [di+047ach], 000h ; 80 bd ac 47 00 ; 0xc1766 + cmp byte [di+047adh], 000h ; 80 bd ad 47 00 ; 0xc1766 jne near 01850h ; 0f 85 e1 00 ; 0xc176b mov es, [bp-014h] ; 8e 46 ec ; 0xc176f vgabios.c:1157 mov di, word [es:bx+008h] ; 26 8b 7f 08 ; 0xc1772 @@ -3001,7 +3001,7 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 push ax ; 50 ; 0xc1794 push dword 000000000h ; 66 6a 00 ; 0xc1795 mov cx, 00100h ; b9 00 01 ; 0xc1798 - mov bx, 05569h ; bb 69 55 ; 0xc179b + mov bx, 0556ah ; bb 6a 55 ; 0xc179b mov dx, 0c000h ; ba 00 c0 ; 0xc179e xor ax, ax ; 31 c0 ; 0xc17a1 call 02c0ah ; e8 64 14 ; 0xc17a3 @@ -3010,7 +3010,7 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 push ax ; 50 ; 0xc17aa push dword 000000000h ; 66 6a 00 ; 0xc17ab mov cx, 00100h ; b9 00 01 ; 0xc17ae - mov bx, 05d69h ; bb 69 5d ; 0xc17b1 + mov bx, 05d6ah ; bb 6a 5d ; 0xc17b1 mov dx, 0c000h ; ba 00 c0 ; 0xc17b4 xor al, al ; 30 c0 ; 0xc17b7 call 02c0ah ; e8 4e 14 ; 0xc17b9 @@ -3018,7 +3018,7 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 jne short 017f4h ; 75 32 ; 0xc17c0 mov cx, strict word 0000eh ; b9 0e 00 ; 0xc17c2 vgabios.c:1166 xor bx, bx ; 31 db ; 0xc17c5 - mov dx, 07b69h ; ba 69 7b ; 0xc17c7 + mov dx, 07b6ah ; ba 6a 7b ; 0xc17c7 mov ax, 0c000h ; b8 00 c0 ; 0xc17ca call 02b95h ; e8 c5 13 ; 0xc17cd jmp short 017f4h ; eb 22 ; 0xc17d0 vgabios.c:1167 @@ -3026,13 +3026,13 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 push ax ; 50 ; 0xc17d4 push dword 000000000h ; 66 6a 00 ; 0xc17d5 mov cx, 00100h ; b9 00 01 ; 0xc17d8 - mov bx, 06b69h ; bb 69 6b ; 0xc17db + mov bx, 06b6ah ; bb 6a 6b ; 0xc17db mov dx, 0c000h ; ba 00 c0 ; 0xc17de xor al, al ; 30 c0 ; 0xc17e1 call 02c0ah ; e8 24 14 ; 0xc17e3 mov cx, strict word 00010h ; b9 10 00 ; 0xc17e6 vgabios.c:1170 xor bx, bx ; 31 db ; 0xc17e9 - mov dx, 07c96h ; ba 96 7c ; 0xc17eb + mov dx, 07c97h ; ba 97 7c ; 0xc17eb mov ax, 0c000h ; b8 00 c0 ; 0xc17ee call 02b95h ; e8 a1 13 ; 0xc17f1 cmp word [bp-012h], strict byte 00000h ; 83 7e ee 00 ; 0xc17f4 vgabios.c:1172 @@ -3070,7 +3070,7 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 mov AL, strict byte 003h ; b0 03 ; 0xc184a mov AH, strict byte 011h ; b4 11 ; 0xc184c int 06dh ; cd 6d ; 0xc184e - mov bx, 05969h ; bb 69 59 ; 0xc1850 vgabios.c:1199 + mov bx, 0596ah ; bb 6a 59 ; 0xc1850 vgabios.c:1199 mov cx, ds ; 8c d9 ; 0xc1853 mov ax, strict word 0001fh ; b8 1f 00 ; 0xc1855 call 009f0h ; e8 95 f1 ; 0xc1858 @@ -3082,14 +3082,14 @@ biosfn_set_video_mode: ; 0xc13dd LB 0x4b2 je short 0187bh ; 74 11 ; 0xc1868 cmp AL, strict byte 008h ; 3c 08 ; 0xc186a jne short 01885h ; 75 17 ; 0xc186c - mov bx, 05569h ; bb 69 55 ; 0xc186e vgabios.c:1203 + mov bx, 0556ah ; bb 6a 55 ; 0xc186e vgabios.c:1203 mov cx, ds ; 8c d9 ; 0xc1871 mov ax, strict word 00043h ; b8 43 00 ; 0xc1873 call 009f0h ; e8 77 f1 ; 0xc1876 jmp short 01885h ; eb 0a ; 0xc1879 vgabios.c:1204 - mov bx, 05d69h ; bb 69 5d ; 0xc187b vgabios.c:1206 + mov bx, 05d6ah ; bb 6a 5d ; 0xc187b vgabios.c:1206 jmp short 01871h ; eb f1 ; 0xc187e - mov bx, 06b69h ; bb 69 6b ; 0xc1880 vgabios.c:1209 + mov bx, 06b6ah ; bb 6a 6b ; 0xc1880 vgabios.c:1209 jmp short 01871h ; eb ec ; 0xc1883 lea sp, [bp-00ah] ; 8d 66 f6 ; 0xc1885 vgabios.c:1212 pop di ; 5f ; 0xc1888 @@ -3485,7 +3485,7 @@ biosfn_scroll: ; 0xc1b5d LB 0x628 mov word [bp-016h], ax ; 89 46 ea ; 0xc1c06 mov ax, word [bp-014h] ; 8b 46 ec ; 0xc1c09 imul ax, cx ; 0f af c1 ; 0xc1c0c - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc1c0f + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc1c0f jne near 01db3h ; 0f 85 9b 01 ; 0xc1c14 mov cx, ax ; 89 c1 ; 0xc1c18 vgabios.c:1345 add cx, ax ; 01 c1 ; 0xc1c1a @@ -3509,7 +3509,7 @@ biosfn_scroll: ; 0xc1b5d LB 0x628 movzx dx, byte [bp-012h] ; 0f b6 56 ee ; 0xc1c4d vgabios.c:1352 sal dx, 008h ; c1 e2 08 ; 0xc1c51 add dx, strict byte 00020h ; 83 c2 20 ; 0xc1c54 - mov bx, word [bx+047afh] ; 8b 9f af 47 ; 0xc1c57 + mov bx, word [bx+047b0h] ; 8b 9f b0 47 ; 0xc1c57 mov cx, ax ; 89 c1 ; 0xc1c5b mov ax, dx ; 89 d0 ; 0xc1c5d mov di, word [bp-01ch] ; 8b 7e e4 ; 0xc1c5f @@ -3543,7 +3543,7 @@ biosfn_scroll: ; 0xc1b5d LB 0x628 add di, dx ; 01 d7 ; 0xc1cb6 movzx bx, byte [bp-006h] ; 0f b6 5e fa ; 0xc1cb8 sal bx, 003h ; c1 e3 03 ; 0xc1cbc - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc1cbf + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc1cbf jcxz 01cc7h ; e3 02 ; 0xc1cc3 rep stosw ; f3 ab ; 0xc1cc5 jmp short 01d02h ; eb 39 ; 0xc1cc7 vgabios.c:1361 @@ -3555,7 +3555,7 @@ biosfn_scroll: ; 0xc1b5d LB 0x628 add si, si ; 01 f6 ; 0xc1cd9 movzx bx, byte [bp-006h] ; 0f b6 5e fa ; 0xc1cdb sal bx, 003h ; c1 e3 03 ; 0xc1cdf - mov ax, word [bx+047afh] ; 8b 87 af 47 ; 0xc1ce2 + mov ax, word [bx+047b0h] ; 8b 87 b0 47 ; 0xc1ce2 mov bx, word [bp-01ah] ; 8b 5e e6 ; 0xc1ce6 imul bx, word [bp-014h] ; 0f af 5e ec ; 0xc1ce9 mov di, dx ; 89 d7 ; 0xc1ced @@ -3596,7 +3596,7 @@ biosfn_scroll: ; 0xc1b5d LB 0x628 add di, dx ; 01 d7 ; 0xc1d4f movzx bx, byte [bp-006h] ; 0f b6 5e fa ; 0xc1d51 sal bx, 003h ; c1 e3 03 ; 0xc1d55 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc1d58 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc1d58 jcxz 01d60h ; e3 02 ; 0xc1d5c rep stosw ; f3 ab ; 0xc1d5e jmp short 01da2h ; eb 40 ; 0xc1d60 vgabios.c:1370 @@ -3610,7 +3610,7 @@ biosfn_scroll: ; 0xc1b5d LB 0x628 add si, si ; 01 f6 ; 0xc1d79 movzx bx, byte [bp-006h] ; 0f b6 5e fa ; 0xc1d7b sal bx, 003h ; c1 e3 03 ; 0xc1d7f - mov ax, word [bx+047afh] ; 8b 87 af 47 ; 0xc1d82 + mov ax, word [bx+047b0h] ; 8b 87 b0 47 ; 0xc1d82 mov bx, word [bp-01ah] ; 8b 5e e6 ; 0xc1d86 imul bx, word [bp-014h] ; 0f af 5e ec ; 0xc1d89 add dx, bx ; 01 da ; 0xc1d8d @@ -3629,11 +3629,11 @@ biosfn_scroll: ; 0xc1b5d LB 0x628 jc near 0217ch ; 0f 82 cf 03 ; 0xc1da9 dec word [bp-01ah] ; ff 4e e6 ; 0xc1dad vgabios.c:1373 jmp near 01d0fh ; e9 5c ff ; 0xc1db0 - movzx di, byte [di+0482bh] ; 0f b6 bd 2b 48 ; 0xc1db3 vgabios.c:1379 + movzx di, byte [di+0482ch] ; 0f b6 bd 2c 48 ; 0xc1db3 vgabios.c:1379 sal di, 006h ; c1 e7 06 ; 0xc1db8 - mov dl, byte [di+04841h] ; 8a 95 41 48 ; 0xc1dbb + mov dl, byte [di+04842h] ; 8a 95 42 48 ; 0xc1dbb mov byte [bp-00eh], dl ; 88 56 f2 ; 0xc1dbf - mov dl, byte [bx+047adh] ; 8a 97 ad 47 ; 0xc1dc2 vgabios.c:1380 + mov dl, byte [bx+047aeh] ; 8a 97 ae 47 ; 0xc1dc2 vgabios.c:1380 cmp dl, 003h ; 80 fa 03 ; 0xc1dc6 jc short 01ddch ; 72 11 ; 0xc1dc9 jbe short 01de6h ; 76 19 ; 0xc1dcb @@ -3671,7 +3671,7 @@ biosfn_scroll: ; 0xc1b5d LB 0x628 movzx ax, byte [bp-012h] ; 0f b6 46 ee ; 0xc1e22 movzx bx, byte [bp-006h] ; 0f b6 5e fa ; 0xc1e26 sal bx, 003h ; c1 e3 03 ; 0xc1e2a - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc1e2d + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc1e2d xor di, di ; 31 ff ; 0xc1e31 jcxz 01e37h ; e3 02 ; 0xc1e33 rep stosb ; f3 aa ; 0xc1e35 @@ -3752,7 +3752,7 @@ biosfn_scroll: ; 0xc1b5d LB 0x628 jc near 0217ch ; 0f 82 5c 02 ; 0xc1f1c dec word [bp-01ah] ; ff 4e e6 ; 0xc1f20 vgabios.c:1409 jmp short 01eb4h ; eb 8f ; 0xc1f23 - mov dl, byte [bx+047aeh] ; 8a 97 ae 47 ; 0xc1f25 vgabios.c:1414 + mov dl, byte [bx+047afh] ; 8a 97 af 47 ; 0xc1f25 vgabios.c:1414 cmp byte [bp-008h], 000h ; 80 7e f8 00 ; 0xc1f29 vgabios.c:1415 jne short 01f6ah ; 75 3b ; 0xc1f2d cmp byte [bp-00ch], 000h ; 80 7e f4 00 ; 0xc1f2f @@ -3770,7 +3770,7 @@ biosfn_scroll: ; 0xc1b5d LB 0x628 movzx cx, dl ; 0f b6 ca ; 0xc1f53 imul cx, ax ; 0f af c8 ; 0xc1f56 movzx ax, byte [bp-012h] ; 0f b6 46 ee ; 0xc1f59 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc1f5d + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc1f5d xor di, di ; 31 ff ; 0xc1f61 jcxz 01f67h ; e3 02 ; 0xc1f63 rep stosb ; f3 aa ; 0xc1f65 @@ -3871,7 +3871,7 @@ biosfn_scroll: ; 0xc1b5d LB 0x628 imul cx, dx ; 0f af ca ; 0xc2088 sal cx, 003h ; c1 e1 03 ; 0xc208b movzx ax, byte [bp-012h] ; 0f b6 46 ee ; 0xc208e - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc2092 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc2092 xor di, di ; 31 ff ; 0xc2096 jcxz 0209ch ; e3 02 ; 0xc2098 rep stosb ; f3 aa ; 0xc209a @@ -4061,7 +4061,7 @@ write_gfx_char_cga: ; 0xc2284 LB 0xdd push si ; 56 ; 0xc2284 vgabios.c:1534 push di ; 57 ; 0xc2285 enter 00006h, 000h ; c8 06 00 00 ; 0xc2286 - mov di, 05569h ; bf 69 55 ; 0xc228a vgabios.c:1541 + mov di, 0556ah ; bf 6a 55 ; 0xc228a vgabios.c:1541 xor bh, bh ; 30 ff ; 0xc228d vgabios.c:1542 movzx si, byte [bp+00ah] ; 0f b6 76 0a ; 0xc228f imul si, bx ; 0f af f3 ; 0xc2293 @@ -4154,7 +4154,7 @@ write_gfx_char_lin: ; 0xc2361 LB 0x85 push di ; 57 ; 0xc2362 enter 00006h, 000h ; c8 06 00 00 ; 0xc2363 mov dh, dl ; 88 d6 ; 0xc2367 - mov word [bp-002h], 05569h ; c7 46 fe 69 55 ; 0xc2369 vgabios.c:1605 + mov word [bp-002h], 0556ah ; c7 46 fe 6a 55 ; 0xc2369 vgabios.c:1605 movzx si, cl ; 0f b6 f1 ; 0xc236e vgabios.c:1606 movzx cx, byte [bp+008h] ; 0f b6 4e 08 ; 0xc2371 imul cx, si ; 0f af ce ; 0xc2375 @@ -4250,7 +4250,7 @@ biosfn_write_char_attr: ; 0xc23e6 LB 0x165 movzx bx, cl ; 0f b6 d9 ; 0xc244b vgabios.c:1645 mov di, bx ; 89 df ; 0xc244e sal di, 003h ; c1 e7 03 ; 0xc2450 - cmp byte [di+047ach], 000h ; 80 bd ac 47 00 ; 0xc2453 + cmp byte [di+047adh], 000h ; 80 bd ad 47 00 ; 0xc2453 jne short 024a0h ; 75 46 ; 0xc2458 mov bx, word [bp-018h] ; 8b 5e e8 ; 0xc245a vgabios.c:1648 imul bx, ax ; 0f af d8 ; 0xc245d @@ -4272,24 +4272,24 @@ biosfn_write_char_attr: ; 0xc23e6 LB 0x165 add ax, bx ; 01 d8 ; 0xc2489 mov word [bp-01ah], ax ; 89 46 e6 ; 0xc248b mov ax, word [bp-01ah] ; 8b 46 e6 ; 0xc248e vgabios.c:1651 - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc2491 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc2491 mov cx, si ; 89 f1 ; 0xc2495 mov di, dx ; 89 d7 ; 0xc2497 jcxz 0249dh ; e3 02 ; 0xc2499 rep stosw ; f3 ab ; 0xc249b jmp near 02544h ; e9 a4 00 ; 0xc249d vgabios.c:1653 - movzx bx, byte [bx+0482bh] ; 0f b6 9f 2b 48 ; 0xc24a0 vgabios.c:1656 + movzx bx, byte [bx+0482ch] ; 0f b6 9f 2c 48 ; 0xc24a0 vgabios.c:1656 sal bx, 006h ; c1 e3 06 ; 0xc24a5 - mov al, byte [bx+04841h] ; 8a 87 41 48 ; 0xc24a8 + mov al, byte [bx+04842h] ; 8a 87 42 48 ; 0xc24a8 mov byte [bp-006h], al ; 88 46 fa ; 0xc24ac - mov al, byte [di+047aeh] ; 8a 85 ae 47 ; 0xc24af vgabios.c:1657 + mov al, byte [di+047afh] ; 8a 85 af 47 ; 0xc24af vgabios.c:1657 mov byte [bp-00ch], al ; 88 46 f4 ; 0xc24b3 dec si ; 4e ; 0xc24b6 vgabios.c:1658 cmp si, strict byte 0ffffh ; 83 fe ff ; 0xc24b7 je near 02544h ; 0f 84 86 00 ; 0xc24ba movzx bx, byte [bp-00ah] ; 0f b6 5e f6 ; 0xc24be vgabios.c:1660 sal bx, 003h ; c1 e3 03 ; 0xc24c2 - mov al, byte [bx+047adh] ; 8a 87 ad 47 ; 0xc24c5 + mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc24c5 cmp AL, strict byte 003h ; 3c 03 ; 0xc24c9 jc short 024d9h ; 72 0c ; 0xc24cb jbe short 024dfh ; 76 10 ; 0xc24cd @@ -4382,7 +4382,7 @@ biosfn_write_char_only: ; 0xc254b LB 0x162 xor ch, ch ; 30 ed ; 0xc25af vgabios.c:1703 mov bx, cx ; 89 cb ; 0xc25b1 sal bx, 003h ; c1 e3 03 ; 0xc25b3 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc25b6 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc25b6 jne short 025fah ; 75 3d ; 0xc25bb imul di, ax ; 0f af f8 ; 0xc25bd vgabios.c:1706 add di, di ; 01 ff ; 0xc25c0 @@ -4401,26 +4401,26 @@ biosfn_write_char_only: ; 0xc254b LB 0x162 je near 026a6h ; 0f 84 c1 00 ; 0xc25e1 movzx di, byte [bp-012h] ; 0f b6 7e ee ; 0xc25e5 vgabios.c:1709 sal di, 003h ; c1 e7 03 ; 0xc25e9 - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc25ec vgabios.c:50 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc25ec vgabios.c:50 mov al, byte [bp-008h] ; 8a 46 f8 ; 0xc25f0 mov byte [es:bx], al ; 26 88 07 ; 0xc25f3 inc bx ; 43 ; 0xc25f6 vgabios.c:1710 inc bx ; 43 ; 0xc25f7 jmp short 025ddh ; eb e3 ; 0xc25f8 vgabios.c:1711 mov di, cx ; 89 cf ; 0xc25fa vgabios.c:1716 - movzx ax, byte [di+0482bh] ; 0f b6 85 2b 48 ; 0xc25fc + movzx ax, byte [di+0482ch] ; 0f b6 85 2c 48 ; 0xc25fc mov di, ax ; 89 c7 ; 0xc2601 sal di, 006h ; c1 e7 06 ; 0xc2603 - mov al, byte [di+04841h] ; 8a 85 41 48 ; 0xc2606 + mov al, byte [di+04842h] ; 8a 85 42 48 ; 0xc2606 mov byte [bp-00ch], al ; 88 46 f4 ; 0xc260a - mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc260d vgabios.c:1717 + mov al, byte [bx+047afh] ; 8a 87 af 47 ; 0xc260d vgabios.c:1717 mov byte [bp-014h], al ; 88 46 ec ; 0xc2611 dec si ; 4e ; 0xc2614 vgabios.c:1718 cmp si, strict byte 0ffffh ; 83 fe ff ; 0xc2615 je near 026a6h ; 0f 84 8a 00 ; 0xc2618 movzx bx, byte [bp-012h] ; 0f b6 5e ee ; 0xc261c vgabios.c:1720 sal bx, 003h ; c1 e3 03 ; 0xc2620 - mov bl, byte [bx+047adh] ; 8a 9f ad 47 ; 0xc2623 + mov bl, byte [bx+047aeh] ; 8a 9f ae 47 ; 0xc2623 cmp bl, 003h ; 80 fb 03 ; 0xc2627 jc short 0263ah ; 72 0e ; 0xc262a jbe short 02641h ; 76 13 ; 0xc262c @@ -4490,9 +4490,9 @@ biosfn_write_pixel: ; 0xc26ad LB 0x165 je near 027edh ; 0f 84 1a 01 ; 0xc26cf movzx bx, al ; 0f b6 d8 ; 0xc26d3 vgabios.c:1753 sal bx, 003h ; c1 e3 03 ; 0xc26d6 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc26d9 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc26d9 je near 027edh ; 0f 84 0b 01 ; 0xc26de - mov al, byte [bx+047adh] ; 8a 87 ad 47 ; 0xc26e2 vgabios.c:1755 + mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc26e2 vgabios.c:1755 cmp AL, strict byte 003h ; 3c 03 ; 0xc26e6 jc short 026f9h ; 72 0f ; 0xc26e8 jbe short 02700h ; 76 14 ; 0xc26ea @@ -4551,7 +4551,7 @@ biosfn_write_pixel: ; 0xc26ad LB 0x165 mov si, cx ; 89 ce ; 0xc276f vgabios.c:1775 shr si, 1 ; d1 ee ; 0xc2771 imul si, si, strict byte 00050h ; 6b f6 50 ; 0xc2773 - cmp al, byte [bx+047aeh] ; 3a 87 ae 47 ; 0xc2776 + cmp al, byte [bx+047afh] ; 3a 87 af 47 ; 0xc2776 jne short 02783h ; 75 07 ; 0xc277a mov bx, dx ; 89 d3 ; 0xc277c vgabios.c:1777 shr bx, 002h ; c1 eb 02 ; 0xc277e @@ -4567,7 +4567,7 @@ biosfn_write_pixel: ; 0xc26ad LB 0x165 mov al, byte [es:bx] ; 26 8a 07 ; 0xc2797 movzx si, ah ; 0f b6 f4 ; 0xc279a vgabios.c:1785 sal si, 003h ; c1 e6 03 ; 0xc279d - cmp byte [si+047aeh], 002h ; 80 bc ae 47 02 ; 0xc27a0 + cmp byte [si+047afh], 002h ; 80 bc af 47 02 ; 0xc27a0 jne short 027beh ; 75 17 ; 0xc27a5 mov ah, dl ; 88 d4 ; 0xc27a7 vgabios.c:1787 and ah, 003h ; 80 e4 03 ; 0xc27a9 @@ -4684,7 +4684,7 @@ biosfn_write_teletype: ; 0xc2812 LB 0x24a movzx si, byte [bp-00ch] ; 0f b6 76 f4 ; 0xc28be vgabios.c:1862 mov bx, si ; 89 f3 ; 0xc28c2 sal bx, 003h ; c1 e3 03 ; 0xc28c4 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc28c7 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc28c7 jne short 02911h ; 75 43 ; 0xc28cc mov ax, word [bp-010h] ; 8b 46 f0 ; 0xc28ce vgabios.c:1865 imul ax, word [bp-00eh] ; 0f af 46 f2 ; 0xc28d1 @@ -4700,20 +4700,20 @@ biosfn_write_teletype: ; 0xc2812 LB 0x24a add ax, dx ; 01 d0 ; 0xc28ef add ax, ax ; 01 c0 ; 0xc28f1 add si, ax ; 01 c6 ; 0xc28f3 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc28f5 vgabios.c:50 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc28f5 vgabios.c:50 mov byte [es:si], ch ; 26 88 2c ; 0xc28f9 cmp cl, 003h ; 80 f9 03 ; 0xc28fc vgabios.c:1870 jne near 0299fh ; 0f 85 9c 00 ; 0xc28ff inc si ; 46 ; 0xc2903 vgabios.c:1871 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc2904 vgabios.c:50 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc2904 vgabios.c:50 mov al, byte [bp-008h] ; 8a 46 f8 ; 0xc2908 mov byte [es:si], al ; 26 88 04 ; 0xc290b jmp near 0299fh ; e9 8e 00 ; 0xc290e vgabios.c:1873 - movzx si, byte [si+0482bh] ; 0f b6 b4 2b 48 ; 0xc2911 vgabios.c:1876 + movzx si, byte [si+0482ch] ; 0f b6 b4 2c 48 ; 0xc2911 vgabios.c:1876 sal si, 006h ; c1 e6 06 ; 0xc2916 - mov ah, byte [si+04841h] ; 8a a4 41 48 ; 0xc2919 - mov dl, byte [bx+047aeh] ; 8a 97 ae 47 ; 0xc291d vgabios.c:1877 - mov al, byte [bx+047adh] ; 8a 87 ad 47 ; 0xc2921 vgabios.c:1878 + mov ah, byte [si+04842h] ; 8a a4 42 48 ; 0xc2919 + mov dl, byte [bx+047afh] ; 8a 97 af 47 ; 0xc291d vgabios.c:1877 + mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc2921 vgabios.c:1878 cmp AL, strict byte 003h ; 3c 03 ; 0xc2925 jc short 02935h ; 72 0c ; 0xc2927 jbe short 0293bh ; 76 10 ; 0xc2929 @@ -4777,7 +4777,7 @@ biosfn_write_teletype: ; 0xc2812 LB 0x24a mov ah, byte [bp-010h] ; 8a 66 f0 ; 0xc29c9 db 0feh, 0cch ; dec ah ; fe cc ; 0xc29cc - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc29ce + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc29ce jne short 02a1dh ; 75 48 ; 0xc29d3 mov dx, word [bp-010h] ; 8b 56 f0 ; 0xc29d5 vgabios.c:1910 imul dx, word [bp-00eh] ; 0f af 56 f2 ; 0xc29d8 @@ -4795,7 +4795,7 @@ biosfn_write_teletype: ; 0xc2812 LB 0x24a add dx, dx ; 01 d2 ; 0xc29fa add si, dx ; 01 d6 ; 0xc29fc inc si ; 46 ; 0xc29fe vgabios.c:1911 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc29ff vgabios.c:45 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc29ff vgabios.c:45 mov bl, byte [es:si] ; 26 8a 1c ; 0xc2a03 push strict byte 00001h ; 6a 01 ; 0xc2a06 vgabios.c:1912 movzx dx, byte [bp-00ah] ; 0f b6 56 f6 ; 0xc2a08 @@ -5146,7 +5146,7 @@ set_gfx_font: ; 0xc2c9c LB 0x49 jbe short 02cbch ; 76 02 ; 0xc2cb8 mov DL, strict byte 002h ; b2 02 ; 0xc2cba vgabios.c:2033 movzx bx, dl ; 0f b6 da ; 0xc2cbc vgabios.c:2034 - mov al, byte [bx+07dfah] ; 8a 87 fa 7d ; 0xc2cbf + mov al, byte [bx+07dfbh] ; 8a 87 fb 7d ; 0xc2cbf mov byte [bp+004h], al ; 88 46 04 ; 0xc2cc3 mov bx, 00085h ; bb 85 00 ; 0xc2cc6 vgabios.c:62 mov ax, strict word 00040h ; b8 40 00 ; 0xc2cc9 @@ -5187,7 +5187,7 @@ biosfn_load_gfx_8_14_chars: ; 0xc2d01 LB 0x1e push cx ; 51 ; 0xc2d09 movzx cx, al ; 0f b6 c8 ; 0xc2d0a mov bx, strict word 0000eh ; bb 0e 00 ; 0xc2d0d - mov ax, 05d69h ; b8 69 5d ; 0xc2d10 + mov ax, 05d6ah ; b8 6a 5d ; 0xc2d10 mov dx, ds ; 8c da ; 0xc2d13 call 02c9ch ; e8 84 ff ; 0xc2d15 lea sp, [bp-004h] ; 8d 66 fc ; 0xc2d18 vgabios.c:2054 @@ -5205,7 +5205,7 @@ biosfn_load_gfx_8_8_dd_chars: ; 0xc2d1f LB 0x1e push cx ; 51 ; 0xc2d27 movzx cx, al ; 0f b6 c8 ; 0xc2d28 mov bx, strict word 00008h ; bb 08 00 ; 0xc2d2b - mov ax, 05569h ; b8 69 55 ; 0xc2d2e + mov ax, 0556ah ; b8 6a 55 ; 0xc2d2e mov dx, ds ; 8c da ; 0xc2d31 call 02c9ch ; e8 66 ff ; 0xc2d33 lea sp, [bp-004h] ; 8d 66 fc ; 0xc2d36 vgabios.c:2058 @@ -5223,7 +5223,7 @@ biosfn_load_gfx_8_16_chars: ; 0xc2d3d LB 0x1e push cx ; 51 ; 0xc2d45 movzx cx, al ; 0f b6 c8 ; 0xc2d46 mov bx, strict word 00010h ; bb 10 00 ; 0xc2d49 - mov ax, 06b69h ; b8 69 6b ; 0xc2d4c + mov ax, 06b6ah ; b8 6a 6b ; 0xc2d4c mov dx, ds ; 8c da ; 0xc2d4f call 02c9ch ; e8 48 ff ; 0xc2d51 lea sp, [bp-004h] ; 8d 66 fc ; 0xc2d54 vgabios.c:2062 @@ -5355,7 +5355,7 @@ biosfn_read_state_info: ; 0xc2e32 LB 0x1f2 mov word [bp-00ah], ax ; 89 46 f6 ; 0xc2e4f vgabios.c:58 mov ax, ds ; 8c d8 ; 0xc2e52 vgabios.c:2150 mov es, dx ; 8e c2 ; 0xc2e54 vgabios.c:72 - mov word [es:bx], 054ffh ; 26 c7 07 ff 54 ; 0xc2e56 + mov word [es:bx], 05500h ; 26 c7 07 00 55 ; 0xc2e56 mov [es:bx+002h], ds ; 26 8c 5f 02 ; 0xc2e5b lea di, [bx+004h] ; 8d 7f 04 ; 0xc2e5f vgabios.c:2155 mov cx, strict word 0001eh ; b9 1e 00 ; 0xc2e62 @@ -6231,7 +6231,7 @@ find_vga_entry: ; 0xc35ed LB 0x27 jnbe short 0360eh ; 77 0e ; 0xc35fe movzx bx, al ; 0f b6 d8 ; 0xc3600 sal bx, 003h ; c1 e3 03 ; 0xc3603 - cmp dl, byte [bx+047abh] ; 3a 97 ab 47 ; 0xc3606 + cmp dl, byte [bx+047ach] ; 3a 97 ac 47 ; 0xc3606 jne short 035fah ; 75 ee ; 0xc360a mov ah, al ; 88 c4 ; 0xc360c mov al, ah ; 88 e0 ; 0xc360e vgabios.c:2438 @@ -6449,7 +6449,7 @@ int10_func: ; 0xc36ac LB 0x47c push strict byte 00000h ; 6a 00 ; 0xc389a movzx ax, byte [bp+012h] ; 0f b6 46 12 ; 0xc389c mov cx, 00100h ; b9 00 01 ; 0xc38a0 - mov bx, 05d69h ; bb 69 5d ; 0xc38a3 + mov bx, 05d6ah ; bb 6a 5d ; 0xc38a3 mov dx, 0c000h ; ba 00 c0 ; 0xc38a6 call 02c0ah ; e8 5e f3 ; 0xc38a9 jmp near 03b21h ; e9 72 02 ; 0xc38ac @@ -6459,7 +6459,7 @@ int10_func: ; 0xc36ac LB 0x47c push strict byte 00000h ; 6a 00 ; 0xc38b6 movzx ax, byte [bp+012h] ; 0f b6 46 12 ; 0xc38b8 mov cx, 00100h ; b9 00 01 ; 0xc38bc - mov bx, 05569h ; bb 69 55 ; 0xc38bf + mov bx, 0556ah ; bb 6a 55 ; 0xc38bf jmp short 038a6h ; eb e2 ; 0xc38c2 mov al, byte [bp+00ch] ; 8a 46 0c ; 0xc38c4 vgabios.c:2629 xor ah, ah ; 30 e4 ; 0xc38c7 @@ -6471,7 +6471,7 @@ int10_func: ; 0xc36ac LB 0x47c push strict byte 00000h ; 6a 00 ; 0xc38d6 movzx ax, byte [bp+012h] ; 0f b6 46 12 ; 0xc38d8 mov cx, 00100h ; b9 00 01 ; 0xc38dc - mov bx, 06b69h ; bb 69 6b ; 0xc38df + mov bx, 06b6ah ; bb 6a 6b ; 0xc38df jmp short 038a6h ; eb c2 ; 0xc38e2 mov dx, word [bp+008h] ; 8b 56 08 ; 0xc38e4 vgabios.c:2636 mov ax, word [bp+016h] ; 8b 46 16 ; 0xc38e7 @@ -6992,7 +6992,7 @@ vbe_biosfn_return_controller_information: ; 0xc3cf2 LB 0x125 db 066h, 026h, 0c7h, 007h, 056h, 045h, 053h, 041h ; mov dword [es:bx], strict dword 041534556h ; 66 26 c7 07 56 45 53 41 ; 0xc3d5d mov word [es:bx+004h], 00200h ; 26 c7 47 04 00 02 ; 0xc3d65 vbe.c:338 - mov word [es:bx+006h], 07dfeh ; 26 c7 47 06 fe 7d ; 0xc3d6b vbe.c:341 + mov word [es:bx+006h], 07e00h ; 26 c7 47 06 00 7e ; 0xc3d6b vbe.c:341 mov [es:bx+008h], ds ; 26 8c 5f 08 ; 0xc3d71 db 066h, 026h, 0c7h, 047h, 00ah, 001h, 000h, 000h, 000h ; mov dword [es:bx+00ah], strict dword 000000001h ; 66 26 c7 47 0a 01 00 00 00; 0xc3d75 vbe.c:344 @@ -7008,11 +7008,11 @@ vbe_biosfn_return_controller_information: ; 0xc3cf2 LB 0x125 cmp word [bp-00eh], strict byte 00000h ; 83 7e f2 00 ; 0xc3d9c vbe.c:356 je short 03dc6h ; 74 24 ; 0xc3da0 mov word [es:bx+014h], strict word 00003h ; 26 c7 47 14 03 00 ; 0xc3da2 vbe.c:359 - mov word [es:bx+016h], 07e13h ; 26 c7 47 16 13 7e ; 0xc3da8 vbe.c:360 + mov word [es:bx+016h], 07e15h ; 26 c7 47 16 15 7e ; 0xc3da8 vbe.c:360 mov [es:bx+018h], ds ; 26 8c 5f 18 ; 0xc3dae - mov word [es:bx+01ah], 07e30h ; 26 c7 47 1a 30 7e ; 0xc3db2 vbe.c:361 + mov word [es:bx+01ah], 07e32h ; 26 c7 47 1a 32 7e ; 0xc3db2 vbe.c:361 mov [es:bx+01ch], ds ; 26 8c 5f 1c ; 0xc3db8 - mov word [es:bx+01eh], 07e4eh ; 26 c7 47 1e 4e 7e ; 0xc3dbc vbe.c:362 + mov word [es:bx+01eh], 07e50h ; 26 c7 47 1e 50 7e ; 0xc3dbc vbe.c:362 mov [es:bx+020h], ds ; 26 8c 5f 20 ; 0xc3dc2 mov dx, cx ; 89 ca ; 0xc3dc6 vbe.c:369 add dx, strict byte 0001bh ; 83 c2 1b ; 0xc3dc8 @@ -7732,12 +7732,12 @@ vesa_pm_end: ; 0xc4754 LB 0x1 ; Padding 0x2b bytes at 0xc4755 times 43 db 0 -section _DATA progbits vstart=0x4780 align=1 ; size=0x3742 class=DATA group=DGROUP - ; disGetNextSymbol 0xc4780 LB 0x3742 -> off=0x0 cb=000000000000002b uValue=00000000000c0000 '_msg_vga_init' -_msg_vga_init: ; 0xc4780 LB 0x2b - db 'Oracle VirtualBox Version 7.1.8 VGA BIOS', 00dh, 00ah, 000h - ; disGetNextSymbol 0xc47ab LB 0x3717 -> off=0x0 cb=0000000000000080 uValue=00000000000c002b 'vga_modes' -vga_modes: ; 0xc47ab LB 0x80 +section _DATA progbits vstart=0x4780 align=1 ; size=0x3745 class=DATA group=DGROUP + ; disGetNextSymbol 0xc4780 LB 0x3745 -> off=0x0 cb=000000000000002c uValue=00000000000c0000 '_msg_vga_init' +_msg_vga_init: ; 0xc4780 LB 0x2c + db 'Oracle VirtualBox Version 7.1.10 VGA BIOS', 00dh, 00ah, 000h + ; disGetNextSymbol 0xc47ac LB 0x3719 -> off=0x0 cb=0000000000000080 uValue=00000000000c002c 'vga_modes' +vga_modes: ; 0xc47ac LB 0x80 db 000h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 001h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h db 002h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 003h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h db 004h, 001h, 002h, 002h, 000h, 0b8h, 0ffh, 001h, 005h, 001h, 002h, 002h, 000h, 0b8h, 0ffh, 001h @@ -7746,14 +7746,14 @@ vga_modes: ; 0xc47ab LB 0x80 db 00fh, 001h, 003h, 001h, 000h, 0a0h, 0ffh, 000h, 010h, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h db 011h, 001h, 003h, 001h, 000h, 0a0h, 0ffh, 002h, 012h, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h db 013h, 001h, 005h, 008h, 000h, 0a0h, 0ffh, 003h, 06ah, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h - ; disGetNextSymbol 0xc482b LB 0x3697 -> off=0x0 cb=0000000000000010 uValue=00000000000c00ab 'line_to_vpti' -line_to_vpti: ; 0xc482b LB 0x10 + ; disGetNextSymbol 0xc482c LB 0x3699 -> off=0x0 cb=0000000000000010 uValue=00000000000c00ac 'line_to_vpti' +line_to_vpti: ; 0xc482c LB 0x10 db 017h, 017h, 018h, 018h, 004h, 005h, 006h, 007h, 00dh, 00eh, 011h, 012h, 01ah, 01bh, 01ch, 01dh - ; disGetNextSymbol 0xc483b LB 0x3687 -> off=0x0 cb=0000000000000004 uValue=00000000000c00bb 'dac_regs' -dac_regs: ; 0xc483b LB 0x4 + ; disGetNextSymbol 0xc483c LB 0x3689 -> off=0x0 cb=0000000000000004 uValue=00000000000c00bc 'dac_regs' +dac_regs: ; 0xc483c LB 0x4 dd 0ff3f3f3fh - ; disGetNextSymbol 0xc483f LB 0x3683 -> off=0x0 cb=0000000000000780 uValue=00000000000c00bf 'video_param_table' -video_param_table: ; 0xc483f LB 0x780 + ; disGetNextSymbol 0xc4840 LB 0x3685 -> off=0x0 cb=0000000000000780 uValue=00000000000c00c0 'video_param_table' +video_param_table: ; 0xc4840 LB 0x780 db 028h, 018h, 008h, 000h, 008h, 009h, 003h, 000h, 002h, 063h, 02dh, 027h, 028h, 090h, 02bh, 0a0h db 0bfh, 01fh, 000h, 0c7h, 006h, 007h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 014h, 01fh, 096h db 0b9h, 0a3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h, 010h, 011h, 012h, 013h, 014h @@ -7874,8 +7874,8 @@ video_param_table: ; 0xc483f LB 0x780 db 072h, 0f0h, 000h, 060h, 000h, 000h, 000h, 000h, 000h, 000h, 059h, 08dh, 057h, 032h, 000h, 057h db 073h, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch db 03dh, 03eh, 03fh, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh - ; disGetNextSymbol 0xc4fbf LB 0x2f03 -> off=0x0 cb=00000000000000c0 uValue=00000000000c083f 'palette0' -palette0: ; 0xc4fbf LB 0xc0 + ; disGetNextSymbol 0xc4fc0 LB 0x2f05 -> off=0x0 cb=00000000000000c0 uValue=00000000000c0840 'palette0' +palette0: ; 0xc4fc0 LB 0xc0 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah @@ -7888,8 +7888,8 @@ palette0: ; 0xc4fbf LB 0xc0 db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh db 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh - ; disGetNextSymbol 0xc507f LB 0x2e43 -> off=0x0 cb=00000000000000c0 uValue=00000000000c08ff 'palette1' -palette1: ; 0xc507f LB 0xc0 + ; disGetNextSymbol 0xc5080 LB 0x2e45 -> off=0x0 cb=00000000000000c0 uValue=00000000000c0900 'palette1' +palette1: ; 0xc5080 LB 0xc0 db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah db 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah, 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah @@ -7902,8 +7902,8 @@ palette1: ; 0xc507f LB 0xc0 db 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh, 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh db 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh - ; disGetNextSymbol 0xc513f LB 0x2d83 -> off=0x0 cb=00000000000000c0 uValue=00000000000c09bf 'palette2' -palette2: ; 0xc513f LB 0xc0 + ; disGetNextSymbol 0xc5140 LB 0x2d85 -> off=0x0 cb=00000000000000c0 uValue=00000000000c09c0 'palette2' +palette2: ; 0xc5140 LB 0xc0 db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah db 000h, 02ah, 02ah, 02ah, 000h, 02ah, 02ah, 02ah, 000h, 000h, 015h, 000h, 000h, 03fh, 000h, 02ah db 015h, 000h, 02ah, 03fh, 02ah, 000h, 015h, 02ah, 000h, 03fh, 02ah, 02ah, 015h, 02ah, 02ah, 03fh @@ -7916,8 +7916,8 @@ palette2: ; 0xc513f LB 0xc0 db 015h, 015h, 000h, 015h, 015h, 02ah, 015h, 03fh, 000h, 015h, 03fh, 02ah, 03fh, 015h, 000h, 03fh db 015h, 02ah, 03fh, 03fh, 000h, 03fh, 03fh, 02ah, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh - ; disGetNextSymbol 0xc51ff LB 0x2cc3 -> off=0x0 cb=0000000000000300 uValue=00000000000c0a7f 'palette3' -palette3: ; 0xc51ff LB 0x300 + ; disGetNextSymbol 0xc5200 LB 0x2cc5 -> off=0x0 cb=0000000000000300 uValue=00000000000c0a80 'palette3' +palette3: ; 0xc5200 LB 0x300 db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh @@ -7966,24 +7966,24 @@ palette3: ; 0xc51ff LB 0x300 db 00bh, 010h, 00bh, 00bh, 010h, 00ch, 00bh, 010h, 00dh, 00bh, 010h, 00fh, 00bh, 010h, 010h, 00bh db 00fh, 010h, 00bh, 00dh, 010h, 00bh, 00ch, 010h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc54ff LB 0x29c3 -> off=0x0 cb=0000000000000010 uValue=00000000000c0d7f 'static_functionality' -static_functionality: ; 0xc54ff LB 0x10 + ; disGetNextSymbol 0xc5500 LB 0x29c5 -> off=0x0 cb=0000000000000010 uValue=00000000000c0d80 'static_functionality' +static_functionality: ; 0xc5500 LB 0x10 db 0ffh, 0e0h, 00fh, 000h, 000h, 000h, 000h, 007h, 002h, 008h, 0e7h, 00ch, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc550f LB 0x29b3 -> off=0x0 cb=0000000000000024 uValue=00000000000c0d8f '_dcc_table' -_dcc_table: ; 0xc550f LB 0x24 + ; disGetNextSymbol 0xc5510 LB 0x29b5 -> off=0x0 cb=0000000000000024 uValue=00000000000c0d90 '_dcc_table' +_dcc_table: ; 0xc5510 LB 0x24 db 010h, 001h, 007h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc5533 LB 0x298f -> off=0x0 cb=000000000000001a uValue=00000000000c0db3 '_secondary_save_area' -_secondary_save_area: ; 0xc5533 LB 0x1a - db 01ah, 000h, 00fh, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h + ; disGetNextSymbol 0xc5534 LB 0x2991 -> off=0x0 cb=000000000000001a uValue=00000000000c0db4 '_secondary_save_area' +_secondary_save_area: ; 0xc5534 LB 0x1a + db 01ah, 000h, 010h, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc554d LB 0x2975 -> off=0x0 cb=000000000000001c uValue=00000000000c0dcd '_video_save_pointer_table' -_video_save_pointer_table: ; 0xc554d LB 0x1c - db 03fh, 048h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - db 033h, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc5569 LB 0x2959 -> off=0x0 cb=0000000000000800 uValue=00000000000c0de9 'vgafont8' -vgafont8: ; 0xc5569 LB 0x800 + ; disGetNextSymbol 0xc554e LB 0x2977 -> off=0x0 cb=000000000000001c uValue=00000000000c0dce '_video_save_pointer_table' +_video_save_pointer_table: ; 0xc554e LB 0x1c + db 040h, 048h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h + db 034h, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h + ; disGetNextSymbol 0xc556a LB 0x295b -> off=0x0 cb=0000000000000800 uValue=00000000000c0dea 'vgafont8' +vgafont8: ; 0xc556a LB 0x800 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07eh, 081h, 0a5h, 081h, 0bdh, 099h, 081h, 07eh db 07eh, 0ffh, 0dbh, 0ffh, 0c3h, 0e7h, 0ffh, 07eh, 06ch, 0feh, 0feh, 0feh, 07ch, 038h, 010h, 000h db 010h, 038h, 07ch, 0feh, 07ch, 038h, 010h, 000h, 038h, 07ch, 038h, 0feh, 0feh, 07ch, 038h, 07ch @@ -8112,8 +8112,8 @@ vgafont8: ; 0xc5569 LB 0x800 db 000h, 000h, 000h, 000h, 018h, 000h, 000h, 000h, 00fh, 00ch, 00ch, 00ch, 0ech, 06ch, 03ch, 01ch db 078h, 06ch, 06ch, 06ch, 06ch, 000h, 000h, 000h, 070h, 018h, 030h, 060h, 078h, 000h, 000h, 000h db 000h, 000h, 03ch, 03ch, 03ch, 03ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc5d69 LB 0x2159 -> off=0x0 cb=0000000000000e00 uValue=00000000000c15e9 'vgafont14' -vgafont14: ; 0xc5d69 LB 0xe00 + ; disGetNextSymbol 0xc5d6a LB 0x215b -> off=0x0 cb=0000000000000e00 uValue=00000000000c15ea 'vgafont14' +vgafont14: ; 0xc5d6a LB 0xe00 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 07eh, 081h, 0a5h, 081h, 081h, 0bdh, 099h, 081h, 07eh, 000h, 000h, 000h, 000h, 000h, 07eh, 0ffh db 0dbh, 0ffh, 0ffh, 0c3h, 0e7h, 0ffh, 07eh, 000h, 000h, 000h, 000h, 000h, 000h, 06ch, 0feh, 0feh @@ -8338,8 +8338,8 @@ vgafont14: ; 0xc5d69 LB 0xe00 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 070h, 0d8h, 030h, 060h, 0c8h, 0f8h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc6b69 LB 0x1359 -> off=0x0 cb=0000000000001000 uValue=00000000000c23e9 'vgafont16' -vgafont16: ; 0xc6b69 LB 0x1000 + ; disGetNextSymbol 0xc6b6a LB 0x135b -> off=0x0 cb=0000000000001000 uValue=00000000000c23ea 'vgafont16' +vgafont16: ; 0xc6b6a LB 0x1000 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 07eh, 081h, 0a5h, 081h, 081h, 0bdh, 099h, 081h, 081h, 07eh, 000h, 000h, 000h, 000h db 000h, 000h, 07eh, 0ffh, 0dbh, 0ffh, 0ffh, 0c3h, 0e7h, 0ffh, 0ffh, 07eh, 000h, 000h, 000h, 000h @@ -8596,8 +8596,8 @@ vgafont16: ; 0xc6b69 LB 0x1000 db 000h, 070h, 0d8h, 030h, 060h, 0c8h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc7b69 LB 0x359 -> off=0x0 cb=000000000000012d uValue=00000000000c33e9 'vgafont14alt' -vgafont14alt: ; 0xc7b69 LB 0x12d + ; disGetNextSymbol 0xc7b6a LB 0x35b -> off=0x0 cb=000000000000012d uValue=00000000000c33ea 'vgafont14alt' +vgafont14alt: ; 0xc7b6a LB 0x12d db 01dh, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h, 022h db 000h, 063h, 063h, 063h, 022h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02bh, 000h db 000h, 000h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 02dh, 000h, 000h @@ -8617,8 +8617,8 @@ vgafont14alt: ; 0xc7b69 LB 0x12d db 000h, 0fch, 066h, 066h, 07ch, 062h, 066h, 06fh, 066h, 066h, 0f3h, 000h, 000h, 000h, 0f1h, 000h db 000h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 000h, 0ffh, 000h, 000h, 000h, 0f6h, 000h, 000h db 018h, 018h, 000h, 000h, 0ffh, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc7c96 LB 0x22c -> off=0x0 cb=0000000000000144 uValue=00000000000c3516 'vgafont16alt' -vgafont16alt: ; 0xc7c96 LB 0x144 + ; disGetNextSymbol 0xc7c97 LB 0x22e -> off=0x0 cb=0000000000000144 uValue=00000000000c3517 'vgafont16alt' +vgafont16alt: ; 0xc7c97 LB 0x144 db 01dh, 000h, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h db 000h, 030h, 000h, 000h, 03ch, 066h, 0c3h, 0c3h, 0dbh, 0dbh, 0c3h, 0c3h, 066h, 03ch, 000h, 000h db 000h, 000h, 04dh, 000h, 000h, 0c3h, 0e7h, 0ffh, 0ffh, 0dbh, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 000h @@ -8640,53 +8640,56 @@ vgafont16alt: ; 0xc7c96 LB 0x144 db 000h, 0abh, 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 060h, 0ceh, 09bh, 006h, 00ch, 01fh db 000h, 000h, 0ach, 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 066h, 0ceh, 096h, 03eh, 006h db 006h, 000h, 000h, 000h - ; disGetNextSymbol 0xc7dda LB 0xe8 -> off=0x0 cb=0000000000000008 uValue=00000000000c365a '_cga_msr' -_cga_msr: ; 0xc7dda LB 0x8 + ; disGetNextSymbol 0xc7ddb LB 0xea -> off=0x0 cb=0000000000000008 uValue=00000000000c365b '_cga_msr' +_cga_msr: ; 0xc7ddb LB 0x8 db 02ch, 028h, 02dh, 029h, 02ah, 02eh, 01eh, 029h - ; disGetNextSymbol 0xc7de2 LB 0xe0 -> off=0x0 cb=0000000000000008 uValue=00000000000c3662 'line_to_vpti_200' -line_to_vpti_200: ; 0xc7de2 LB 0x8 + ; disGetNextSymbol 0xc7de3 LB 0xe2 -> off=0x0 cb=0000000000000008 uValue=00000000000c3663 'line_to_vpti_200' +line_to_vpti_200: ; 0xc7de3 LB 0x8 db 000h, 001h, 002h, 003h, 0ffh, 0ffh, 0ffh, 007h - ; disGetNextSymbol 0xc7dea LB 0xd8 -> off=0x0 cb=0000000000000008 uValue=00000000000c366a 'line_to_vpti_350' -line_to_vpti_350: ; 0xc7dea LB 0x8 + ; disGetNextSymbol 0xc7deb LB 0xda -> off=0x0 cb=0000000000000008 uValue=00000000000c366b 'line_to_vpti_350' +line_to_vpti_350: ; 0xc7deb LB 0x8 db 013h, 014h, 015h, 016h, 0ffh, 0ffh, 0ffh, 007h - ; disGetNextSymbol 0xc7df2 LB 0xd0 -> off=0x0 cb=0000000000000008 uValue=00000000000c3672 'line_to_vpti_400' -line_to_vpti_400: ; 0xc7df2 LB 0x8 + ; disGetNextSymbol 0xc7df3 LB 0xd2 -> off=0x0 cb=0000000000000008 uValue=00000000000c3673 'line_to_vpti_400' +line_to_vpti_400: ; 0xc7df3 LB 0x8 db 017h, 017h, 018h, 018h, 0ffh, 0ffh, 0ffh, 019h - ; disGetNextSymbol 0xc7dfa LB 0xc8 -> off=0x0 cb=0000000000000004 uValue=00000000000c367a 'row_tbl' -row_tbl: ; 0xc7dfa LB 0x4 - dd 02b190e00h - ; disGetNextSymbol 0xc7dfe LB 0xc4 -> off=0x0 cb=0000000000000015 uValue=00000000000c367e '_vbebios_copyright' -_vbebios_copyright: ; 0xc7dfe LB 0x15 + ; disGetNextSymbol 0xc7dfb LB 0xca -> off=0x0 cb=0000000000000005 uValue=00000000000c367b 'row_tbl' +row_tbl: ; 0xc7dfb LB 0x5 + db 000h, 00eh, 019h, 02bh, 000h + ; disGetNextSymbol 0xc7e00 LB 0xc5 -> off=0x0 cb=0000000000000015 uValue=00000000000c3680 '_vbebios_copyright' +_vbebios_copyright: ; 0xc7e00 LB 0x15 db 'VirtualBox VESA BIOS', 000h - ; disGetNextSymbol 0xc7e13 LB 0xaf -> off=0x0 cb=000000000000001d uValue=00000000000c3693 '_vbebios_vendor_name' -_vbebios_vendor_name: ; 0xc7e13 LB 0x1d + ; disGetNextSymbol 0xc7e15 LB 0xb0 -> off=0x0 cb=000000000000001d uValue=00000000000c3695 '_vbebios_vendor_name' +_vbebios_vendor_name: ; 0xc7e15 LB 0x1d db 'Oracle and/or its affiliates', 000h - ; disGetNextSymbol 0xc7e30 LB 0x92 -> off=0x0 cb=000000000000001e uValue=00000000000c36b0 '_vbebios_product_name' -_vbebios_product_name: ; 0xc7e30 LB 0x1e + ; disGetNextSymbol 0xc7e32 LB 0x93 -> off=0x0 cb=000000000000001e uValue=00000000000c36b2 '_vbebios_product_name' +_vbebios_product_name: ; 0xc7e32 LB 0x1e db 'Oracle VirtualBox VBE Adapter', 000h - ; disGetNextSymbol 0xc7e4e LB 0x74 -> off=0x0 cb=0000000000000020 uValue=00000000000c36ce '_vbebios_product_revision' -_vbebios_product_revision: ; 0xc7e4e LB 0x20 - db 'Oracle VirtualBox Version 7.1.8', 000h - ; disGetNextSymbol 0xc7e6e LB 0x54 -> off=0x0 cb=000000000000002b uValue=00000000000c36ee '_vbebios_info_string' -_vbebios_info_string: ; 0xc7e6e LB 0x2b + ; disGetNextSymbol 0xc7e50 LB 0x75 -> off=0x0 cb=0000000000000021 uValue=00000000000c36d0 '_vbebios_product_revision' +_vbebios_product_revision: ; 0xc7e50 LB 0x21 + db 'Oracle VirtualBox Version 7.1.10', 000h + ; disGetNextSymbol 0xc7e71 LB 0x54 -> off=0x0 cb=000000000000002b uValue=00000000000c36f1 '_vbebios_info_string' +_vbebios_info_string: ; 0xc7e71 LB 0x2b db 'VirtualBox VBE Display Adapter enabled', 00dh, 00ah, 00dh, 00ah, 000h - ; disGetNextSymbol 0xc7e99 LB 0x29 -> off=0x0 cb=0000000000000029 uValue=00000000000c3719 '_no_vbebios_info_string' -_no_vbebios_info_string: ; 0xc7e99 LB 0x29 + ; disGetNextSymbol 0xc7e9c LB 0x29 -> off=0x0 cb=0000000000000029 uValue=00000000000c371c '_no_vbebios_info_string' +_no_vbebios_info_string: ; 0xc7e9c LB 0x29 db 'No VirtualBox VBE support available!', 00dh, 00ah, 00dh, 00ah, 000h -section CONST progbits vstart=0x7ec2 align=1 ; size=0x0 class=DATA group=DGROUP + ; Padding 0x1 bytes at 0xc7ec5 + db 001h -section CONST2 progbits vstart=0x7ec2 align=1 ; size=0x0 class=DATA group=DGROUP +section CONST progbits vstart=0x7ec6 align=1 ; size=0x0 class=DATA group=DGROUP - ; Padding 0x13e bytes at 0xc7ec2 - db 001h, 000h, 000h, 000h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 02fh, 068h, 06fh, 06dh - db 065h, 02fh, 067h, 061h, 06ch, 069h, 074h, 073h, 079h, 06eh, 02fh, 063h, 06fh, 06dh, 070h, 069h - db 06ch, 065h, 02dh, 063h, 061h, 063h, 068h, 065h, 02fh, 076h, 062h, 06fh, 078h, 02fh, 062h, 072h - db 061h, 06eh, 063h, 068h, 065h, 073h, 02fh, 056h, 042h, 06fh, 078h, 02dh, 037h, 02eh, 031h, 02fh - db 06fh, 075h, 074h, 02fh, 06ch, 069h, 06eh, 075h, 078h, 02eh, 061h, 06dh, 064h, 036h, 034h, 02fh - db 072h, 065h, 06ch, 065h, 061h, 073h, 065h, 02fh, 06fh, 062h, 06ah, 02fh, 056h, 042h, 06fh, 078h - db 056h, 067h, 061h, 042h, 069h, 06fh, 073h, 033h, 038h, 036h, 02fh, 056h, 042h, 06fh, 078h, 056h - db 067h, 061h, 042h, 069h, 06fh, 073h, 033h, 038h, 036h, 02eh, 073h, 079h, 06dh, 000h, 000h, 000h +section CONST2 progbits vstart=0x7ec6 align=1 ; size=0x0 class=DATA group=DGROUP + + ; Padding 0x13a bytes at 0xc7ec6 + db 000h, 000h, 000h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 02fh, 068h, 06fh, 06dh, 065h + db 02fh, 067h, 061h, 06ch, 069h, 074h, 073h, 079h, 06eh, 02fh, 063h, 06fh, 06dh, 070h, 069h, 06ch + db 065h, 02dh, 063h, 061h, 063h, 068h, 065h, 02fh, 076h, 062h, 06fh, 078h, 02fh, 062h, 072h, 061h + db 06eh, 063h, 068h, 065h, 073h, 02fh, 056h, 042h, 06fh, 078h, 02dh, 037h, 02eh, 031h, 02fh, 06fh + db 075h, 074h, 02fh, 06ch, 069h, 06eh, 075h, 078h, 02eh, 061h, 06dh, 064h, 036h, 034h, 02fh, 072h + db 065h, 06ch, 065h, 061h, 073h, 065h, 02fh, 06fh, 062h, 06ah, 02fh, 056h, 042h, 06fh, 078h, 056h + db 067h, 061h, 042h, 069h, 06fh, 073h, 033h, 038h, 036h, 02fh, 056h, 042h, 06fh, 078h, 056h, 067h + db 061h, 042h, 069h, 06fh, 073h, 033h, 038h, 036h, 02eh, 073h, 079h, 06dh, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h @@ -8698,4 +8701,4 @@ section CONST2 progbits vstart=0x7ec2 align=1 ; size=0x0 class=DATA group=DGROUP db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 019h + db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 057h diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative386.md5sum b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative386.md5sum index 2ee6222e..7876f090 100644 --- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative386.md5sum +++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative386.md5sum @@ -1 +1 @@ -ec45a9e8132927ccc79fa6a7e43bf94f *VBoxVgaBios386.rom +f636d11bd1695ad6388b853545e0677d *VBoxVgaBios386.rom diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative8086.asm b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative8086.asm index 6168055f..6bd1391d 100644 --- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative8086.asm +++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative8086.asm @@ -1580,7 +1580,7 @@ init_bios_area: ; 0xc0a28 LB 0x3e mov word [es:bx+00087h], 0f960h ; 26 c7 87 87 00 60 f9 ; 0xc0a45 vgabios.c:234 mov byte [es:bx+00089h], 051h ; 26 c6 87 89 00 51 ; 0xc0a4c vgabios.c:238 mov byte [es:bx+065h], 009h ; 26 c6 47 65 09 ; 0xc0a52 vgabios.c:240 - mov word [es:bx+000a8h], 0554dh ; 26 c7 87 a8 00 4d 55 ; 0xc0a57 vgabios.c:242 + mov word [es:bx+000a8h], 0554eh ; 26 c7 87 a8 00 4e 55 ; 0xc0a57 vgabios.c:242 mov [es:bx+000aah], ds ; 26 8c 9f aa 00 ; 0xc0a5e pop bp ; 5d ; 0xc0a63 vgabios.c:243 pop bx ; 5b ; 0xc0a64 @@ -2093,7 +2093,7 @@ vga_read_char_attr: ; 0xc0ded LB 0x147 xor bh, bh ; 30 ff ; 0xc0e5c mov CL, strict byte 003h ; b1 03 ; 0xc0e5e sal bx, CL ; d3 e3 ; 0xc0e60 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc0e62 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc0e62 jne short 00e9fh ; 75 36 ; 0xc0e67 mov ax, di ; 89 f8 ; 0xc0e69 vgabios.c:559 mul dx ; f7 e2 ; 0xc0e6b @@ -2113,13 +2113,13 @@ vga_read_char_attr: ; 0xc0ded LB 0x147 sal ax, 1 ; d1 e0 ; 0xc0e89 mov di, word [bp-010h] ; 8b 7e f0 ; 0xc0e8b add di, ax ; 01 c7 ; 0xc0e8e - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc0e90 vgabios.c:55 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc0e90 vgabios.c:55 mov ax, word [es:di] ; 26 8b 05 ; 0xc0e94 push SS ; 16 ; 0xc0e97 vgabios.c:58 pop ES ; 07 ; 0xc0e98 mov word [es:si], ax ; 26 89 04 ; 0xc0e99 jmp near 00f2bh ; e9 8c 00 ; 0xc0e9c vgabios.c:561 - mov bl, byte [bx+047adh] ; 8a 9f ad 47 ; 0xc0e9f vgabios.c:562 + mov bl, byte [bx+047aeh] ; 8a 9f ae 47 ; 0xc0e9f vgabios.c:562 cmp bl, 005h ; 80 fb 05 ; 0xc0ea3 je short 00efeh ; 74 56 ; 0xc0ea6 cmp bl, 002h ; 80 fb 02 ; 0xc0ea8 @@ -2227,18 +2227,18 @@ vga_get_font_info: ; 0xc0f44 LB 0x83 retn 00002h ; c2 02 00 ; 0xc0f9d mov bx, 0010ch ; bb 0c 01 ; 0xc0fa0 vgabios.c:67 jmp short 00f5eh ; eb b9 ; 0xc0fa3 - mov dx, 05d69h ; ba 69 5d ; 0xc0fa5 vgabios.c:601 + mov dx, 05d6ah ; ba 6a 5d ; 0xc0fa5 vgabios.c:601 mov ax, ds ; 8c d8 ; 0xc0fa8 jmp short 00f69h ; eb bd ; 0xc0faa vgabios.c:602 - mov dx, 05569h ; ba 69 55 ; 0xc0fac vgabios.c:604 + mov dx, 0556ah ; ba 6a 55 ; 0xc0fac vgabios.c:604 jmp short 00fa8h ; eb f7 ; 0xc0faf - mov dx, 05969h ; ba 69 59 ; 0xc0fb1 vgabios.c:607 + mov dx, 0596ah ; ba 6a 59 ; 0xc0fb1 vgabios.c:607 jmp short 00fa8h ; eb f2 ; 0xc0fb4 - mov dx, 07b69h ; ba 69 7b ; 0xc0fb6 vgabios.c:610 + mov dx, 07b6ah ; ba 6a 7b ; 0xc0fb6 vgabios.c:610 jmp short 00fa8h ; eb ed ; 0xc0fb9 - mov dx, 06b69h ; ba 69 6b ; 0xc0fbb vgabios.c:613 + mov dx, 06b6ah ; ba 6a 6b ; 0xc0fbb vgabios.c:613 jmp short 00fa8h ; eb e8 ; 0xc0fbe - mov dx, 07c96h ; ba 96 7c ; 0xc0fc0 vgabios.c:616 + mov dx, 07c97h ; ba 97 7c ; 0xc0fc0 vgabios.c:616 jmp short 00fa8h ; eb e3 ; 0xc0fc3 jmp short 00f9ah ; eb d3 ; 0xc0fc5 vgabios.c:622 ; disGetNextSymbol 0xc0fc7 LB 0x359d -> off=0x0 cb=000000000000016d uValue=00000000000c0fc7 'vga_read_pixel' @@ -2265,10 +2265,10 @@ vga_read_pixel: ; 0xc0fc7 LB 0x16d xor bh, bh ; 30 ff ; 0xc0ff3 mov CL, strict byte 003h ; b1 03 ; 0xc0ff5 sal bx, CL ; d3 e3 ; 0xc0ff7 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc0ff9 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc0ff9 jne short 01003h ; 75 03 ; 0xc0ffe jmp near 0112dh ; e9 2a 01 ; 0xc1000 vgabios.c:646 - mov ch, byte [bx+047adh] ; 8a af ad 47 ; 0xc1003 vgabios.c:649 + mov ch, byte [bx+047aeh] ; 8a af ae 47 ; 0xc1003 vgabios.c:649 cmp ch, cl ; 38 cd ; 0xc1007 jc short 0101ah ; 72 0f ; 0xc1009 jbe short 01022h ; 76 15 ; 0xc100b @@ -2324,7 +2324,7 @@ vga_read_pixel: ; 0xc0fc7 LB 0x16d inc byte [bp-008h] ; fe 46 f8 ; 0xc1087 vgabios.c:661 jmp short 0105eh ; eb d2 ; 0xc108a jmp near 01125h ; e9 96 00 ; 0xc108c - mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc108f vgabios.c:664 + mov al, byte [bx+047afh] ; 8a 87 af 47 ; 0xc108f vgabios.c:664 xor ah, ah ; 30 e4 ; 0xc1093 mov cx, strict word 00004h ; b9 04 00 ; 0xc1095 sub cx, ax ; 29 c1 ; 0xc1098 @@ -2347,7 +2347,7 @@ vga_read_pixel: ; 0xc0fc7 LB 0x16d xor bh, bh ; 30 ff ; 0xc10c2 mov CL, strict byte 003h ; b1 03 ; 0xc10c4 sal bx, CL ; d3 e3 ; 0xc10c6 - cmp byte [bx+047aeh], 002h ; 80 bf ae 47 02 ; 0xc10c8 + cmp byte [bx+047afh], 002h ; 80 bf af 47 02 ; 0xc10c8 jne short 010eah ; 75 1b ; 0xc10cd mov cx, si ; 89 f1 ; 0xc10cf vgabios.c:669 xor ch, ch ; 30 ed ; 0xc10d1 @@ -2717,7 +2717,7 @@ biosfn_set_active_page: ; 0xc135c LB 0xd5 mov CL, strict byte 003h ; b1 03 ; 0xc1399 mov si, bx ; 89 de ; 0xc139b sal si, CL ; d3 e6 ; 0xc139d - cmp byte [si+047ach], 000h ; 80 bc ac 47 00 ; 0xc139f + cmp byte [si+047adh], 000h ; 80 bc ad 47 00 ; 0xc139f jne short 013e1h ; 75 3b ; 0xc13a4 mov bx, strict word 0004ah ; bb 4a 00 ; 0xc13a6 vgabios.c:57 mov ax, strict word 00040h ; b8 40 00 ; 0xc13a9 @@ -2744,12 +2744,12 @@ biosfn_set_active_page: ; 0xc135c LB 0xd5 lea ax, [di+001h] ; 8d 45 01 ; 0xc13da mul bx ; f7 e3 ; 0xc13dd jmp short 013f2h ; eb 11 ; 0xc13df vgabios.c:860 - mov bl, byte [bx+0482bh] ; 8a 9f 2b 48 ; 0xc13e1 vgabios.c:862 + mov bl, byte [bx+0482ch] ; 8a 9f 2c 48 ; 0xc13e1 vgabios.c:862 mov CL, strict byte 006h ; b1 06 ; 0xc13e5 sal bx, CL ; d3 e3 ; 0xc13e7 mov al, byte [bp-00ch] ; 8a 46 f4 ; 0xc13e9 xor ah, ah ; 30 e4 ; 0xc13ec - mul word [bx+04842h] ; f7 a7 42 48 ; 0xc13ee + mul word [bx+04843h] ; f7 a7 43 48 ; 0xc13ee mov cx, ax ; 89 c1 ; 0xc13f2 mov bx, strict word 00063h ; bb 63 00 ; 0xc13f4 vgabios.c:57 mov ax, strict word 00040h ; b8 40 00 ; 0xc13f7 @@ -2794,7 +2794,7 @@ find_vpti: ; 0xc1431 LB 0x48 mov CL, strict byte 003h ; b1 03 ; 0xc143b mov si, bx ; 89 de ; 0xc143d sal si, CL ; d3 e6 ; 0xc143f - cmp byte [si+047ach], 000h ; 80 bc ac 47 00 ; 0xc1441 + cmp byte [si+047adh], 000h ; 80 bc ad 47 00 ; 0xc1441 jne short 0146eh ; 75 26 ; 0xc1446 mov si, 00089h ; be 89 00 ; 0xc1448 vgabios.c:47 mov ax, strict word 00040h ; b8 40 00 ; 0xc144b @@ -2802,16 +2802,16 @@ find_vpti: ; 0xc1431 LB 0x48 mov al, byte [es:si] ; 26 8a 04 ; 0xc1450 test AL, strict byte 010h ; a8 10 ; 0xc1453 vgabios.c:923 je short 0145dh ; 74 06 ; 0xc1455 - mov al, byte [bx+07df2h] ; 8a 87 f2 7d ; 0xc1457 vgabios.c:924 + mov al, byte [bx+07df3h] ; 8a 87 f3 7d ; 0xc1457 vgabios.c:924 jmp short 0146bh ; eb 0e ; 0xc145b vgabios.c:925 test AL, strict byte 080h ; a8 80 ; 0xc145d je short 01467h ; 74 06 ; 0xc145f - mov al, byte [bx+07de2h] ; 8a 87 e2 7d ; 0xc1461 vgabios.c:926 + mov al, byte [bx+07de3h] ; 8a 87 e3 7d ; 0xc1461 vgabios.c:926 jmp short 0146bh ; eb 04 ; 0xc1465 vgabios.c:927 - mov al, byte [bx+07deah] ; 8a 87 ea 7d ; 0xc1467 vgabios.c:928 + mov al, byte [bx+07debh] ; 8a 87 eb 7d ; 0xc1467 vgabios.c:928 cbw ; 98 ; 0xc146b jmp short 01474h ; eb 06 ; 0xc146c vgabios.c:929 - mov al, byte [bx+0482bh] ; 8a 87 2b 48 ; 0xc146e vgabios.c:930 + mov al, byte [bx+0482ch] ; 8a 87 2c 48 ; 0xc146e vgabios.c:930 xor ah, ah ; 30 e4 ; 0xc1472 pop bp ; 5d ; 0xc1474 vgabios.c:933 pop si ; 5e ; 0xc1475 @@ -2876,13 +2876,13 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 mov CL, strict byte 003h ; b1 03 ; 0xc14f6 vgabios.c:999 mov bx, dx ; 89 d3 ; 0xc14f8 sal bx, CL ; d3 e3 ; 0xc14fa - mov al, byte [bx+047b1h] ; 8a 87 b1 47 ; 0xc14fc + mov al, byte [bx+047b2h] ; 8a 87 b2 47 ; 0xc14fc mov dx, 003c6h ; ba c6 03 ; 0xc1500 out DX, AL ; ee ; 0xc1503 xor al, al ; 30 c0 ; 0xc1504 vgabios.c:1002 mov dx, 003c8h ; ba c8 03 ; 0xc1506 out DX, AL ; ee ; 0xc1509 - mov bl, byte [bx+047b2h] ; 8a 9f b2 47 ; 0xc150a vgabios.c:1005 + mov bl, byte [bx+047b3h] ; 8a 9f b3 47 ; 0xc150a vgabios.c:1005 cmp bl, 001h ; 80 fb 01 ; 0xc150e jc short 01523h ; 72 10 ; 0xc1511 jbe short 0152eh ; 76 19 ; 0xc1513 @@ -2894,24 +2894,24 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 jmp near 01953h ; e9 30 04 ; 0xc1520 test bl, bl ; 84 db ; 0xc1523 jne short 01544h ; 75 1d ; 0xc1525 - mov word [bp-016h], 04fbfh ; c7 46 ea bf 4f ; 0xc1527 vgabios.c:1007 + mov word [bp-016h], 04fc0h ; c7 46 ea c0 4f ; 0xc1527 vgabios.c:1007 jmp short 01544h ; eb 16 ; 0xc152c vgabios.c:1008 - mov word [bp-016h], 0507fh ; c7 46 ea 7f 50 ; 0xc152e vgabios.c:1010 + mov word [bp-016h], 05080h ; c7 46 ea 80 50 ; 0xc152e vgabios.c:1010 jmp short 01544h ; eb 0f ; 0xc1533 vgabios.c:1011 - mov word [bp-016h], 0513fh ; c7 46 ea 3f 51 ; 0xc1535 vgabios.c:1013 + mov word [bp-016h], 05140h ; c7 46 ea 40 51 ; 0xc1535 vgabios.c:1013 jmp short 01544h ; eb 08 ; 0xc153a vgabios.c:1014 jmp near 015b8h ; e9 79 00 ; 0xc153c - mov word [bp-016h], 051ffh ; c7 46 ea ff 51 ; 0xc153f vgabios.c:1016 + mov word [bp-016h], 05200h ; c7 46 ea 00 52 ; 0xc153f vgabios.c:1016 mov bl, byte [bp-010h] ; 8a 5e f0 ; 0xc1544 vgabios.c:1020 xor bh, bh ; 30 ff ; 0xc1547 mov CL, strict byte 003h ; b1 03 ; 0xc1549 sal bx, CL ; d3 e3 ; 0xc154b - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc154d + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc154d jne short 01563h ; 75 0f ; 0xc1552 mov es, [bp-01ah] ; 8e 46 e6 ; 0xc1554 vgabios.c:1022 cmp byte [es:si+002h], 008h ; 26 80 7c 02 08 ; 0xc1557 jne short 01563h ; 75 05 ; 0xc155c - mov word [bp-016h], 0507fh ; c7 46 ea 7f 50 ; 0xc155e vgabios.c:1023 + mov word [bp-016h], 05080h ; c7 46 ea 80 50 ; 0xc155e vgabios.c:1023 xor bx, bx ; 31 db ; 0xc1563 vgabios.c:1026 jmp short 01576h ; eb 0f ; 0xc1565 xor al, al ; 30 c0 ; 0xc1567 vgabios.c:1033 @@ -2927,9 +2927,9 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 mov CL, strict byte 003h ; b1 03 ; 0xc157b mov di, ax ; 89 c7 ; 0xc157d sal di, CL ; d3 e7 ; 0xc157f - mov al, byte [di+047b2h] ; 8a 85 b2 47 ; 0xc1581 + mov al, byte [di+047b3h] ; 8a 85 b3 47 ; 0xc1581 mov di, ax ; 89 c7 ; 0xc1585 - mov al, byte [di+0483bh] ; 8a 85 3b 48 ; 0xc1587 + mov al, byte [di+0483ch] ; 8a 85 3c 48 ; 0xc1587 cmp bx, ax ; 39 c3 ; 0xc158b jnbe short 01567h ; 77 d8 ; 0xc158d mov ax, bx ; 89 d8 ; 0xc158f @@ -3043,7 +3043,7 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 xor bh, bh ; 30 ff ; 0xc1686 mov CL, strict byte 003h ; b1 03 ; 0xc1688 sal bx, CL ; d3 e3 ; 0xc168a - cmp byte [bx+047adh], 001h ; 80 bf ad 47 01 ; 0xc168c + cmp byte [bx+047aeh], 001h ; 80 bf ae 47 01 ; 0xc168c jne short 01698h ; 75 05 ; 0xc1691 mov bx, 003b4h ; bb b4 03 ; 0xc1693 jmp short 0169bh ; eb 03 ; 0xc1696 @@ -3085,9 +3085,9 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 xor bh, bh ; 30 ff ; 0xc16e6 mov CL, strict byte 003h ; b1 03 ; 0xc16e8 sal bx, CL ; d3 e3 ; 0xc16ea - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc16ec + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc16ec jne short 01705h ; 75 12 ; 0xc16f1 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc16f3 vgabios.c:1102 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc16f3 vgabios.c:1102 mov cx, 04000h ; b9 00 40 ; 0xc16f7 mov ax, 00720h ; b8 20 07 ; 0xc16fa xor di, di ; 31 ff ; 0xc16fd @@ -3096,7 +3096,7 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 jmp short 01741h ; eb 3c ; 0xc1703 vgabios.c:1104 cmp byte [bp-00ch], 00dh ; 80 7e f4 0d ; 0xc1705 vgabios.c:1106 jnc short 0171ch ; 73 11 ; 0xc1709 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc170b vgabios.c:1108 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc170b vgabios.c:1108 mov cx, 04000h ; b9 00 40 ; 0xc170f xor ax, ax ; 31 c0 ; 0xc1712 xor di, di ; 31 ff ; 0xc1714 @@ -3113,7 +3113,7 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 mov word [bp-022h], ax ; 89 46 de ; 0xc1728 mov AL, strict byte 00fh ; b0 0f ; 0xc172b vgabios.c:1114 out DX, AL ; ee ; 0xc172d - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc172e vgabios.c:1115 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc172e vgabios.c:1115 mov cx, 08000h ; b9 00 80 ; 0xc1732 xor ax, ax ; 31 c0 ; 0xc1735 xor di, di ; 31 ff ; 0xc1737 @@ -3165,7 +3165,7 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 jnbe short 017e1h ; 77 27 ; 0xc17b8 mov bl, al ; 88 c3 ; 0xc17ba vgabios.c:1136 xor bh, bh ; 30 ff ; 0xc17bc - mov al, byte [bx+07ddah] ; 8a 87 da 7d ; 0xc17be vgabios.c:50 + mov al, byte [bx+07ddbh] ; 8a 87 db 7d ; 0xc17be vgabios.c:50 mov bx, strict word 00065h ; bb 65 00 ; 0xc17c2 vgabios.c:52 mov byte [es:bx], al ; 26 88 07 ; 0xc17c5 cmp byte [bp-00ch], 006h ; 80 7e f4 06 ; 0xc17c8 vgabios.c:1137 @@ -3181,7 +3181,7 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 xor bh, bh ; 30 ff ; 0xc17e4 mov CL, strict byte 003h ; b1 03 ; 0xc17e6 sal bx, CL ; d3 e3 ; 0xc17e8 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc17ea + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc17ea jne short 017fah ; 75 09 ; 0xc17ef mov dx, strict word 00007h ; ba 07 00 ; 0xc17f1 vgabios.c:1143 mov ax, strict word 00006h ; b8 06 00 ; 0xc17f4 @@ -3202,7 +3202,7 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 xor bh, bh ; 30 ff ; 0xc1817 mov CL, strict byte 003h ; b1 03 ; 0xc1819 sal bx, CL ; d3 e3 ; 0xc181b - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc181d + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc181d jne short 01892h ; 75 6e ; 0xc1822 les bx, [bp-014h] ; c4 5e ec ; 0xc1824 vgabios.c:1157 mov bx, word [es:bx+008h] ; 26 8b 5f 08 ; 0xc1827 @@ -3224,7 +3224,7 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 push ax ; 50 ; 0xc1855 push ax ; 50 ; 0xc1856 mov cx, 00100h ; b9 00 01 ; 0xc1857 - mov bx, 05569h ; bb 69 55 ; 0xc185a + mov bx, 0556ah ; bb 6a 55 ; 0xc185a mov dx, 0c000h ; ba 00 c0 ; 0xc185d call 02e8ch ; e8 29 16 ; 0xc1860 jmp short 018bah ; eb 55 ; 0xc1863 vgabios.c:1162 @@ -3236,14 +3236,14 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 xor al, al ; 30 c0 ; 0xc186d push ax ; 50 ; 0xc186f mov cx, 00100h ; b9 00 01 ; 0xc1870 - mov bx, 05d69h ; bb 69 5d ; 0xc1873 + mov bx, 05d6ah ; bb 6a 5d ; 0xc1873 mov dx, 0c000h ; ba 00 c0 ; 0xc1876 call 02e8ch ; e8 10 16 ; 0xc1879 cmp byte [bp-00ch], 007h ; 80 7e f4 07 ; 0xc187c vgabios.c:1165 jne short 018bah ; 75 38 ; 0xc1880 mov cx, strict word 0000eh ; b9 0e 00 ; 0xc1882 vgabios.c:1166 xor bx, bx ; 31 db ; 0xc1885 - mov dx, 07b69h ; ba 69 7b ; 0xc1887 + mov dx, 07b6ah ; ba 6a 7b ; 0xc1887 mov ax, 0c000h ; b8 00 c0 ; 0xc188a call 02e14h ; e8 84 15 ; 0xc188d jmp short 018bah ; eb 28 ; 0xc1890 vgabios.c:1167 @@ -3256,12 +3256,12 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 xor al, al ; 30 c0 ; 0xc189d push ax ; 50 ; 0xc189f mov cx, 00100h ; b9 00 01 ; 0xc18a0 - mov bx, 06b69h ; bb 69 6b ; 0xc18a3 + mov bx, 06b6ah ; bb 6a 6b ; 0xc18a3 mov dx, 0c000h ; ba 00 c0 ; 0xc18a6 call 02e8ch ; e8 e0 15 ; 0xc18a9 mov cx, strict word 00010h ; b9 10 00 ; 0xc18ac vgabios.c:1170 xor bx, bx ; 31 db ; 0xc18af - mov dx, 07c96h ; ba 96 7c ; 0xc18b1 + mov dx, 07c97h ; ba 97 7c ; 0xc18b1 mov ax, 0c000h ; b8 00 c0 ; 0xc18b4 call 02e14h ; e8 5a 15 ; 0xc18b7 cmp word [bp-01ch], strict byte 00000h ; 83 7e e4 00 ; 0xc18ba vgabios.c:1172 @@ -3300,7 +3300,7 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 mov AL, strict byte 003h ; b0 03 ; 0xc1915 mov AH, strict byte 011h ; b4 11 ; 0xc1917 int 06dh ; cd 6d ; 0xc1919 - mov bx, 05969h ; bb 69 59 ; 0xc191b vgabios.c:1199 + mov bx, 0596ah ; bb 6a 59 ; 0xc191b vgabios.c:1199 mov cx, ds ; 8c d9 ; 0xc191e mov ax, strict word 0001fh ; b8 1f 00 ; 0xc1920 call 009f0h ; e8 ca f0 ; 0xc1923 @@ -3312,14 +3312,14 @@ biosfn_set_video_mode: ; 0xc1479 LB 0x4e4 je short 01949h ; 74 12 ; 0xc1935 cmp dl, 008h ; 80 fa 08 ; 0xc1937 jne short 01953h ; 75 17 ; 0xc193a - mov bx, 05569h ; bb 69 55 ; 0xc193c vgabios.c:1203 + mov bx, 0556ah ; bb 6a 55 ; 0xc193c vgabios.c:1203 mov cx, ds ; 8c d9 ; 0xc193f mov ax, strict word 00043h ; b8 43 00 ; 0xc1941 call 009f0h ; e8 a9 f0 ; 0xc1944 jmp short 01953h ; eb 0a ; 0xc1947 vgabios.c:1204 - mov bx, 05d69h ; bb 69 5d ; 0xc1949 vgabios.c:1206 + mov bx, 05d6ah ; bb 6a 5d ; 0xc1949 vgabios.c:1206 jmp short 0193fh ; eb f1 ; 0xc194c - mov bx, 06b69h ; bb 69 6b ; 0xc194e vgabios.c:1209 + mov bx, 06b6ah ; bb 6a 6b ; 0xc194e vgabios.c:1209 jmp short 0193fh ; eb ec ; 0xc1951 lea sp, [bp-00ah] ; 8d 66 f6 ; 0xc1953 vgabios.c:1212 pop di ; 5f ; 0xc1956 @@ -3800,7 +3800,7 @@ biosfn_scroll: ; 0xc1c9f LB 0x6a3 mov ax, word [bp-018h] ; 8b 46 e8 ; 0xc1d58 mul word [bp-024h] ; f7 66 dc ; 0xc1d5b mov di, ax ; 89 c7 ; 0xc1d5e - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc1d60 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc1d60 jne short 01db1h ; 75 4a ; 0xc1d65 sal ax, 1 ; d1 e0 ; 0xc1d67 vgabios.c:1345 or AL, strict byte 0ffh ; 0c ff ; 0xc1d69 @@ -3825,7 +3825,7 @@ biosfn_scroll: ; 0xc1c9f LB 0x6a3 mov ah, byte [bp-010h] ; 8a 66 f0 ; 0xc1d99 vgabios.c:1352 xor al, ch ; 30 e8 ; 0xc1d9c add ax, strict word 00020h ; 05 20 00 ; 0xc1d9e - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc1da1 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc1da1 mov cx, di ; 89 f9 ; 0xc1da5 mov di, word [bp-01ch] ; 8b 7e e4 ; 0xc1da7 jcxz 01daeh ; e3 02 ; 0xc1daa @@ -3868,7 +3868,7 @@ biosfn_scroll: ; 0xc1c9f LB 0x6a3 xor bh, bh ; 30 ff ; 0xc1e0a mov CL, strict byte 003h ; b1 03 ; 0xc1e0c sal bx, CL ; d3 e3 ; 0xc1e0e - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc1e10 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc1e10 mov cx, word [bp-01ah] ; 8b 4e e6 ; 0xc1e14 mov ax, si ; 89 f0 ; 0xc1e17 jcxz 01e1dh ; e3 02 ; 0xc1e19 @@ -3890,7 +3890,7 @@ biosfn_scroll: ; 0xc1c9f LB 0x6a3 xor bh, bh ; 30 ff ; 0xc1e44 mov CL, strict byte 003h ; b1 03 ; 0xc1e46 sal bx, CL ; d3 e3 ; 0xc1e48 - mov bx, word [bx+047afh] ; 8b 9f af 47 ; 0xc1e4a + mov bx, word [bx+047b0h] ; 8b 9f b0 47 ; 0xc1e4a mov ax, word [bp-016h] ; 8b 46 ea ; 0xc1e4e mul word [bp-018h] ; f7 66 e8 ; 0xc1e51 add ax, word [bp-01ah] ; 03 46 e6 ; 0xc1e54 @@ -3942,7 +3942,7 @@ biosfn_scroll: ; 0xc1c9f LB 0x6a3 mov CL, strict byte 003h ; b1 03 ; 0xc1ec3 mov di, ax ; 89 c7 ; 0xc1ec5 sal di, CL ; d3 e7 ; 0xc1ec7 - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc1ec9 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc1ec9 mov cx, bx ; 89 d9 ; 0xc1ecd mov ax, si ; 89 f0 ; 0xc1ecf mov di, dx ; 89 d7 ; 0xc1ed1 @@ -3968,7 +3968,7 @@ biosfn_scroll: ; 0xc1c9f LB 0x6a3 xor bh, bh ; 30 ff ; 0xc1f05 mov CL, strict byte 003h ; b1 03 ; 0xc1f07 sal bx, CL ; d3 e3 ; 0xc1f09 - mov bx, word [bx+047afh] ; 8b 9f af 47 ; 0xc1f0b + mov bx, word [bx+047b0h] ; 8b 9f b0 47 ; 0xc1f0b mov ax, word [bp-016h] ; 8b 46 ea ; 0xc1f0f mul word [bp-018h] ; f7 66 e8 ; 0xc1f12 add ax, word [bp-014h] ; 03 46 ec ; 0xc1f15 @@ -3990,14 +3990,14 @@ biosfn_scroll: ; 0xc1c9f LB 0x6a3 dec word [bp-016h] ; ff 4e ea ; 0xc1f38 vgabios.c:1373 jmp near 01e7bh ; e9 3d ff ; 0xc1f3b mov si, word [bp-01eh] ; 8b 76 e2 ; 0xc1f3e vgabios.c:1379 - mov al, byte [si+0482bh] ; 8a 84 2b 48 ; 0xc1f41 + mov al, byte [si+0482ch] ; 8a 84 2c 48 ; 0xc1f41 xor ah, ah ; 30 e4 ; 0xc1f45 mov CL, strict byte 006h ; b1 06 ; 0xc1f47 mov si, ax ; 89 c6 ; 0xc1f49 sal si, CL ; d3 e6 ; 0xc1f4b - mov al, byte [si+04841h] ; 8a 84 41 48 ; 0xc1f4d + mov al, byte [si+04842h] ; 8a 84 42 48 ; 0xc1f4d mov byte [bp-00eh], al ; 88 46 f2 ; 0xc1f51 - mov al, byte [bx+047adh] ; 8a 87 ad 47 ; 0xc1f54 vgabios.c:1380 + mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc1f54 vgabios.c:1380 cmp AL, strict byte 003h ; 3c 03 ; 0xc1f58 jc short 01f68h ; 72 0c ; 0xc1f5a jbe short 01f6fh ; 76 11 ; 0xc1f5c @@ -4045,7 +4045,7 @@ biosfn_scroll: ; 0xc1c9f LB 0x6a3 xor bh, bh ; 30 ff ; 0xc1fc0 mov CL, strict byte 003h ; b1 03 ; 0xc1fc2 sal bx, CL ; d3 e3 ; 0xc1fc4 - mov bx, word [bx+047afh] ; 8b 9f af 47 ; 0xc1fc6 + mov bx, word [bx+047b0h] ; 8b 9f b0 47 ; 0xc1fc6 mov cx, dx ; 89 d1 ; 0xc1fca xor di, di ; 31 ff ; 0xc1fcc mov es, bx ; 8e c3 ; 0xc1fce @@ -4151,7 +4151,7 @@ biosfn_scroll: ; 0xc1c9f LB 0x6a3 jc short 02112h ; 72 4e ; 0xc20c2 dec word [bp-016h] ; ff 4e ea ; 0xc20c4 vgabios.c:1409 jmp short 02057h ; eb 8e ; 0xc20c7 - mov cl, byte [bx+047aeh] ; 8a 8f ae 47 ; 0xc20c9 vgabios.c:1414 + mov cl, byte [bx+047afh] ; 8a 8f af 47 ; 0xc20c9 vgabios.c:1414 cmp byte [bp-006h], 000h ; 80 7e fa 00 ; 0xc20cd vgabios.c:1415 jne short 02115h ; 75 42 ; 0xc20d1 cmp byte [bp-00ch], 000h ; 80 7e f4 00 ; 0xc20d3 @@ -4173,7 +4173,7 @@ biosfn_scroll: ; 0xc1c9f LB 0x6a3 mul dx ; f7 e2 ; 0xc20fb mov dl, byte [bp-010h] ; 8a 56 f0 ; 0xc20fd xor dh, dh ; 30 f6 ; 0xc2100 - mov bx, word [bx+047afh] ; 8b 9f af 47 ; 0xc2102 + mov bx, word [bx+047b0h] ; 8b 9f b0 47 ; 0xc2102 mov cx, ax ; 89 c1 ; 0xc2106 mov ax, dx ; 89 d0 ; 0xc2108 xor di, di ; 31 ff ; 0xc210a @@ -4307,7 +4307,7 @@ biosfn_scroll: ; 0xc1c9f LB 0x6a3 mov cx, ax ; 89 c1 ; 0xc224b mov al, byte [bp-010h] ; 8a 46 f0 ; 0xc224d xor ah, ah ; 30 e4 ; 0xc2250 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc2252 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc2252 xor di, di ; 31 ff ; 0xc2256 jcxz 0225ch ; e3 02 ; 0xc2258 rep stosb ; f3 aa ; 0xc225a @@ -4532,7 +4532,7 @@ write_gfx_char_cga: ; 0xc2454 LB 0x112 mov ch, al ; 88 c5 ; 0xc245c mov byte [bp-002h], dl ; 88 56 fe ; 0xc245e mov al, bl ; 88 d8 ; 0xc2461 - mov si, 05569h ; be 69 55 ; 0xc2463 vgabios.c:1541 + mov si, 0556ah ; be 6a 55 ; 0xc2463 vgabios.c:1541 xor ah, ah ; 30 e4 ; 0xc2466 vgabios.c:1542 mov bl, byte [bp+00ah] ; 8a 5e 0a ; 0xc2468 xor bh, bh ; 30 ff ; 0xc246b @@ -4653,7 +4653,7 @@ write_gfx_char_lin: ; 0xc2566 LB 0xa1 mov bh, al ; 88 c7 ; 0xc256e mov ch, dl ; 88 d5 ; 0xc2570 mov al, cl ; 88 c8 ; 0xc2572 - mov di, 05569h ; bf 69 55 ; 0xc2574 vgabios.c:1605 + mov di, 0556ah ; bf 6a 55 ; 0xc2574 vgabios.c:1605 xor ah, ah ; 30 e4 ; 0xc2577 vgabios.c:1606 mov dl, byte [bp+008h] ; 8a 56 08 ; 0xc2579 xor dh, dh ; 30 f6 ; 0xc257c @@ -4773,7 +4773,7 @@ biosfn_write_char_attr: ; 0xc2607 LB 0x172 mov CL, strict byte 003h ; b1 03 ; 0xc2679 mov di, bx ; 89 df ; 0xc267b sal di, CL ; d3 e7 ; 0xc267d - cmp byte [di+047ach], 000h ; 80 bd ac 47 00 ; 0xc267f + cmp byte [di+047adh], 000h ; 80 bd ad 47 00 ; 0xc267f jne short 026c6h ; 75 40 ; 0xc2684 mul dx ; f7 e2 ; 0xc2686 vgabios.c:1648 sal ax, 1 ; d1 e0 ; 0xc2688 @@ -4796,18 +4796,18 @@ biosfn_write_char_attr: ; 0xc2607 LB 0x172 mov al, byte [bp-00ch] ; 8a 46 f4 ; 0xc26ae mov word [bp-01eh], ax ; 89 46 e2 ; 0xc26b1 mov ax, word [bp-01eh] ; 8b 46 e2 ; 0xc26b4 vgabios.c:1651 - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc26b7 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc26b7 mov cx, si ; 89 f1 ; 0xc26bb mov di, bx ; 89 df ; 0xc26bd jcxz 026c3h ; e3 02 ; 0xc26bf rep stosw ; f3 ab ; 0xc26c1 jmp near 02772h ; e9 ac 00 ; 0xc26c3 vgabios.c:1653 - mov bl, byte [bx+0482bh] ; 8a 9f 2b 48 ; 0xc26c6 vgabios.c:1656 + mov bl, byte [bx+0482ch] ; 8a 9f 2c 48 ; 0xc26c6 vgabios.c:1656 mov CL, strict byte 006h ; b1 06 ; 0xc26ca sal bx, CL ; d3 e3 ; 0xc26cc - mov al, byte [bx+04841h] ; 8a 87 41 48 ; 0xc26ce + mov al, byte [bx+04842h] ; 8a 87 42 48 ; 0xc26ce mov byte [bp-010h], al ; 88 46 f0 ; 0xc26d2 - mov al, byte [di+047aeh] ; 8a 85 ae 47 ; 0xc26d5 vgabios.c:1657 + mov al, byte [di+047afh] ; 8a 85 af 47 ; 0xc26d5 vgabios.c:1657 mov byte [bp-012h], al ; 88 46 ee ; 0xc26d9 dec si ; 4e ; 0xc26dc vgabios.c:1658 cmp si, strict byte 0ffffh ; 83 fe ff ; 0xc26dd @@ -4816,7 +4816,7 @@ biosfn_write_char_attr: ; 0xc2607 LB 0x172 xor bh, bh ; 30 ff ; 0xc26e5 mov CL, strict byte 003h ; b1 03 ; 0xc26e7 sal bx, CL ; d3 e3 ; 0xc26e9 - mov al, byte [bx+047adh] ; 8a 87 ad 47 ; 0xc26eb + mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc26eb cmp al, cl ; 38 c8 ; 0xc26ef jc short 026ffh ; 72 0c ; 0xc26f1 jbe short 02705h ; 76 10 ; 0xc26f3 @@ -4927,7 +4927,7 @@ biosfn_write_char_only: ; 0xc2779 LB 0x183 mov CL, strict byte 003h ; b1 03 ; 0xc27e6 mov bx, ax ; 89 c3 ; 0xc27e8 sal bx, CL ; d3 e3 ; 0xc27ea - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc27ec + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc27ec jne short 02838h ; 75 45 ; 0xc27f1 mov ax, di ; 89 f8 ; 0xc27f3 vgabios.c:1706 mul dx ; f7 e2 ; 0xc27f5 @@ -4955,20 +4955,20 @@ biosfn_write_char_only: ; 0xc2779 LB 0x183 mov CL, strict byte 003h ; b1 03 ; 0xc2824 mov di, ax ; 89 c7 ; 0xc2826 sal di, CL ; d3 e7 ; 0xc2828 - mov es, [di+047afh] ; 8e 85 af 47 ; 0xc282a vgabios.c:50 + mov es, [di+047b0h] ; 8e 85 b0 47 ; 0xc282a vgabios.c:50 mov al, byte [bp-00ah] ; 8a 46 f6 ; 0xc282e vgabios.c:52 mov byte [es:bx], al ; 26 88 07 ; 0xc2831 inc bx ; 43 ; 0xc2834 vgabios.c:1710 inc bx ; 43 ; 0xc2835 jmp short 02819h ; eb e1 ; 0xc2836 vgabios.c:1711 mov di, ax ; 89 c7 ; 0xc2838 vgabios.c:1716 - mov al, byte [di+0482bh] ; 8a 85 2b 48 ; 0xc283a + mov al, byte [di+0482ch] ; 8a 85 2c 48 ; 0xc283a mov CL, strict byte 006h ; b1 06 ; 0xc283e mov di, ax ; 89 c7 ; 0xc2840 sal di, CL ; d3 e7 ; 0xc2842 - mov al, byte [di+04841h] ; 8a 85 41 48 ; 0xc2844 + mov al, byte [di+04842h] ; 8a 85 42 48 ; 0xc2844 mov byte [bp-012h], al ; 88 46 ee ; 0xc2848 - mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc284b vgabios.c:1717 + mov al, byte [bx+047afh] ; 8a 87 af 47 ; 0xc284b vgabios.c:1717 mov byte [bp-014h], al ; 88 46 ec ; 0xc284f dec si ; 4e ; 0xc2852 vgabios.c:1718 cmp si, strict byte 0ffffh ; 83 fe ff ; 0xc2853 @@ -4977,7 +4977,7 @@ biosfn_write_char_only: ; 0xc2779 LB 0x183 xor bh, bh ; 30 ff ; 0xc285b mov CL, strict byte 003h ; b1 03 ; 0xc285d sal bx, CL ; d3 e3 ; 0xc285f - mov bl, byte [bx+047adh] ; 8a 9f ad 47 ; 0xc2861 + mov bl, byte [bx+047aeh] ; 8a 9f ae 47 ; 0xc2861 cmp bl, cl ; 38 cb ; 0xc2865 jc short 02878h ; 72 0f ; 0xc2867 jbe short 0287fh ; 76 14 ; 0xc2869 @@ -5065,9 +5065,9 @@ biosfn_write_pixel: ; 0xc28fc LB 0x17a xor bh, bh ; 30 ff ; 0xc2927 mov CL, strict byte 003h ; b1 03 ; 0xc2929 sal bx, CL ; d3 e3 ; 0xc292b - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc292d + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc292d je short 0294ch ; 74 18 ; 0xc2932 - mov al, byte [bx+047adh] ; 8a 87 ad 47 ; 0xc2934 vgabios.c:1755 + mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc2934 vgabios.c:1755 cmp al, cl ; 38 c8 ; 0xc2938 jc short 02948h ; 72 0c ; 0xc293a jbe short 02952h ; 76 14 ; 0xc293c @@ -5131,7 +5131,7 @@ biosfn_write_pixel: ; 0xc28fc LB 0x17a shr ax, 1 ; d1 e8 ; 0xc29c7 mov dx, strict word 00050h ; ba 50 00 ; 0xc29c9 mul dx ; f7 e2 ; 0xc29cc - cmp byte [bx+047aeh], 002h ; 80 bf ae 47 02 ; 0xc29ce + cmp byte [bx+047afh], 002h ; 80 bf af 47 02 ; 0xc29ce jne short 029deh ; 75 09 ; 0xc29d3 mov bx, word [bp-008h] ; 8b 5e f8 ; 0xc29d5 vgabios.c:1777 shr bx, 1 ; d1 eb ; 0xc29d8 @@ -5151,7 +5151,7 @@ biosfn_write_pixel: ; 0xc28fc LB 0x17a mov CL, strict byte 003h ; b1 03 ; 0xc29fa mov si, dx ; 89 d6 ; 0xc29fc sal si, CL ; d3 e6 ; 0xc29fe - cmp byte [si+047aeh], 002h ; 80 bc ae 47 02 ; 0xc2a00 + cmp byte [si+047afh], 002h ; 80 bc af 47 02 ; 0xc2a00 jne short 02a21h ; 75 1a ; 0xc2a05 mov ah, byte [bp-008h] ; 8a 66 f8 ; 0xc2a07 vgabios.c:1787 and ah, cl ; 20 cc ; 0xc2a0a @@ -5275,7 +5275,7 @@ biosfn_write_teletype: ; 0xc2a76 LB 0x263 mov CL, strict byte 003h ; b1 03 ; 0xc2b25 mov bx, ax ; 89 c3 ; 0xc2b27 sal bx, CL ; d3 e3 ; 0xc2b29 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc2b2b + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc2b2b jne short 02b74h ; 75 42 ; 0xc2b30 mov ax, word [bp-012h] ; 8b 46 ee ; 0xc2b32 vgabios.c:1865 mul word [bp-014h] ; f7 66 ec ; 0xc2b35 @@ -5295,23 +5295,23 @@ biosfn_write_teletype: ; 0xc2a76 LB 0x263 add ax, dx ; 01 d0 ; 0xc2b55 sal ax, 1 ; d1 e0 ; 0xc2b57 add si, ax ; 01 c6 ; 0xc2b59 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc2b5b vgabios.c:50 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc2b5b vgabios.c:50 mov byte [es:si], ch ; 26 88 2c ; 0xc2b5f vgabios.c:52 cmp cl, byte [bp-004h] ; 3a 4e fc ; 0xc2b62 vgabios.c:1870 jne short 02ba4h ; 75 3d ; 0xc2b65 inc si ; 46 ; 0xc2b67 vgabios.c:1871 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc2b68 vgabios.c:50 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc2b68 vgabios.c:50 mov al, byte [bp-00ch] ; 8a 46 f4 ; 0xc2b6c mov byte [es:si], al ; 26 88 04 ; 0xc2b6f jmp short 02ba4h ; eb 30 ; 0xc2b72 vgabios.c:1873 mov si, ax ; 89 c6 ; 0xc2b74 vgabios.c:1876 - mov al, byte [si+0482bh] ; 8a 84 2b 48 ; 0xc2b76 + mov al, byte [si+0482ch] ; 8a 84 2c 48 ; 0xc2b76 mov CL, strict byte 006h ; b1 06 ; 0xc2b7a mov si, ax ; 89 c6 ; 0xc2b7c sal si, CL ; d3 e6 ; 0xc2b7e - mov dl, byte [si+04841h] ; 8a 94 41 48 ; 0xc2b80 - mov al, byte [bx+047aeh] ; 8a 87 ae 47 ; 0xc2b84 vgabios.c:1877 - mov bl, byte [bx+047adh] ; 8a 9f ad 47 ; 0xc2b88 vgabios.c:1878 + mov dl, byte [si+04842h] ; 8a 94 42 48 ; 0xc2b80 + mov al, byte [bx+047afh] ; 8a 87 af 47 ; 0xc2b84 vgabios.c:1877 + mov bl, byte [bx+047aeh] ; 8a 9f ae 47 ; 0xc2b88 vgabios.c:1878 cmp bl, 003h ; 80 fb 03 ; 0xc2b8c jc short 02b9fh ; 72 0e ; 0xc2b8f jbe short 02ba6h ; 76 13 ; 0xc2b91 @@ -5389,7 +5389,7 @@ biosfn_write_teletype: ; 0xc2a76 LB 0x263 mov ch, byte [bp-012h] ; 8a 6e ee ; 0xc2c40 db 0feh, 0cdh ; dec ch ; fe cd ; 0xc2c43 - cmp byte [bx+047ach], 000h ; 80 bf ac 47 00 ; 0xc2c45 + cmp byte [bx+047adh], 000h ; 80 bf ad 47 00 ; 0xc2c45 jne short 02c98h ; 75 4c ; 0xc2c4a mov ax, word [bp-012h] ; 8b 46 ee ; 0xc2c4c vgabios.c:1910 mul word [bp-014h] ; f7 66 ec ; 0xc2c4f @@ -5411,7 +5411,7 @@ biosfn_write_teletype: ; 0xc2a76 LB 0x263 sal ax, 1 ; d1 e0 ; 0xc2c72 add si, ax ; 01 c6 ; 0xc2c74 inc si ; 46 ; 0xc2c76 vgabios.c:1911 - mov es, [bx+047afh] ; 8e 87 af 47 ; 0xc2c77 vgabios.c:45 + mov es, [bx+047b0h] ; 8e 87 b0 47 ; 0xc2c77 vgabios.c:45 mov dl, byte [es:si] ; 26 8a 14 ; 0xc2c7b vgabios.c:47 mov ax, strict word 00001h ; b8 01 00 ; 0xc2c7e vgabios.c:1912 push ax ; 50 ; 0xc2c81 @@ -5789,7 +5789,7 @@ set_gfx_font: ; 0xc2f26 LB 0x4d mov DL, strict byte 002h ; b2 02 ; 0xc2f46 vgabios.c:2033 mov bl, dl ; 88 d3 ; 0xc2f48 vgabios.c:2034 xor bh, bh ; 30 ff ; 0xc2f4a - mov al, byte [bx+07dfah] ; 8a 87 fa 7d ; 0xc2f4c + mov al, byte [bx+07dfbh] ; 8a 87 fb 7d ; 0xc2f4c mov byte [bp+004h], al ; 88 46 04 ; 0xc2f50 mov bx, 00085h ; bb 85 00 ; 0xc2f53 vgabios.c:62 mov ax, strict word 00040h ; b8 40 00 ; 0xc2f56 @@ -5835,7 +5835,7 @@ biosfn_load_gfx_8_14_chars: ; 0xc2f90 LB 0x22 mov al, bl ; 88 d8 ; 0xc2f9c mov cx, ax ; 89 c1 ; 0xc2f9e mov bx, strict word 0000eh ; bb 0e 00 ; 0xc2fa0 - mov ax, 05d69h ; b8 69 5d ; 0xc2fa3 + mov ax, 05d6ah ; b8 6a 5d ; 0xc2fa3 mov dx, ds ; 8c da ; 0xc2fa6 call 02f26h ; e8 7b ff ; 0xc2fa8 lea sp, [bp-004h] ; 8d 66 fc ; 0xc2fab vgabios.c:2054 @@ -5856,7 +5856,7 @@ biosfn_load_gfx_8_8_dd_chars: ; 0xc2fb2 LB 0x22 mov al, bl ; 88 d8 ; 0xc2fbe mov cx, ax ; 89 c1 ; 0xc2fc0 mov bx, strict word 00008h ; bb 08 00 ; 0xc2fc2 - mov ax, 05569h ; b8 69 55 ; 0xc2fc5 + mov ax, 0556ah ; b8 6a 55 ; 0xc2fc5 mov dx, ds ; 8c da ; 0xc2fc8 call 02f26h ; e8 59 ff ; 0xc2fca lea sp, [bp-004h] ; 8d 66 fc ; 0xc2fcd vgabios.c:2058 @@ -5877,7 +5877,7 @@ biosfn_load_gfx_8_16_chars: ; 0xc2fd4 LB 0x22 mov al, bl ; 88 d8 ; 0xc2fe0 mov cx, ax ; 89 c1 ; 0xc2fe2 mov bx, strict word 00010h ; bb 10 00 ; 0xc2fe4 - mov ax, 06b69h ; b8 69 6b ; 0xc2fe7 + mov ax, 06b6ah ; b8 6a 6b ; 0xc2fe7 mov dx, ds ; 8c da ; 0xc2fea call 02f26h ; e8 37 ff ; 0xc2fec lea sp, [bp-004h] ; 8d 66 fc ; 0xc2fef vgabios.c:2062 @@ -6010,7 +6010,7 @@ biosfn_read_state_info: ; 0xc30c6 LB 0x1f2 mov word [bp-00ah], ax ; 89 46 f6 ; 0xc30e3 vgabios.c:58 mov ax, ds ; 8c d8 ; 0xc30e6 vgabios.c:2150 mov es, dx ; 8e c2 ; 0xc30e8 vgabios.c:72 - mov word [es:bx], 054ffh ; 26 c7 07 ff 54 ; 0xc30ea + mov word [es:bx], 05500h ; 26 c7 07 00 55 ; 0xc30ea mov [es:bx+002h], ds ; 26 8c 5f 02 ; 0xc30ef lea di, [bx+004h] ; 8d 7f 04 ; 0xc30f3 vgabios.c:2155 mov cx, strict word 0001eh ; b9 1e 00 ; 0xc30f6 @@ -6899,7 +6899,7 @@ find_vga_entry: ; 0xc3888 LB 0x2b xor bh, bh ; 30 ff ; 0xc389e mov CL, strict byte 003h ; b1 03 ; 0xc38a0 sal bx, CL ; d3 e3 ; 0xc38a2 - cmp dl, byte [bx+047abh] ; 3a 97 ab 47 ; 0xc38a4 + cmp dl, byte [bx+047ach] ; 3a 97 ac 47 ; 0xc38a4 jne short 03896h ; 75 ec ; 0xc38a8 mov ah, al ; 88 c4 ; 0xc38aa mov al, ah ; 88 e0 ; 0xc38ac vgabios.c:2438 @@ -7125,7 +7125,7 @@ int10_func: ; 0xc394b LB 0x456 push ax ; 50 ; 0xc3b26 mov al, byte [bp+012h] ; 8a 46 12 ; 0xc3b27 mov cx, 00100h ; b9 00 01 ; 0xc3b2a - mov bx, 05d69h ; bb 69 5d ; 0xc3b2d + mov bx, 05d6ah ; bb 6a 5d ; 0xc3b2d mov dx, 0c000h ; ba 00 c0 ; 0xc3b30 call 02e8ch ; e8 56 f3 ; 0xc3b33 jmp short 03b58h ; eb 20 ; 0xc3b36 @@ -7138,7 +7138,7 @@ int10_func: ; 0xc394b LB 0x456 push ax ; 50 ; 0xc3b44 mov al, byte [bp+012h] ; 8a 46 12 ; 0xc3b45 mov cx, 00100h ; b9 00 01 ; 0xc3b48 - mov bx, 05569h ; bb 69 55 ; 0xc3b4b + mov bx, 0556ah ; bb 6a 55 ; 0xc3b4b jmp short 03b30h ; eb e0 ; 0xc3b4e mov al, byte [bp+00ch] ; 8a 46 0c ; 0xc3b50 vgabios.c:2629 xor ah, ah ; 30 e4 ; 0xc3b53 @@ -7153,7 +7153,7 @@ int10_func: ; 0xc394b LB 0x456 push ax ; 50 ; 0xc3b67 mov al, byte [bp+012h] ; 8a 46 12 ; 0xc3b68 mov cx, 00100h ; b9 00 01 ; 0xc3b6b - mov bx, 06b69h ; bb 69 6b ; 0xc3b6e + mov bx, 06b6ah ; bb 6a 6b ; 0xc3b6e jmp short 03b30h ; eb bd ; 0xc3b71 mov dx, word [bp+008h] ; 8b 56 08 ; 0xc3b73 vgabios.c:2636 mov ax, word [bp+016h] ; 8b 46 16 ; 0xc3b76 @@ -7674,7 +7674,7 @@ vbe_biosfn_return_controller_information: ; 0xc3f6b LB 0x12b mov word [es:bx], 04556h ; 26 c7 07 56 45 ; 0xc3fd6 mov word [es:bx+002h], 04153h ; 26 c7 47 02 53 41 ; 0xc3fdb vbe.c:334 mov word [es:bx+004h], 00200h ; 26 c7 47 04 00 02 ; 0xc3fe1 vbe.c:338 - mov word [es:bx+006h], 07dfeh ; 26 c7 47 06 fe 7d ; 0xc3fe7 vbe.c:341 + mov word [es:bx+006h], 07e00h ; 26 c7 47 06 00 7e ; 0xc3fe7 vbe.c:341 mov [es:bx+008h], ds ; 26 8c 5f 08 ; 0xc3fed mov word [es:bx+00ah], strict word 00001h ; 26 c7 47 0a 01 00 ; 0xc3ff1 vbe.c:344 mov word [es:bx+00ch], strict word 00000h ; 26 c7 47 0c 00 00 ; 0xc3ff7 vbe.c:346 @@ -7690,11 +7690,11 @@ vbe_biosfn_return_controller_information: ; 0xc3f6b LB 0x12b cmp word [bp-00eh], strict byte 00000h ; 83 7e f2 00 ; 0xc401b vbe.c:356 je short 04045h ; 74 24 ; 0xc401f mov word [es:bx+014h], strict word 00003h ; 26 c7 47 14 03 00 ; 0xc4021 vbe.c:359 - mov word [es:bx+016h], 07e13h ; 26 c7 47 16 13 7e ; 0xc4027 vbe.c:360 + mov word [es:bx+016h], 07e15h ; 26 c7 47 16 15 7e ; 0xc4027 vbe.c:360 mov [es:bx+018h], ds ; 26 8c 5f 18 ; 0xc402d - mov word [es:bx+01ah], 07e30h ; 26 c7 47 1a 30 7e ; 0xc4031 vbe.c:361 + mov word [es:bx+01ah], 07e32h ; 26 c7 47 1a 32 7e ; 0xc4031 vbe.c:361 mov [es:bx+01ch], ds ; 26 8c 5f 1c ; 0xc4037 - mov word [es:bx+01eh], 07e4eh ; 26 c7 47 1e 4e 7e ; 0xc403b vbe.c:362 + mov word [es:bx+01eh], 07e50h ; 26 c7 47 1e 50 7e ; 0xc403b vbe.c:362 mov [es:bx+020h], ds ; 26 8c 5f 20 ; 0xc4041 mov dx, cx ; 89 ca ; 0xc4045 vbe.c:369 add dx, strict byte 0001bh ; 83 c2 1b ; 0xc4047 @@ -8436,12 +8436,12 @@ vesa_pm_end: ; 0xc4754 LB 0x1 ; Padding 0x2b bytes at 0xc4755 times 43 db 0 -section _DATA progbits vstart=0x4780 align=1 ; size=0x3742 class=DATA group=DGROUP - ; disGetNextSymbol 0xc4780 LB 0x3742 -> off=0x0 cb=000000000000002b uValue=00000000000c0000 '_msg_vga_init' -_msg_vga_init: ; 0xc4780 LB 0x2b - db 'Oracle VirtualBox Version 7.1.8 VGA BIOS', 00dh, 00ah, 000h - ; disGetNextSymbol 0xc47ab LB 0x3717 -> off=0x0 cb=0000000000000080 uValue=00000000000c002b 'vga_modes' -vga_modes: ; 0xc47ab LB 0x80 +section _DATA progbits vstart=0x4780 align=1 ; size=0x3745 class=DATA group=DGROUP + ; disGetNextSymbol 0xc4780 LB 0x3745 -> off=0x0 cb=000000000000002c uValue=00000000000c0000 '_msg_vga_init' +_msg_vga_init: ; 0xc4780 LB 0x2c + db 'Oracle VirtualBox Version 7.1.10 VGA BIOS', 00dh, 00ah, 000h + ; disGetNextSymbol 0xc47ac LB 0x3719 -> off=0x0 cb=0000000000000080 uValue=00000000000c002c 'vga_modes' +vga_modes: ; 0xc47ac LB 0x80 db 000h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 001h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h db 002h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 003h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h db 004h, 001h, 002h, 002h, 000h, 0b8h, 0ffh, 001h, 005h, 001h, 002h, 002h, 000h, 0b8h, 0ffh, 001h @@ -8450,14 +8450,14 @@ vga_modes: ; 0xc47ab LB 0x80 db 00fh, 001h, 003h, 001h, 000h, 0a0h, 0ffh, 000h, 010h, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h db 011h, 001h, 003h, 001h, 000h, 0a0h, 0ffh, 002h, 012h, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h db 013h, 001h, 005h, 008h, 000h, 0a0h, 0ffh, 003h, 06ah, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h - ; disGetNextSymbol 0xc482b LB 0x3697 -> off=0x0 cb=0000000000000010 uValue=00000000000c00ab 'line_to_vpti' -line_to_vpti: ; 0xc482b LB 0x10 + ; disGetNextSymbol 0xc482c LB 0x3699 -> off=0x0 cb=0000000000000010 uValue=00000000000c00ac 'line_to_vpti' +line_to_vpti: ; 0xc482c LB 0x10 db 017h, 017h, 018h, 018h, 004h, 005h, 006h, 007h, 00dh, 00eh, 011h, 012h, 01ah, 01bh, 01ch, 01dh - ; disGetNextSymbol 0xc483b LB 0x3687 -> off=0x0 cb=0000000000000004 uValue=00000000000c00bb 'dac_regs' -dac_regs: ; 0xc483b LB 0x4 + ; disGetNextSymbol 0xc483c LB 0x3689 -> off=0x0 cb=0000000000000004 uValue=00000000000c00bc 'dac_regs' +dac_regs: ; 0xc483c LB 0x4 dd 0ff3f3f3fh - ; disGetNextSymbol 0xc483f LB 0x3683 -> off=0x0 cb=0000000000000780 uValue=00000000000c00bf 'video_param_table' -video_param_table: ; 0xc483f LB 0x780 + ; disGetNextSymbol 0xc4840 LB 0x3685 -> off=0x0 cb=0000000000000780 uValue=00000000000c00c0 'video_param_table' +video_param_table: ; 0xc4840 LB 0x780 db 028h, 018h, 008h, 000h, 008h, 009h, 003h, 000h, 002h, 063h, 02dh, 027h, 028h, 090h, 02bh, 0a0h db 0bfh, 01fh, 000h, 0c7h, 006h, 007h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 014h, 01fh, 096h db 0b9h, 0a3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h, 010h, 011h, 012h, 013h, 014h @@ -8578,8 +8578,8 @@ video_param_table: ; 0xc483f LB 0x780 db 072h, 0f0h, 000h, 060h, 000h, 000h, 000h, 000h, 000h, 000h, 059h, 08dh, 057h, 032h, 000h, 057h db 073h, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch db 03dh, 03eh, 03fh, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh - ; disGetNextSymbol 0xc4fbf LB 0x2f03 -> off=0x0 cb=00000000000000c0 uValue=00000000000c083f 'palette0' -palette0: ; 0xc4fbf LB 0xc0 + ; disGetNextSymbol 0xc4fc0 LB 0x2f05 -> off=0x0 cb=00000000000000c0 uValue=00000000000c0840 'palette0' +palette0: ; 0xc4fc0 LB 0xc0 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah @@ -8592,8 +8592,8 @@ palette0: ; 0xc4fbf LB 0xc0 db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh db 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh - ; disGetNextSymbol 0xc507f LB 0x2e43 -> off=0x0 cb=00000000000000c0 uValue=00000000000c08ff 'palette1' -palette1: ; 0xc507f LB 0xc0 + ; disGetNextSymbol 0xc5080 LB 0x2e45 -> off=0x0 cb=00000000000000c0 uValue=00000000000c0900 'palette1' +palette1: ; 0xc5080 LB 0xc0 db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah db 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah, 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah @@ -8606,8 +8606,8 @@ palette1: ; 0xc507f LB 0xc0 db 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh, 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh db 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh - ; disGetNextSymbol 0xc513f LB 0x2d83 -> off=0x0 cb=00000000000000c0 uValue=00000000000c09bf 'palette2' -palette2: ; 0xc513f LB 0xc0 + ; disGetNextSymbol 0xc5140 LB 0x2d85 -> off=0x0 cb=00000000000000c0 uValue=00000000000c09c0 'palette2' +palette2: ; 0xc5140 LB 0xc0 db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah db 000h, 02ah, 02ah, 02ah, 000h, 02ah, 02ah, 02ah, 000h, 000h, 015h, 000h, 000h, 03fh, 000h, 02ah db 015h, 000h, 02ah, 03fh, 02ah, 000h, 015h, 02ah, 000h, 03fh, 02ah, 02ah, 015h, 02ah, 02ah, 03fh @@ -8620,8 +8620,8 @@ palette2: ; 0xc513f LB 0xc0 db 015h, 015h, 000h, 015h, 015h, 02ah, 015h, 03fh, 000h, 015h, 03fh, 02ah, 03fh, 015h, 000h, 03fh db 015h, 02ah, 03fh, 03fh, 000h, 03fh, 03fh, 02ah, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh - ; disGetNextSymbol 0xc51ff LB 0x2cc3 -> off=0x0 cb=0000000000000300 uValue=00000000000c0a7f 'palette3' -palette3: ; 0xc51ff LB 0x300 + ; disGetNextSymbol 0xc5200 LB 0x2cc5 -> off=0x0 cb=0000000000000300 uValue=00000000000c0a80 'palette3' +palette3: ; 0xc5200 LB 0x300 db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh @@ -8670,24 +8670,24 @@ palette3: ; 0xc51ff LB 0x300 db 00bh, 010h, 00bh, 00bh, 010h, 00ch, 00bh, 010h, 00dh, 00bh, 010h, 00fh, 00bh, 010h, 010h, 00bh db 00fh, 010h, 00bh, 00dh, 010h, 00bh, 00ch, 010h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc54ff LB 0x29c3 -> off=0x0 cb=0000000000000010 uValue=00000000000c0d7f 'static_functionality' -static_functionality: ; 0xc54ff LB 0x10 + ; disGetNextSymbol 0xc5500 LB 0x29c5 -> off=0x0 cb=0000000000000010 uValue=00000000000c0d80 'static_functionality' +static_functionality: ; 0xc5500 LB 0x10 db 0ffh, 0e0h, 00fh, 000h, 000h, 000h, 000h, 007h, 002h, 008h, 0e7h, 00ch, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc550f LB 0x29b3 -> off=0x0 cb=0000000000000024 uValue=00000000000c0d8f '_dcc_table' -_dcc_table: ; 0xc550f LB 0x24 + ; disGetNextSymbol 0xc5510 LB 0x29b5 -> off=0x0 cb=0000000000000024 uValue=00000000000c0d90 '_dcc_table' +_dcc_table: ; 0xc5510 LB 0x24 db 010h, 001h, 007h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc5533 LB 0x298f -> off=0x0 cb=000000000000001a uValue=00000000000c0db3 '_secondary_save_area' -_secondary_save_area: ; 0xc5533 LB 0x1a - db 01ah, 000h, 00fh, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h + ; disGetNextSymbol 0xc5534 LB 0x2991 -> off=0x0 cb=000000000000001a uValue=00000000000c0db4 '_secondary_save_area' +_secondary_save_area: ; 0xc5534 LB 0x1a + db 01ah, 000h, 010h, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc554d LB 0x2975 -> off=0x0 cb=000000000000001c uValue=00000000000c0dcd '_video_save_pointer_table' -_video_save_pointer_table: ; 0xc554d LB 0x1c - db 03fh, 048h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - db 033h, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc5569 LB 0x2959 -> off=0x0 cb=0000000000000800 uValue=00000000000c0de9 'vgafont8' -vgafont8: ; 0xc5569 LB 0x800 + ; disGetNextSymbol 0xc554e LB 0x2977 -> off=0x0 cb=000000000000001c uValue=00000000000c0dce '_video_save_pointer_table' +_video_save_pointer_table: ; 0xc554e LB 0x1c + db 040h, 048h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h + db 034h, 055h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h + ; disGetNextSymbol 0xc556a LB 0x295b -> off=0x0 cb=0000000000000800 uValue=00000000000c0dea 'vgafont8' +vgafont8: ; 0xc556a LB 0x800 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07eh, 081h, 0a5h, 081h, 0bdh, 099h, 081h, 07eh db 07eh, 0ffh, 0dbh, 0ffh, 0c3h, 0e7h, 0ffh, 07eh, 06ch, 0feh, 0feh, 0feh, 07ch, 038h, 010h, 000h db 010h, 038h, 07ch, 0feh, 07ch, 038h, 010h, 000h, 038h, 07ch, 038h, 0feh, 0feh, 07ch, 038h, 07ch @@ -8816,8 +8816,8 @@ vgafont8: ; 0xc5569 LB 0x800 db 000h, 000h, 000h, 000h, 018h, 000h, 000h, 000h, 00fh, 00ch, 00ch, 00ch, 0ech, 06ch, 03ch, 01ch db 078h, 06ch, 06ch, 06ch, 06ch, 000h, 000h, 000h, 070h, 018h, 030h, 060h, 078h, 000h, 000h, 000h db 000h, 000h, 03ch, 03ch, 03ch, 03ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc5d69 LB 0x2159 -> off=0x0 cb=0000000000000e00 uValue=00000000000c15e9 'vgafont14' -vgafont14: ; 0xc5d69 LB 0xe00 + ; disGetNextSymbol 0xc5d6a LB 0x215b -> off=0x0 cb=0000000000000e00 uValue=00000000000c15ea 'vgafont14' +vgafont14: ; 0xc5d6a LB 0xe00 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 07eh, 081h, 0a5h, 081h, 081h, 0bdh, 099h, 081h, 07eh, 000h, 000h, 000h, 000h, 000h, 07eh, 0ffh db 0dbh, 0ffh, 0ffh, 0c3h, 0e7h, 0ffh, 07eh, 000h, 000h, 000h, 000h, 000h, 000h, 06ch, 0feh, 0feh @@ -9042,8 +9042,8 @@ vgafont14: ; 0xc5d69 LB 0xe00 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 070h, 0d8h, 030h, 060h, 0c8h, 0f8h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc6b69 LB 0x1359 -> off=0x0 cb=0000000000001000 uValue=00000000000c23e9 'vgafont16' -vgafont16: ; 0xc6b69 LB 0x1000 + ; disGetNextSymbol 0xc6b6a LB 0x135b -> off=0x0 cb=0000000000001000 uValue=00000000000c23ea 'vgafont16' +vgafont16: ; 0xc6b6a LB 0x1000 db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 07eh, 081h, 0a5h, 081h, 081h, 0bdh, 099h, 081h, 081h, 07eh, 000h, 000h, 000h, 000h db 000h, 000h, 07eh, 0ffh, 0dbh, 0ffh, 0ffh, 0c3h, 0e7h, 0ffh, 0ffh, 07eh, 000h, 000h, 000h, 000h @@ -9300,8 +9300,8 @@ vgafont16: ; 0xc6b69 LB 0x1000 db 000h, 070h, 0d8h, 030h, 060h, 0c8h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc7b69 LB 0x359 -> off=0x0 cb=000000000000012d uValue=00000000000c33e9 'vgafont14alt' -vgafont14alt: ; 0xc7b69 LB 0x12d + ; disGetNextSymbol 0xc7b6a LB 0x35b -> off=0x0 cb=000000000000012d uValue=00000000000c33ea 'vgafont14alt' +vgafont14alt: ; 0xc7b6a LB 0x12d db 01dh, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h, 022h db 000h, 063h, 063h, 063h, 022h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02bh, 000h db 000h, 000h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 02dh, 000h, 000h @@ -9321,8 +9321,8 @@ vgafont14alt: ; 0xc7b69 LB 0x12d db 000h, 0fch, 066h, 066h, 07ch, 062h, 066h, 06fh, 066h, 066h, 0f3h, 000h, 000h, 000h, 0f1h, 000h db 000h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 000h, 0ffh, 000h, 000h, 000h, 0f6h, 000h, 000h db 018h, 018h, 000h, 000h, 0ffh, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h - ; disGetNextSymbol 0xc7c96 LB 0x22c -> off=0x0 cb=0000000000000144 uValue=00000000000c3516 'vgafont16alt' -vgafont16alt: ; 0xc7c96 LB 0x144 + ; disGetNextSymbol 0xc7c97 LB 0x22e -> off=0x0 cb=0000000000000144 uValue=00000000000c3517 'vgafont16alt' +vgafont16alt: ; 0xc7c97 LB 0x144 db 01dh, 000h, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h db 000h, 030h, 000h, 000h, 03ch, 066h, 0c3h, 0c3h, 0dbh, 0dbh, 0c3h, 0c3h, 066h, 03ch, 000h, 000h db 000h, 000h, 04dh, 000h, 000h, 0c3h, 0e7h, 0ffh, 0ffh, 0dbh, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 000h @@ -9344,53 +9344,56 @@ vgafont16alt: ; 0xc7c96 LB 0x144 db 000h, 0abh, 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 060h, 0ceh, 09bh, 006h, 00ch, 01fh db 000h, 000h, 0ach, 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 066h, 0ceh, 096h, 03eh, 006h db 006h, 000h, 000h, 000h - ; disGetNextSymbol 0xc7dda LB 0xe8 -> off=0x0 cb=0000000000000008 uValue=00000000000c365a '_cga_msr' -_cga_msr: ; 0xc7dda LB 0x8 + ; disGetNextSymbol 0xc7ddb LB 0xea -> off=0x0 cb=0000000000000008 uValue=00000000000c365b '_cga_msr' +_cga_msr: ; 0xc7ddb LB 0x8 db 02ch, 028h, 02dh, 029h, 02ah, 02eh, 01eh, 029h - ; disGetNextSymbol 0xc7de2 LB 0xe0 -> off=0x0 cb=0000000000000008 uValue=00000000000c3662 'line_to_vpti_200' -line_to_vpti_200: ; 0xc7de2 LB 0x8 + ; disGetNextSymbol 0xc7de3 LB 0xe2 -> off=0x0 cb=0000000000000008 uValue=00000000000c3663 'line_to_vpti_200' +line_to_vpti_200: ; 0xc7de3 LB 0x8 db 000h, 001h, 002h, 003h, 0ffh, 0ffh, 0ffh, 007h - ; disGetNextSymbol 0xc7dea LB 0xd8 -> off=0x0 cb=0000000000000008 uValue=00000000000c366a 'line_to_vpti_350' -line_to_vpti_350: ; 0xc7dea LB 0x8 + ; disGetNextSymbol 0xc7deb LB 0xda -> off=0x0 cb=0000000000000008 uValue=00000000000c366b 'line_to_vpti_350' +line_to_vpti_350: ; 0xc7deb LB 0x8 db 013h, 014h, 015h, 016h, 0ffh, 0ffh, 0ffh, 007h - ; disGetNextSymbol 0xc7df2 LB 0xd0 -> off=0x0 cb=0000000000000008 uValue=00000000000c3672 'line_to_vpti_400' -line_to_vpti_400: ; 0xc7df2 LB 0x8 + ; disGetNextSymbol 0xc7df3 LB 0xd2 -> off=0x0 cb=0000000000000008 uValue=00000000000c3673 'line_to_vpti_400' +line_to_vpti_400: ; 0xc7df3 LB 0x8 db 017h, 017h, 018h, 018h, 0ffh, 0ffh, 0ffh, 019h - ; disGetNextSymbol 0xc7dfa LB 0xc8 -> off=0x0 cb=0000000000000004 uValue=00000000000c367a 'row_tbl' -row_tbl: ; 0xc7dfa LB 0x4 - dd 02b190e00h - ; disGetNextSymbol 0xc7dfe LB 0xc4 -> off=0x0 cb=0000000000000015 uValue=00000000000c367e '_vbebios_copyright' -_vbebios_copyright: ; 0xc7dfe LB 0x15 + ; disGetNextSymbol 0xc7dfb LB 0xca -> off=0x0 cb=0000000000000005 uValue=00000000000c367b 'row_tbl' +row_tbl: ; 0xc7dfb LB 0x5 + db 000h, 00eh, 019h, 02bh, 000h + ; disGetNextSymbol 0xc7e00 LB 0xc5 -> off=0x0 cb=0000000000000015 uValue=00000000000c3680 '_vbebios_copyright' +_vbebios_copyright: ; 0xc7e00 LB 0x15 db 'VirtualBox VESA BIOS', 000h - ; disGetNextSymbol 0xc7e13 LB 0xaf -> off=0x0 cb=000000000000001d uValue=00000000000c3693 '_vbebios_vendor_name' -_vbebios_vendor_name: ; 0xc7e13 LB 0x1d + ; disGetNextSymbol 0xc7e15 LB 0xb0 -> off=0x0 cb=000000000000001d uValue=00000000000c3695 '_vbebios_vendor_name' +_vbebios_vendor_name: ; 0xc7e15 LB 0x1d db 'Oracle and/or its affiliates', 000h - ; disGetNextSymbol 0xc7e30 LB 0x92 -> off=0x0 cb=000000000000001e uValue=00000000000c36b0 '_vbebios_product_name' -_vbebios_product_name: ; 0xc7e30 LB 0x1e + ; disGetNextSymbol 0xc7e32 LB 0x93 -> off=0x0 cb=000000000000001e uValue=00000000000c36b2 '_vbebios_product_name' +_vbebios_product_name: ; 0xc7e32 LB 0x1e db 'Oracle VirtualBox VBE Adapter', 000h - ; disGetNextSymbol 0xc7e4e LB 0x74 -> off=0x0 cb=0000000000000020 uValue=00000000000c36ce '_vbebios_product_revision' -_vbebios_product_revision: ; 0xc7e4e LB 0x20 - db 'Oracle VirtualBox Version 7.1.8', 000h - ; disGetNextSymbol 0xc7e6e LB 0x54 -> off=0x0 cb=000000000000002b uValue=00000000000c36ee '_vbebios_info_string' -_vbebios_info_string: ; 0xc7e6e LB 0x2b + ; disGetNextSymbol 0xc7e50 LB 0x75 -> off=0x0 cb=0000000000000021 uValue=00000000000c36d0 '_vbebios_product_revision' +_vbebios_product_revision: ; 0xc7e50 LB 0x21 + db 'Oracle VirtualBox Version 7.1.10', 000h + ; disGetNextSymbol 0xc7e71 LB 0x54 -> off=0x0 cb=000000000000002b uValue=00000000000c36f1 '_vbebios_info_string' +_vbebios_info_string: ; 0xc7e71 LB 0x2b db 'VirtualBox VBE Display Adapter enabled', 00dh, 00ah, 00dh, 00ah, 000h - ; disGetNextSymbol 0xc7e99 LB 0x29 -> off=0x0 cb=0000000000000029 uValue=00000000000c3719 '_no_vbebios_info_string' -_no_vbebios_info_string: ; 0xc7e99 LB 0x29 + ; disGetNextSymbol 0xc7e9c LB 0x29 -> off=0x0 cb=0000000000000029 uValue=00000000000c371c '_no_vbebios_info_string' +_no_vbebios_info_string: ; 0xc7e9c LB 0x29 db 'No VirtualBox VBE support available!', 00dh, 00ah, 00dh, 00ah, 000h -section CONST progbits vstart=0x7ec2 align=1 ; size=0x0 class=DATA group=DGROUP + ; Padding 0x1 bytes at 0xc7ec5 + db 001h -section CONST2 progbits vstart=0x7ec2 align=1 ; size=0x0 class=DATA group=DGROUP +section CONST progbits vstart=0x7ec6 align=1 ; size=0x0 class=DATA group=DGROUP - ; Padding 0x13e bytes at 0xc7ec2 - db 001h, 000h, 000h, 000h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 02fh, 068h, 06fh, 06dh - db 065h, 02fh, 067h, 061h, 06ch, 069h, 074h, 073h, 079h, 06eh, 02fh, 063h, 06fh, 06dh, 070h, 069h - db 06ch, 065h, 02dh, 063h, 061h, 063h, 068h, 065h, 02fh, 076h, 062h, 06fh, 078h, 02fh, 062h, 072h - db 061h, 06eh, 063h, 068h, 065h, 073h, 02fh, 056h, 042h, 06fh, 078h, 02dh, 037h, 02eh, 031h, 02fh - db 06fh, 075h, 074h, 02fh, 06ch, 069h, 06eh, 075h, 078h, 02eh, 061h, 06dh, 064h, 036h, 034h, 02fh - db 072h, 065h, 06ch, 065h, 061h, 073h, 065h, 02fh, 06fh, 062h, 06ah, 02fh, 056h, 042h, 06fh, 078h - db 056h, 067h, 061h, 042h, 069h, 06fh, 073h, 038h, 030h, 038h, 036h, 02fh, 056h, 042h, 06fh, 078h - db 056h, 067h, 061h, 042h, 069h, 06fh, 073h, 038h, 030h, 038h, 036h, 02eh, 073h, 079h, 06dh, 000h +section CONST2 progbits vstart=0x7ec6 align=1 ; size=0x0 class=DATA group=DGROUP + + ; Padding 0x13a bytes at 0xc7ec6 + db 000h, 000h, 000h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 02fh, 068h, 06fh, 06dh, 065h + db 02fh, 067h, 061h, 06ch, 069h, 074h, 073h, 079h, 06eh, 02fh, 063h, 06fh, 06dh, 070h, 069h, 06ch + db 065h, 02dh, 063h, 061h, 063h, 068h, 065h, 02fh, 076h, 062h, 06fh, 078h, 02fh, 062h, 072h, 061h + db 06eh, 063h, 068h, 065h, 073h, 02fh, 056h, 042h, 06fh, 078h, 02dh, 037h, 02eh, 031h, 02fh, 06fh + db 075h, 074h, 02fh, 06ch, 069h, 06eh, 075h, 078h, 02eh, 061h, 06dh, 064h, 036h, 034h, 02fh, 072h + db 065h, 06ch, 065h, 061h, 073h, 065h, 02fh, 06fh, 062h, 06ah, 02fh, 056h, 042h, 06fh, 078h, 056h + db 067h, 061h, 042h, 069h, 06fh, 073h, 038h, 030h, 038h, 036h, 02fh, 056h, 042h, 06fh, 078h, 056h + db 067h, 061h, 042h, 069h, 06fh, 073h, 038h, 030h, 038h, 036h, 02eh, 073h, 079h, 06dh, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h @@ -9402,4 +9405,4 @@ section CONST2 progbits vstart=0x7ec2 align=1 ; size=0x0 class=DATA group=DGROUP db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h - db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0e3h + db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 021h diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative8086.md5sum b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative8086.md5sum index 7ea672a8..8f3195fd 100644 --- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative8086.md5sum +++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative8086.md5sum @@ -1 +1 @@ -85b4d4e69c0d498396a3ef5b1df3bfc1 *VBoxVgaBios8086.rom +7834d260590101c10faf3453e3fb0f9f *VBoxVgaBios8086.rom diff --git a/src/VBox/Devices/Network/DevVirtioNet.cpp b/src/VBox/Devices/Network/DevVirtioNet.cpp index dc8f21a5..1c7575cd 100644 --- a/src/VBox/Devices/Network/DevVirtioNet.cpp +++ b/src/VBox/Devices/Network/DevVirtioNet.cpp @@ -1,5 +1,4 @@ -/* $Id: DevVirtioNet.cpp $ */ - +/* $Id: DevVirtioNet.cpp 169005 2025-05-26 19:56:17Z klaus $ */ /** @file * VBox storage devices - Virtio NET Driver * @@ -672,6 +671,10 @@ static DECLCALLBACK(void) virtioNetVirtqNotified(PPDMDEVINS pDevIns, PVIRTIOCORE PVIRTIONETVIRTQ pVirtq = &pThis->aVirtqs[uVirtqNbr]; PVIRTIONETWORKER pWorker = &pThis->aWorkers[uVirtqNbr]; +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicReadBool(&pVirtio->fRecovering)) + LogRel(("[%s] Received notification from the guest on queue %u\n", pThis->szInst, uVirtqNbr)); +#endif /* VIRTIO_REL_INFO_DUMP */ #if defined (IN_RING3) && defined (LOG_ENABLED) RTLogFlush(NULL); #endif @@ -791,7 +794,11 @@ void virtioNetDumpGcPhysRxBuf(PPDMDEVINS pDevIns, PVIRTIONETPKTHDR pRxPktHdr, /** * @callback_method_impl{FNDBGFHANDLERDEV, virtio-net debugger info callback.} */ +#ifdef VIRTIO_REL_INFO_DUMP +DECLCALLBACK(void) virtioNetR3Info(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) +#else /* !VIRTIO_REL_INFO_DUMP */ static DECLCALLBACK(void) virtioNetR3Info(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) +#endif /* !VIRTIO_REL_INFO_DUMP */ { PVIRTIONET pThis = PDMDEVINS_2_DATA(pDevIns, PVIRTIONET); PVIRTIONETCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PVIRTIONETCC); @@ -803,6 +810,14 @@ static DECLCALLBACK(void) virtioNetR3Info(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp bool fState = pszArgs && (*pszArgs == 's' || *pszArgs == 'S'); /* "state" */ bool fPointers = pszArgs && (*pszArgs == 'p' || *pszArgs == 'P'); /* "pointers" */ bool fVirtqs = pszArgs && (*pszArgs == 'q' || *pszArgs == 'Q'); /* "queues */ +#ifdef VIRTIO_REL_INFO_DUMP + if (pszArgs && (*pszArgs == 't' || *pszArgs == 'T')) + { + ASMAtomicWriteBool(&pThis->Virtio.fTestRecovery, true); + pHlp->pfnPrintf(pHlp, "Triggering recovery for %s\n", pThis->szInst); + return; + } +#endif /* VIRTIO_REL_INFO_DUMP */ /* Show basic information. */ pHlp->pfnPrintf(pHlp, @@ -1037,6 +1052,10 @@ static int virtioNetR3DevCfgAccess(PVIRTIONET pThis, uint32_t uOffsetOfAccess, v pThis->szInst, uOffsetOfAccess, uOffsetOfAccess, cb)); return fWrite ? VINF_SUCCESS : VINF_IOM_MMIO_UNUSED_00; } +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicReadBool(&pThis->Virtio.fRecovering)) + LogRel(("[%s] %s %u bytes @ dev cfg + %u: %.*Rhxs\n", pThis->szInst, fWrite ? "wrote" : "read", cb, uOffsetOfAccess, cb, pv)); +#endif /* VIRTIO_REL_INFO_DUMP */ return VINF_SUCCESS; } @@ -1536,6 +1555,42 @@ static DECLCALLBACK(int) virtioNetR3ModernSaveExec(PPDMDEVINS pDevIns, PSSMHANDL #ifdef IN_RING3 +#ifdef VIRTIO_REL_INFO_DUMP +/** + * Attempt to recover from the state when a descriptor loop is discovered in adapter queue. + * The idea is to force device reset via setting the DEVICE_NEEDS_RESET bit in the device status field. + * To prevent further accesses to the queue in invalid state we need to bring down the link temporarily. + * Unfortunately it does not seem to be handled by Linux virtio at all, so the faulty queue will remain + * disabled, preventing recovery. + * + * @param pDevIns PDM instance + * + */ +DECLHIDDEN(int) virtioNetAttemptToRecover(PPDMDEVINS pDevIns) +{ + PVIRTIONET pThis = PDMDEVINS_2_DATA(pDevIns, PVIRTIONET); + PVIRTIONETCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PVIRTIONETCC); + + if (IS_LINK_UP(pThis)) + { + SET_LINK_DOWN(pThis); + + /* Re-establish link in 10 seconds. */ + int rc = PDMDevHlpTimerSetMillies(pDevIns, pThisCC->hLinkUpTimer, 10000); + AssertRC(rc); + + LogRel(("[%s] Virtio disabled until device reset\n", pThis->szInst)); + pThis->fVirtioReady = false; + } + virtioCoreResetAll(&pThis->Virtio); + + if (ASMAtomicXchgBool(&pThis->Virtio.fRecovering, true)) + LogRel(("[%s] Attempting recovery while in recovery!\n", pThis->szInst)); + + return VINF_SUCCESS; +} +#endif /* VIRTIO_REL_INFO_DUMP */ + /** * Perform 16-bit 1's compliment checksum on provided packet in accordance with VirtIO specification, * pertinent to VIRTIO_NET_F_CSUM feature, which 'offloads' the Checksum feature from the driver @@ -1650,6 +1705,10 @@ static int virtioNetR3CheckRxBufsAvail(PPDMDEVINS pDevIns, PVIRTIONET pThis, PVI virtioCoreVirtqAvailBufCount(pDevIns, &pThis->Virtio, pRxVirtq->uIdx))); rc = VINF_SUCCESS; } +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicReadBool(&pThis->Virtio.fRecovering)) + LogRel(("[%s] %sRX buffers available on %s\n", pThis->szInst, rc == VERR_INVALID_STATE ? "Enabling notify as no " : "", pRxVirtq->szName)); +#endif /* VIRTIO_REL_INFO_DUMP */ virtioCoreVirtqEnableNotify(&pThis->Virtio, pRxVirtq->uIdx, rc == VERR_INVALID_STATE /* fEnable */); return rc; } @@ -2008,6 +2067,12 @@ static int virtioNetR3RxPktMultibufXfer(PPDMDEVINS pDevIns, PVIRTIONET pThis, ui { cbHdrEnqueued = cbPktHdr; int rc = virtioCoreR3VirtqAvailBufGet(pDevIns, &pThis->Virtio, pRxVirtq->uIdx, pVirtqBuf, true); +#ifdef VIRTIO_REL_INFO_DUMP + if (rc == VERR_INVALID_STATE) + return virtioNetAttemptToRecover(pDevIns); + if (rc == VERR_NOT_AVAILABLE) + return VINF_SUCCESS; +#endif /* VIRTIO_REL_INFO_DUMP */ AssertMsgReturn(rc == VINF_SUCCESS || rc == VERR_NOT_AVAILABLE, ("%Rrc\n", rc), rc); AssertMsgReturn(rc == VINF_SUCCESS && pVirtqBuf->cbPhysReturn, ("Not enough Rx buffers in queue to accomodate ethernet packet\n"), @@ -2052,6 +2117,12 @@ static int virtioNetR3CopyRxPktToGuest(PPDMDEVINS pDevIns, PVIRTIONET pThis, PVI PVIRTQBUF pVirtqBuf = &VirtqBuf; int rc = virtioCoreR3VirtqAvailBufGet(pDevIns, &pThis->Virtio, pRxVirtq->uIdx, pVirtqBuf, true); +#ifdef VIRTIO_REL_INFO_DUMP + if (rc == VERR_INVALID_STATE) + return virtioNetAttemptToRecover(pDevIns); + if (rc == VERR_NOT_AVAILABLE) + return VINF_SUCCESS; +#endif /* VIRTIO_REL_INFO_DUMP */ AssertMsgReturn(rc == VINF_SUCCESS || rc == VERR_NOT_AVAILABLE, ("%Rrc\n", rc), rc); AssertMsgReturn(rc == VINF_SUCCESS && pVirtqBuf->cbPhysReturn, ("Not enough Rx buffers or capacity to accommodate ethernet packet\n"), @@ -2079,6 +2150,10 @@ static int virtioNetR3CopyRxPktToGuest(PPDMDEVINS pDevIns, PVIRTIONET pThis, PVI return rc; } STAM_PROFILE_STOP(&pThis->StatReceiveStore, a); +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicXchgBool(&pThis->Virtio.fRecovering, false)) + LogRel(("[%s] Recovery complete on successfully receiving a packet\n", pThis->szInst)); +#endif /* VIRTIO_REL_INFO_DUMP */ return VINF_SUCCESS; } @@ -2720,6 +2795,10 @@ static int virtioNetR3TransmitPkts(PPDMDEVINS pDevIns, PVIRTIONET pThis, PVIRTIO int cPkts = virtioCoreVirtqAvailBufCount(pVirtio->pDevInsR3, pVirtio, pTxVirtq->uIdx); if (!cPkts) { +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicReadBool(&pThis->Virtio.fRecovering)) + LogRel(("[%s] No packets to send found on %s\n", pThis->szInst, pTxVirtq->szName)); +#endif /* VIRTIO_REL_INFO_DUMP */ LogFunc(("[%s] No packets to send found on %s\n", pThis->szInst, pTxVirtq->szName)); if (pDrv) @@ -2728,6 +2807,10 @@ static int virtioNetR3TransmitPkts(PPDMDEVINS pDevIns, PVIRTIONET pThis, PVIRTIO ASMAtomicWriteU32(&pThis->uIsTransmitting, 0); return VERR_MISSING; } +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicReadBool(&pThis->Virtio.fRecovering)) + LogRel(("[%s] About to transmit %d pending packet%c\n", pThis->szInst, cPkts, cPkts == 1 ? ' ' : 's')); +#endif /* VIRTIO_REL_INFO_DUMP */ LogFunc(("[%s] About to transmit %d pending packet%c\n", pThis->szInst, cPkts, cPkts == 1 ? ' ' : 's')); virtioNetR3SetWriteLed(pThisCC, true); @@ -2858,6 +2941,23 @@ static int virtioNetR3TransmitPkts(PPDMDEVINS pDevIns, PVIRTIONET pThis, PVIRTIO && IS_VIRTQ_EMPTY(pDevIns, &pThis->Virtio, pTxVirtq->uIdx)) virtioCoreVirtqEnableNotify(&pThis->Virtio, pTxVirtq->uIdx, true /* fEnable */); } +#ifdef VIRTIO_REL_INFO_DUMP + if (rc == VERR_INVALID_STATE) + { + /* + * Our best bet for recovering from a bad queue state is to do a device reset, but + * it is not enough because NetKVM driver does not complete NBLs on reset. We need to lower + * the link in order to prevent adding new descriptors to the TX queue first. Then we + * need to simulate processing of all outstanding descriptor chains by simply copying + * all head indices from avail to used ring. Note that we have only 'peeked' into the avail + * ring, so the avail index should not have moved yet. This is not the case for other queues. + */ + virtioNetAttemptToRecover(pDevIns); + virtioCorePutAllAvailBufsToUsedRing(pDevIns, &pThis->Virtio, pTxVirtq->uIdx); + } + else if (ASMAtomicXchgBool(&pThis->Virtio.fRecovering, false)) + LogRel(("[%s] Recovery complete on successfully transmitting a packet\n", pThis->szInst)); +#endif /* VIRTIO_REL_INFO_DUMP */ virtioNetR3SetWriteLed(pThisCC, false); if (pDrv) @@ -2890,7 +2990,22 @@ static DECLCALLBACK(void) virtioNetR3LinkUpTimer(PPDMDEVINS pDevIns, TMTIMERHAND PVIRTIONET pThis = PDMDEVINS_2_DATA(pDevIns, PVIRTIONET); PVIRTIONETCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PVIRTIONETCC); +#ifdef VIRTIO_REL_INFO_DUMP + if (RT_UNLIKELY(!pThis->fVirtioReady)) + { + if (ASMAtomicXchgBool(&pThis->Virtio.fRecovering, false)) + { + LogRel(("[%s] Recovery failed, VM reset is needed!\n", pThis->szInst)); + return; + } + } +#endif /* VIRTIO_REL_INFO_DUMP */ + SET_LINK_UP(pThis); +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicReadBool(&pThis->Virtio.fRecovering)) + LogRel(("[%s] Link is up\n", pThis->szInst)); +#endif /* VIRTIO_REL_INFO_DUMP */ virtioNetWakeupRxBufWaiter(pDevIns); if (pThisCC->pDrv) @@ -3139,6 +3254,13 @@ static DECLCALLBACK(int) virtioNetR3WorkerThread(PPDMDEVINS pDevIns, PPDMTHREAD VIRTQBUF_T VirtqBuf; PVIRTQBUF pVirtqBuf = &VirtqBuf; int rc = virtioCoreR3VirtqAvailBufGet(pDevIns, &pThis->Virtio, pVirtq->uIdx, pVirtqBuf, true); +#ifdef VIRTIO_REL_INFO_DUMP + if (rc == VERR_INVALID_STATE) + { + virtioNetAttemptToRecover(pDevIns); + continue; + } +#endif /* VIRTIO_REL_INFO_DUMP */ if (rc == VERR_NOT_AVAILABLE) { Log10Func(("[%s] %s worker woken. Nothing found in queue\n", pThis->szInst, pVirtq->szName)); @@ -3204,6 +3326,10 @@ static DECLCALLBACK(void) virtioNetR3StatusChg(PVIRTIOCORE pVirtio, PVIRTIOCOREC } else { +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicReadBool(&pThis->Virtio.fRecovering)) + LogRel(("[%s] Resetting...\n", pThis->szInst)); +#endif /* VIRTIO_REL_INFO_DUMP */ Log(("\n%-23s: %s VirtIO is resetting ***\n", __FUNCTION__, pThis->szInst)); pThis->virtioNetConfig.uStatus = pThis->fCableConnected ? VIRTIONET_F_LINK_UP : 0; @@ -3232,6 +3358,11 @@ static DECLCALLBACK(void) virtioNetR3StatusChg(PVIRTIOCORE pVirtio, PVIRTIOCOREC pThis->aVirtqs[uVirtqNbr].fAttachedToVirtioCore = false; } } + +#ifdef VIRTIO_REL_INFO_DUMP + if (pThisCC->pDrv) + pThisCC->pDrv->pfnNotifyLinkChanged(pThisCC->pDrv, pThis->virtioNetConfig.uStatus ? PDMNETWORKLINKSTATE_UP : PDMNETWORKLINKSTATE_DOWN); +#endif /* VIRTIO_REL_INFO_DUMP */ } /** @@ -3242,6 +3373,10 @@ static DECLCALLBACK(void) pfnFeatureNegotiationComplete(PVIRTIOCORE pVirtio, uin PVIRTIONET pThis = PDMDEVINS_2_DATA(pVirtio->pDevInsR3, PVIRTIONET); LogFunc(("[Feature Negotiation Complete] Guest Driver version is: %s\n", fLegacy ? "legacy" : "modern")); +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicReadBool(&pThis->Virtio.fRecovering)) + LogRel(("[%s] Feature Negotiation Complete for %s driver\n", pThis->szInst, fLegacy ? "legacy" : "modern")); +#endif /* VIRTIO_REL_INFO_DUMP */ virtioNetConfigurePktHdr(pThis, fLegacy); virtioNetR3SetVirtqNames(pThis, fLegacy); diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative286.asm b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative286.asm index 3307c98b..45c6ca8d 100644 --- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative286.asm +++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative286.asm @@ -1312,7 +1312,7 @@ section CONST progbits vstart=0x9a align=1 ; size=0xa92 class=DATA group=DGROUP section CONST2 progbits vstart=0xb2c align=1 ; size=0x3fa class=DATA group=DGROUP ; disGetNextSymbol 0xf0b2c LB 0x3fa -> off=0x0 cb=0000000000000012 uValue=00000000000f0b2c 'bios_cvs_version_string' bios_cvs_version_string: ; 0xf0b2c LB 0x12 - db 'VirtualBox 7.1.8', 000h, 000h + db 'VirtualBox 7.1.10', 000h ; disGetNextSymbol 0xf0b3e LB 0x3e8 -> off=0x0 cb=0000000000000008 uValue=00000000000f0b3e '_bios_prefix_string' _bios_prefix_string: ; 0xf0b3e LB 0x8 db 'BIOS: ', 000h, 000h @@ -13465,4 +13465,4 @@ biosorg_check_before_or_at_0FFEEh: ; 0xfff80 LB 0x70 cpu_reset: ; 0xffff0 LB 0x10 jmp far 0f000h:0e05bh ; ea 5b e0 00 f0 ; 0xffff0 orgs.asm:2117 ; disGetNextSymbol 0xffff5 LB 0xb -> off=0xb cb=0000000000000000 uValue=0000000000100000 '_dummy_addr_0x100000' - db 030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fch, 083h + db 030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fch, 05ah diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative286.md5sum b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative286.md5sum index 82d78b26..383ad4ad 100644 --- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative286.md5sum +++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative286.md5sum @@ -1 +1 @@ -1c9c9eede8319eb5a58a1cd1a1a1d8ff *VBoxPcBios286.rom +8e03a660126a6eb7cf21272f92517357 *VBoxPcBios286.rom diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative386.asm b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative386.asm index d157bd47..054e4811 100644 --- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative386.asm +++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative386.asm @@ -1566,7 +1566,7 @@ section CONST progbits vstart=0xf0 align=1 ; size=0xd14 class=DATA group=DGROUP section CONST2 progbits vstart=0xe04 align=1 ; size=0x3fa class=DATA group=DGROUP ; disGetNextSymbol 0xf0e04 LB 0x3fa -> off=0x0 cb=0000000000000012 uValue=00000000000f0e04 'bios_cvs_version_string' bios_cvs_version_string: ; 0xf0e04 LB 0x12 - db 'VirtualBox 7.1.8', 000h, 000h + db 'VirtualBox 7.1.10', 000h ; disGetNextSymbol 0xf0e16 LB 0x3e8 -> off=0x0 cb=0000000000000008 uValue=00000000000f0e16 '_bios_prefix_string' _bios_prefix_string: ; 0xf0e16 LB 0x8 db 'BIOS: ', 000h, 000h @@ -19401,4 +19401,4 @@ biosorg_check_before_or_at_0FFEEh: ; 0xfff80 LB 0x70 cpu_reset: ; 0xffff0 LB 0x10 jmp far 0f000h:0e05bh ; ea 5b e0 00 f0 ; 0xffff0 orgs.asm:2117 ; disGetNextSymbol 0xffff5 LB 0xb -> off=0xb cb=0000000000000000 uValue=0000000000100000 '_dummy_addr_0x100000' - db 030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fch, 010h + db 030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fch, 0e7h diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative386.md5sum b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative386.md5sum index 942715f6..4d625544 100644 --- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative386.md5sum +++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative386.md5sum @@ -1 +1 @@ -cc36c118d0c3651a550c2548dc2517df *VBoxPcBios386.rom +92abd9d7aa1caad12085bc339081a486 *VBoxPcBios386.rom diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative8086.asm b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative8086.asm index 824b63d1..588a06ff 100644 --- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative8086.asm +++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative8086.asm @@ -1283,7 +1283,7 @@ section CONST progbits vstart=0x9a align=1 ; size=0xa92 class=DATA group=DGROUP section CONST2 progbits vstart=0xb2c align=1 ; size=0x3fa class=DATA group=DGROUP ; disGetNextSymbol 0xf0b2c LB 0x3fa -> off=0x0 cb=0000000000000012 uValue=00000000000f0b2c 'bios_cvs_version_string' bios_cvs_version_string: ; 0xf0b2c LB 0x12 - db 'VirtualBox 7.1.8', 000h, 000h + db 'VirtualBox 7.1.10', 000h ; disGetNextSymbol 0xf0b3e LB 0x3e8 -> off=0x0 cb=0000000000000008 uValue=00000000000f0b3e '_bios_prefix_string' _bios_prefix_string: ; 0xf0b3e LB 0x8 db 'BIOS: ', 000h, 000h @@ -13698,4 +13698,4 @@ biosorg_check_before_or_at_0FFEEh: ; 0xfff80 LB 0x70 cpu_reset: ; 0xffff0 LB 0x10 jmp far 0f000h:0e05bh ; ea 5b e0 00 f0 ; 0xffff0 orgs.asm:2117 ; disGetNextSymbol 0xffff5 LB 0xb -> off=0xb cb=0000000000000000 uValue=0000000000100000 '_dummy_addr_0x100000' - db 030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fbh, 025h + db 030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fbh, 0fch diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative8086.md5sum b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative8086.md5sum index 662064f6..61b8e43b 100644 --- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative8086.md5sum +++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative8086.md5sum @@ -1 +1 @@ -df102e2b6e2cb7be6efe290ed2ee033a *VBoxPcBios8086.rom +1abccb29e5f0e3fc5a701a5982264143 *VBoxPcBios8086.rom diff --git a/src/VBox/Devices/VirtIO/VirtioCore.cpp b/src/VBox/Devices/VirtIO/VirtioCore.cpp index 65f9f0ed..a1d84038 100644 --- a/src/VBox/Devices/VirtIO/VirtioCore.cpp +++ b/src/VBox/Devices/VirtIO/VirtioCore.cpp @@ -47,6 +47,9 @@ #include #include "VirtioCore.h" +#ifdef VIRTIO_REL_INFO_DUMP +#include +#endif /* VIRTIO_REL_INFO_DUMP */ /********************************************************************************************************************************* * Defined Constants And Macros * @@ -632,6 +635,74 @@ DECLINLINE(void) virtioCoreR3DescInfo(PCDBGFINFOHLP pHlp, PVIRTQ_DESC_T pDesc, u pDesc->cb, pDesc->GCPhysBuf, cszTail); } +#ifdef VIRTIO_REL_INFO_DUMP +DECLHIDDEN(void) virtioCoreR3DumpAvailRing(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, PVIRTIOCORE pVirtio, PVIRTQUEUE pVirtq) +{ + uint16_t auTmp[VIRTQ_SIZE]; + virtioCoreGCPhysRead(pVirtio, pDevIns, + pVirtq->GCPhysVirtqAvail + RT_UOFFSETOF_DYN(VIRTQ_AVAIL_T, auRing[0]), + auTmp, pVirtq->uQueueSize * sizeof(uint16_t)); + pHlp->pfnPrintf(pHlp, " avail ring dump:\n%.*RhXd\n", pVirtq->uQueueSize * sizeof(uint16_t), auTmp, + pVirtq->GCPhysVirtqAvail + RT_UOFFSETOF_DYN(VIRTQ_AVAIL_T, auRing[0])); +} + +DECLHIDDEN(void) virtioCoreR3DumpUsedRing(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, PVIRTIOCORE pVirtio, PVIRTQUEUE pVirtq) +{ + VIRTQ_USED_ELEM_T aTmp[VIRTQ_SIZE]; + virtioCoreGCPhysRead(pVirtio, pDevIns, + pVirtq->GCPhysVirtqUsed + RT_UOFFSETOF_DYN(VIRTQ_USED_T, aRing[0]), + aTmp, pVirtq->uQueueSize * sizeof(VIRTQ_USED_ELEM_T)); + pHlp->pfnPrintf(pHlp, " used ring dump:\n%.*RhXd\n", pVirtq->uQueueSize * sizeof(VIRTQ_USED_ELEM_T), aTmp, + pVirtq->GCPhysVirtqUsed + RT_UOFFSETOF_DYN(VIRTQ_USED_T, aRing[0])); +} + +#define VIRTIO_CORE_EVENT_INVALID 0 +#define VIRTIO_CORE_EVENT_AVAIL_GET 1 // pVirtq->uAvailIdxShadow, pVirtqBuf->uHeadIdx +#define VIRTIO_CORE_EVENT_AVAIL_PEEK 2 // pVirtq->uAvailIdxShadow, pVirtqBuf->uHeadIdx +#define VIRTIO_CORE_EVENT_AVAIL_NEXT 3 // pVirtq->uAvailIdxShadow, N/A +#define VIRTIO_CORE_EVENT_USED_PUT 4 // pVirtq->uUsedIdxShadow, pVirtqBuf->uHeadIdx +#define VIRTIO_CORE_EVENT_USED_SYNC 5 // pVirtq->uUsedIdxShadow, N/A + +static const char *virtioCoreEventText[] = { + "none ", + " get avail", + "peek avail", + "next avail", + " put used", + "sync used" +}; + +static void virtioCoreTraceEvent(PVIRTIOCORE pVirtio, PVIRTQUEUE pVirtq, const uint8_t event, uint16_t ringIdx, uint16_t descIdx) +{ + if (pVirtq->uQueueSize) + { + if (event == VIRTIO_CORE_EVENT_AVAIL_NEXT || event == VIRTIO_CORE_EVENT_USED_SYNC) + RTTraceBufAddMsgF(pVirtio->hTraceBuf, "%s: %s[%u]\n", pVirtq->szName, virtioCoreEventText[event], ringIdx % pVirtq->uQueueSize); + else + RTTraceBufAddMsgF(pVirtio->hTraceBuf, "%s: %s[%u]=%u\n", pVirtq->szName, virtioCoreEventText[event], ringIdx % pVirtq->uQueueSize, descIdx); + } + else + { + if (event == VIRTIO_CORE_EVENT_AVAIL_NEXT || event == VIRTIO_CORE_EVENT_USED_SYNC) + RTTraceBufAddMsgF(pVirtio->hTraceBuf, "%s: %s[%u]\n", pVirtq->szName, virtioCoreEventText[event], ringIdx); + else + RTTraceBufAddMsgF(pVirtio->hTraceBuf, "%s: %s[%u]=%u\n", pVirtq->szName, virtioCoreEventText[event], ringIdx, descIdx); + } +} + +static DECLCALLBACK(int) dumpOneEntryToRelLog(RTTRACEBUF hTraceBuf, uint32_t iEntry, uint64_t NanoTS, RTCPUID idCpu, const char *pszMsg, void *pvUser) +{ + RT_NOREF(hTraceBuf, pvUser); + LogRel(("%03u / %llu / %02u / %s", iEntry, NanoTS, idCpu, pszMsg)); + return VINF_SUCCESS; +} + +static inline void virtioCoreDumpTraceBufToRelLog(RTTRACEBUF hTraceBuf) +{ + RTTraceBufEnumEntries(hTraceBuf, dumpOneEntryToRelLog, NULL); +} +#endif /* VIRTIO_REL_INFO_DUMP */ + /** API Fuunction: See header file */ DECLHIDDEN(void) virtioCoreR3VirtqInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, PVIRTIOCORE pVirtio, const char *pszArgs, int uVirtq) { @@ -660,6 +731,7 @@ DECLHIDDEN(void) virtioCoreR3VirtqInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, P &uAvailEventIdx, sizeof(uAvailEventIdx)); } +#ifndef VIRTIO_REL_INFO_DUMP VIRTQBUF_T VirtqBuf; PVIRTQBUF pVirtqBuf = &VirtqBuf; RT_ZERO(VirtqBuf); /* Make sure pSgPhysSend and pSgPhysReturn are initialized. */ @@ -674,6 +746,7 @@ DECLHIDDEN(void) virtioCoreR3VirtqInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, P cSendSegs = pVirtqBuf->pSgPhysSend ? pVirtqBuf->pSgPhysSend->cSegs : 0; cReturnSegs = pVirtqBuf->pSgPhysReturn ? pVirtqBuf->pSgPhysReturn->cSegs : 0; } +#endif /* !VIRTIO_REL_INFO_DUMP */ bool fAvailNoInterrupt = virtioReadAvailRingFlags(pDevIns, pVirtio, pVirtq) & VIRTQ_AVAIL_F_NO_INTERRUPT; bool fUsedNoNotify = virtioReadUsedRingFlags(pDevIns, pVirtio, pVirtq) & VIRTQ_USED_F_NO_NOTIFY; @@ -694,6 +767,7 @@ DECLHIDDEN(void) virtioCoreR3VirtqInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, P pHlp->pfnPrintf(pHlp, " shadow: ............... %d (%d)\n", pVirtq->uQueueSize ? uUsedIdxShadow % pVirtq->uQueueSize : uUsedIdxShadow, uUsedIdxShadow); pHlp->pfnPrintf(pHlp, " flags: ................ %s\n", fUsedNoNotify ? "NO_NOTIFY" : ""); pHlp->pfnPrintf(pHlp, "\n"); +#ifndef VIRTIO_REL_INFO_DUMP if (!fEmpty) { pHlp->pfnPrintf(pHlp, " desc chain:\n"); @@ -718,6 +792,7 @@ DECLHIDDEN(void) virtioCoreR3VirtqInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, P } } else pHlp->pfnPrintf(pHlp, " no desc chains available\n"); +#endif /* !VIRTIO_REL_INFO_DUMP */ pHlp->pfnPrintf(pHlp, "\n"); /* Avoid handling zero-sized queues, there is nothing to show anyway. */ @@ -782,6 +857,12 @@ DECLHIDDEN(void) virtioCoreR3VirtqInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, P pHlp->pfnPrintf(pHlp, " ------ - ----------- ---------------- ------- -------- ------------------\n"); for (uint16_t i = 0; i < pVirtq->uQueueSize; i++) virtioCoreR3DescInfo(pHlp, &descTable[i], i, aszTails[i]); +#ifdef VIRTIO_REL_INFO_DUMP + pHlp->pfnPrintf(pHlp, "\n"); + virtioCoreR3DumpAvailRing(pDevIns, pHlp, pVirtio, pVirtq); + pHlp->pfnPrintf(pHlp, "\n"); + virtioCoreR3DumpUsedRing(pDevIns, pHlp, pVirtio, pVirtq); +#endif /* VIRTIO_REL_INFO_DUMP */ } @@ -889,10 +970,78 @@ DECLHIDDEN(int) virtioCoreR3VirtqAvailBufNext(PVIRTIOCORE pVirtio, uint16_t uVir Log6Func(("%s avail shadow idx: %u\n", pVirtq->szName, pVirtq->uAvailIdxShadow)); pVirtq->uAvailIdxShadow++; +#ifdef VIRTIO_REL_INFO_DUMP + virtioCoreTraceEvent(pVirtio, pVirtq, VIRTIO_CORE_EVENT_AVAIL_NEXT, pVirtq->uAvailIdxShadow, 0); +#endif /* VIRTIO_REL_INFO_DUMP */ return VINF_SUCCESS; } +#ifdef VIRTIO_REL_INFO_DUMP +DECLCALLBACK(void) virtioNetR3Info(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs); + +static DECLCALLBACK(void) dbgVirtio_Printf(PCDBGFINFOHLP pHlp, const char *pszFormat, ...) +{ + RT_NOREF(pHlp); + va_list va; + va_start(va, pszFormat); + RTLogRelPrintfV(pszFormat, va); + va_end(va); +} + + +static DECLCALLBACK(void) dbgVirtio_PrintfV(PCDBGFINFOHLP pHlp, const char *pszFormat, va_list args) +{ + RT_NOREF(pHlp); + RTLogRelPrintfV(pszFormat, args); +} + + +/** + * @interface_method_impl{DBGCCMDHLP,pfnGetDbgfOutputHlp} + */ +static void dbgVirtioDump(PPDMDEVINS pDevIns) +{ + PVIRTIOCORE pVirtio = PDMINS_2_DATA(pDevIns, PVIRTIOCORE); + LogRel(("dbgVirtioDump(%s)\n", pVirtio->szInstance)); + if (RTStrNCmp("virtio-net", pVirtio->szInstance, 10) == 0) + { + DBGFINFOHLP DbgHlp; + + DbgHlp.pfnPrintf = dbgVirtio_Printf; + DbgHlp.pfnPrintfV = dbgVirtio_PrintfV; + DbgHlp.pfnGetOptError = NULL; + + virtioNetR3Info(pDevIns, &DbgHlp, "a"); // Print everything! + } +} + +/** Temporary API function: See Header file */ +void virtioCorePutAllAvailBufsToUsedRing(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t uVirtq) +{ + PVIRTQUEUE pVirtq = &pVirtio->aVirtqueues[uVirtq]; + uint16_t uStartAvailIdx = pVirtq->uAvailIdxShadow; + uint16_t uStartUsedIdx = pVirtq->uUsedIdxShadow; + + /* + * Copy chain head indices from avail to used, specifying zero processed length, which should be ok + * for TX queue of virtio-net only! + */ + while (pVirtq->uAvailIdxShadow != virtioReadAvailRingIdx(pDevIns, pVirtio, pVirtq)) + virtioWriteUsedElem(pDevIns, pVirtio, pVirtq, pVirtq->uUsedIdxShadow++, + virtioReadAvailDescIdx(pDevIns, pVirtio, pVirtq, pVirtq->uAvailIdxShadow++), 0); + + if (pVirtq->uAvailIdxShadow != uStartAvailIdx) + { + LogRel(("[%s] Copied indices for %s [avail(%u:%u) -> used(%u:%u)]\n", pVirtio->szInstance, pVirtq->szName, + uStartAvailIdx, pVirtq->uAvailIdxShadow - 1, uStartUsedIdx, pVirtq->uUsedIdxShadow - 1)); + virtioWriteUsedRingIdx(pDevIns, pVirtio, pVirtq, pVirtq->uUsedIdxShadow); + virtioCoreNotifyGuestDriver(pDevIns, pVirtio, uVirtq); + } + else + LogRel(("[%s] Avail ring is empty for %s, nothing to copy.\n", pVirtio->szInstance, pVirtq->szName)); +} +#endif /* VIRTIO_REL_INFO_DUMP */ /** API Function: See header file */ DECLHIDDEN(int) virtioCoreR3VirtqAvailBufGet(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t uVirtq, uint16_t uHeadIdx, PVIRTQBUF pVirtqBuf) @@ -940,20 +1089,39 @@ DECLHIDDEN(int) virtioCoreR3VirtqAvailBufGet(PPDMDEVINS pDevIns, PVIRTIOCORE pVi * linked descriptors exceeding the total number of descriptors in the ring (see @bugref{8620}), * the following aborts I/O if breach and employs a simple log throttling algorithm to notify. */ +#ifdef VIRTIO_REL_INFO_DUMP + if (cSegsIn + cSegsOut >= pVirtq->uQueueSize || ASMAtomicCmpXchgBool(&pVirtio->fTestRecovery, false, true)) + { + static volatile uint32_t s_cMessages = 0; + if (ASMAtomicIncU32(&s_cMessages) <= 10) + { + LogRel(("Too many linked descriptors; check if the guest arranges descriptors in a loop " + "(cSegsIn=%u cSegsOut=%u uQueueSize=%u uDescIdx=%u uHeadIdx=%u uAvailIdxShadow=%u queue=%s).\n", + cSegsIn, cSegsOut, pVirtq->uQueueSize, uDescIdx, pVirtqBuf->uHeadIdx, pVirtq->uAvailIdxShadow, pVirtq->szName)); + virtioCoreDumpTraceBufToRelLog(pVirtio->hTraceBuf); + dbgVirtioDump(pDevIns); + } + /* Disable the queue to prevent its operation until it is re-initialized. */ + pVirtq->uEnable = false; + return VERR_INVALID_STATE; + } +#else /* !VIRTIO_REL_INFO_DUMP */ if (cSegsIn + cSegsOut >= pVirtq->uQueueSize) { static volatile uint32_t s_cMessages = 0; static volatile uint32_t s_cThreshold = 1; if (ASMAtomicIncU32(&s_cMessages) == ASMAtomicReadU32(&s_cThreshold)) { - LogRelMax(64, ("Too many linked descriptors; check if the guest arranges descriptors in a loop (cSegsIn=%u cSegsOut=%u uQueueSize=%u uDescIdx=%u queue=%s).\n", - cSegsIn, cSegsOut, pVirtq->uQueueSize, uDescIdx, pVirtq->szName)); + LogRelMax(64, ("Too many linked descriptors; check if the guest arranges descriptors in a loop " + "(cSegsIn=%u cSegsOut=%u uQueueSize=%u uDescIdx=%u uHeadIdx=%u uAvailIdxShadow=%u queue=%s).\n", + cSegsIn, cSegsOut, pVirtq->uQueueSize, uDescIdx, pVirtqBuf->uHeadIdx, pVirtq->uAvailIdxShadow, pVirtq->szName)); if (ASMAtomicReadU32(&s_cMessages) != 1) LogRelMax(64, ("(the above error has occured %u times so far)\n", ASMAtomicReadU32(&s_cMessages))); ASMAtomicWriteU32(&s_cThreshold, ASMAtomicReadU32(&s_cThreshold) * 10); } break; } +#endif /* !VIRTIO_REL_INFO_DUMP */ /* Check if the limit has been reached for input chain (see section 2.4.4.1 of virtio 1.0 spec). */ if (cSegsIn >= RT_ELEMENTS(pVirtqBuf->aSegsIn)) { @@ -1041,6 +1209,9 @@ DECLHIDDEN(int) virtioCoreR3VirtqAvailBufGet(PPDMDEVINS pDevIns, PVIRTIOCORE pVi if (pVirtio->uDriverFeatures & VIRTIO_F_EVENT_IDX) virtioWriteUsedAvailEvent(pDevIns,pVirtio, pVirtq, pVirtq->uAvailIdxShadow + 1); +#ifdef VIRTIO_REL_INFO_DUMP + virtioCoreTraceEvent(pVirtio, pVirtq, fRemove ? VIRTIO_CORE_EVENT_AVAIL_GET : VIRTIO_CORE_EVENT_AVAIL_PEEK, pVirtq->uAvailIdxShadow, uHeadIdx); +#endif /* VIRTIO_REL_INFO_DUMP */ if (fRemove) pVirtq->uAvailIdxShadow++; @@ -1115,6 +1286,9 @@ DECLHIDDEN(int) virtioCoreR3VirtqUsedBufPut(PPDMDEVINS pDevIns, PVIRTIOCORE pVir * @todo r=aeichner: The increment of the shadow index is not atomic but this code can be called * concurrently!! */ +#ifdef VIRTIO_REL_INFO_DUMP + virtioCoreTraceEvent(pVirtio, pVirtq, VIRTIO_CORE_EVENT_USED_PUT, pVirtq->uUsedIdxShadow, pVirtqBuf->uHeadIdx); +#endif /* VIRTIO_REL_INFO_DUMP */ virtioWriteUsedElem(pDevIns, pVirtio, pVirtq, pVirtq->uUsedIdxShadow++, pVirtqBuf->uHeadIdx, (uint32_t)cbTotal); #ifdef LOG_ENABLED @@ -1195,6 +1369,9 @@ DECLHIDDEN(int) virtioCoreR3VirtqUsedBufPut(PPDMDEVINS pDevIns, PVIRTIOCORE pVir Log6Func((" Enqueue desc chain head idx %u to %s used ring @ %u\n", pVirtqBuf->uHeadIdx, VIRTQNAME(pVirtio, uVirtq), pVirtq->uUsedIdxShadow)); +#ifdef VIRTIO_REL_INFO_DUMP + virtioCoreTraceEvent(pVirtio, pVirtq, VIRTIO_CORE_EVENT_USED_PUT, pVirtq->uUsedIdxShadow, pVirtqBuf->uHeadIdx); +#endif /* VIRTIO_REL_INFO_DUMP */ virtioWriteUsedElem(pDevIns, pVirtio, pVirtq, pVirtq->uUsedIdxShadow++, pVirtqBuf->uHeadIdx, (uint32_t)cbEnqueue); #ifdef LOG_ENABLED @@ -1229,6 +1406,12 @@ DECLHIDDEN(int) virtioCoreVirtqUsedRingSync(PPDMDEVINS pDevIns, PVIRTIOCORE pVir Log6Func((" Sync %s used ring (%u -> idx)\n", pVirtq->szName, pVirtq->uUsedIdxShadow)); +#ifdef IN_RING3 + // I believe virtioCoreVirtqUsedRingSync is only called from ring 3 in virtio-net +#ifdef VIRTIO_REL_INFO_DUMP + virtioCoreTraceEvent(pVirtio, pVirtq, VIRTIO_CORE_EVENT_USED_SYNC, pVirtq->uUsedIdxShadow, 0); +#endif /* VIRTIO_REL_INFO_DUMP */ +#endif /* IN_RING3 */ virtioWriteUsedRingIdx(pDevIns, pVirtio, pVirtq, pVirtq->uUsedIdxShadow); virtioCoreNotifyGuestDriver(pDevIns, pVirtio, uVirtq); @@ -1331,6 +1514,11 @@ static void virtioCoreNotifyGuestDriver(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, */ static int virtioNudgeGuest(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint8_t uCause, uint16_t uMsixVector) { +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicReadBool(&pVirtio->fRecovering)) + LogRel(("[%s] Raising%s interrupt, because of %s\n", pVirtio->szInstance, pVirtio->fMsiSupport ? " MSI" : "", + uCause == VIRTIO_ISR_VIRTQ_INTERRUPT ? "added buffer" : "config change")); +#endif /* VIRTIO_REL_INFO_DUMP */ if (uCause == VIRTIO_ISR_VIRTQ_INTERRUPT) Log6Func(("Reason for interrupt - buffer added to 'used' ring.\n")); else @@ -1559,6 +1747,15 @@ static int virtioCommonCfgAccessed(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, PVIR uint16_t uVirtq = pVirtio->uVirtqSelect; int rc = VINF_SUCCESS; uint64_t val; +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicReadBool(&pVirtio->fRecovering)) + { + if (fWrite) + LogRel(("[%s] writes %u bytes @ cmn cfg + %u: %.*Rhxs\n", pVirtio->szInstance, cb, uOffsetOfAccess, cb, pv)); + else + LogRel(("[%s] attempts to read %u bytes @ cmn cfg + %u\n", pVirtio->szInstance, cb, uOffsetOfAccess)); + } +#endif /* VIRTIO_REL_INFO_DUMP */ if (VIRTIO_DEV_CONFIG_MATCH_MEMBER(uDeviceFeatures, VIRTIO_PCI_COMMON_CFG_T, uOffsetOfAccess)) { if (fWrite) /* Guest WRITE pCommonCfg>uDeviceFeatures */ @@ -1724,6 +1921,10 @@ static int virtioCommonCfgAccessed(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, PVIR fWrite ? "write" : "read ", uOffsetOfAccess, uOffsetOfAccess, cb)); return fWrite ? VINF_SUCCESS : VINF_IOM_MMIO_UNUSED_00; } +#ifdef VIRTIO_REL_INFO_DUMP + if (ASMAtomicReadBool(&pVirtio->fRecovering) && !fWrite) + LogRel(("[%s] read %u bytes @ cmn cfg + %u: %.*Rhxs\n", pVirtio->szInstance, cb, uOffsetOfAccess, cb, pv)); +#endif /* VIRTIO_REL_INFO_DUMP */ #ifndef IN_RING3 RT_NOREF(pDevIns, pVirtioCC); @@ -2794,6 +2995,10 @@ DECLHIDDEN(void) virtioCoreR3VmStateChanged(PVIRTIOCORE pVirtio, VIRTIOVMSTATECH */ DECLHIDDEN(void) virtioCoreR3Term(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, PVIRTIOCORECC pVirtioCC) { +#ifdef VIRTIO_REL_INFO_DUMP + RTTraceBufRelease(pVirtio->hTraceBuf); + pVirtio->hTraceBuf = NIL_RTTRACEBUF; +#endif /* VIRTIO_REL_INFO_DUMP */ if (pVirtioCC->pbPrevDevSpecificCfg) { RTMemFree(pVirtioCC->pbPrevDevSpecificCfg); @@ -3150,6 +3355,15 @@ DECLHIDDEN(int) virtioCoreR3Init(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, PVIRTI PDMDevHlpSTAMRegister(pDevIns, &pVirtio->StatWriteRC, STAMTYPE_PROFILE, "IO/WriteRC", STAMUNIT_TICKS_PER_CALL, "Profiling IO writes in RC"); # endif /* VBOX_WITH_STATISTICS */ +#ifdef VIRTIO_REL_INFO_DUMP + pVirtio->fRecovering = false; + pVirtio->fTestRecovery = false; + size_t cbBlock = VIRTIO_CORE_TRACE_BUF_SIZE; + rc = RTTraceBufCarve(&pVirtio->hTraceBuf, 0 /*cEntries*/, 0 /*cbEntry*/, 0 /*fFlags*/, pVirtio->aTraceBuf, &cbBlock); + AssertRC(rc); + if (RT_FAILURE(rc)) + LogRel(("virtioCore: Failed to initialize trace buffer (rc=%d)\n", rc)); +#endif /* VIRTIO_REL_INFO_DUMP */ return VINF_SUCCESS; } diff --git a/src/VBox/Devices/VirtIO/VirtioCore.h b/src/VBox/Devices/VirtIO/VirtioCore.h index 47c21664..4649f20b 100644 --- a/src/VBox/Devices/VirtIO/VirtioCore.h +++ b/src/VBox/Devices/VirtIO/VirtioCore.h @@ -36,6 +36,12 @@ #include #include +/* + * WARNING! NEVER ENABLE IN PRODUCTION BUILDS! + * Enables temporary printouts to release log in descriptor chain handling code. + */ +//#define VIRTIO_REL_INFO_DUMP 1 + #ifdef LOG_ENABLED # define VIRTIO_HEX_DUMP(logLevel, pv, cb, base, title) \ do { \ @@ -457,6 +463,13 @@ typedef struct VIRTIOCORE uint32_t fOfferLegacy; /**< Set at init call from dev-specific code */ uint16_t uIrqMmio; /**< The interrupt number when Virtio-over-MMIO is used */ uint8_t uDeviceType; /**< The implemented device type for Virtio-over-MMIO */ +#ifdef VIRTIO_REL_INFO_DUMP + bool fRecovering; + bool fTestRecovery; +#define VIRTIO_CORE_TRACE_BUF_SIZE (256 /* header */ + 256 * 256 /* buffer*/) + RTTRACEBUF hTraceBuf; + uint8_t aTraceBuf[VIRTIO_CORE_TRACE_BUF_SIZE]; +#endif /* VIRTIO_REL_INFO_DUMP */ /** @name The locations of the capability structures in PCI config space and the BAR. * @{ */ @@ -782,6 +795,19 @@ DECLHIDDEN(void) virtioCoreR3VirtqInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, P */ DECLHIDDEN(uint16_t) virtioCoreVirtqAvailBufCount(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t uVirtqNbr); +#ifdef VIRTIO_REL_INFO_DUMP +/** + * Copies all available chains to used ring. Only indices of chains are copied, not the chains + * themselves. This can only be done for virtionet TX ring to work around the issue in NetKVM + * driver, which does not complete NBLs on device reset, if these NBLs are already in 'avail' ring. + * + * @param pDevIns The device instance. + * @param pVirtio Pointer to the shared virtio state. + * @param uVirtqNbr Virtqueue to modify. + */ +void virtioCorePutAllAvailBufsToUsedRing(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t uVirtqNbr); +#endif /* VIRTIO_REL_INFO_DUMP */ + /** * This function is identical to virtioCoreR3VirtqAvailBufGet(), *except* it doesn't consume * peeked buffer from avail ring of the virtq. The function *becomes* identical to the diff --git a/src/VBox/Disassembler/testcase/tstDisasmArmv8-1.cpp b/src/VBox/Disassembler/testcase/tstDisasmArmv8-1.cpp index 3e479c61..51c73ca8 100644 --- a/src/VBox/Disassembler/testcase/tstDisasmArmv8-1.cpp +++ b/src/VBox/Disassembler/testcase/tstDisasmArmv8-1.cpp @@ -121,7 +121,7 @@ static const RTSCRIPTLEXCFG s_LexCfg = /** pszDesc */ "ARMv8 disassembler lexer", /** fFlags */ - RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE, + RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_LOWER, /** pszWhitespace */ NULL, /** pszNewline */ @@ -173,7 +173,7 @@ static void testDisas(const char *pszSub, uint8_t const *pabInstrs, uintptr_t uE int rc = RTScriptLexCreateFromReader(&hLexSource, testDisasmLexerRead, NULL /*pfnDtor*/, &Rdr /*pvUser*/, cbSrc, NULL /*phStrCacheId*/, NULL /*phStrCacheStringLit*/, - &s_LexCfg); + NULL /*phStrCacheComments*/, &s_LexCfg); RTTESTI_CHECK_RC(rc, VINF_SUCCESS); if (RT_FAILURE(rc)) return; /* Can't do our work if this fails. */ @@ -227,7 +227,8 @@ static void testDisas(const char *pszSub, uint8_t const *pabInstrs, uintptr_t uE /* Build the lexer and compare that it semantically is equal to the source input. */ RTSCRIPTLEX hLexDis = NULL; rc = RTScriptLexCreateFromString(&hLexDis, szOutput, NULL /*phStrCacheId*/, - NULL /*phStrCacheStringLit*/, &s_LexCfg); + NULL /*phStrCacheStringLit*/, NULL /*phStrCacheComments*/, + &s_LexCfg); RTTESTI_CHECK_RC(rc, VINF_SUCCESS); if (RT_SUCCESS(rc)) { @@ -484,13 +485,14 @@ static void testDisasComplianceAgaistCapstone(void) rc = RTScriptLexCreateFromReader(&hLexCapstone, testDisasmLexerRead, NULL /*pfnDtor*/, &Rdr /*pvUser*/, 0 /*cchBuf*/, NULL /*phStrCacheId*/, NULL /*phStrCacheStringLit*/, - &s_LexCfg); + NULL /*phStrCacheComments*/, &s_LexCfg); RTTESTI_CHECK_RC(rc, VINF_SUCCESS); /* Build the lexer and compare that it semantically is equal to the source input. */ RTSCRIPTLEX hLexDis = NULL; rc = RTScriptLexCreateFromString(&hLexDis, szOutput, NULL /*phStrCacheId*/, - NULL /*phStrCacheStringLit*/, &s_LexCfg); + NULL /*phStrCacheStringLit*/, NULL /*phStrCacheComments*/, + &s_LexCfg); RTTESTI_CHECK_RC(rc, VINF_SUCCESS); if (RT_SUCCESS(rc)) { diff --git a/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp b/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp index 1764bd03..fea0651b 100644 --- a/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp +++ b/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp @@ -424,10 +424,6 @@ void UIVisoContentBrowser::createVisoEntry(const QString &strPath, const QString /* static */ QString UIVisoContentBrowser::sanitizePath(const QString &strOriginal) { - /* Look for white space and double quote: */ - QRegularExpression regex("[\\s\"]"); - if (!regex.match(strOriginal).hasMatch()) - return strOriginal; QString strNew(strOriginal); strNew.replace("\"", "\\\""); strNew.append("\""); @@ -442,8 +438,8 @@ QStringList UIVisoContentBrowser::entryList() { if (iterator.value().isEmpty()) continue; - QString strEntry = QString("%1=%2").arg(sanitizePath(iterator.key())).arg(sanitizePath(iterator.value())); - entryList << strEntry; + QString strEntry = QString("%1=%2").arg(iterator.key()).arg(iterator.value()); + entryList << sanitizePath(strEntry); } return entryList; } @@ -897,43 +893,51 @@ void UIVisoContentBrowser::parseVisoFileContent(const QString &strFileName) return; QTextStream stream(&file); QString strFileContent = stream.readAll(); - strFileContent.replace(' ', '\n'); QMap fileEntries; - QStringList removedEntries; - foreach (const QString &strPart, strFileContent.split("\n", Qt::SkipEmptyParts)) + strFileContent.replace('\'', '\"'); + bool fInsideQuotes = false; + /* Replace spaces with new lines expect those within quotes: */ + for (int i = 0; i < strFileContent.length(); ++i) { - const QStringList fileEntry = strPart.split("=", Qt::SkipEmptyParts); - /* We currently do not support different on-ISO names for different namespaces. */ - if (strPart.startsWith("/") && strPart.count('=') <= 1) + if (strFileContent[i] == '\"') + fInsideQuotes = !fInsideQuotes; + if (strFileContent[i] == ' ' && !fInsideQuotes) + strFileContent[i] = '\n'; + } + QStringList removedEntries; + QStringList lines = strFileContent.split('\n', Qt::SkipEmptyParts); + for (int i = 0; i < lines.size(); ++i) + { + const QString &strLine = lines[i]; + if (strLine.count('=') == 1) { - if (fileEntry.size() == 1) + /* file-mode and dir-mode. something for later to deal with: */ + if (strLine.contains("file-mode") || strLine.contains("dir-mode")) + continue; + QStringList lineParts = strLine.split('='); + if (lineParts.size() == 2) { - QFileInfo fileInfo(fileEntry[0]); - if (fileInfo.exists()) + if (lineParts[1].contains("must-remove")) { - QString isoName = QString("/%1").arg(fileInfo.fileName()); - fileEntries[isoName] = fileEntry[0]; + removedEntries << lineParts[0]; + } + else + { + lineParts[0].remove('\"'); + lineParts[1].remove('\"'); + /* Check if target file structure exists: */ + if (QFileInfo(lineParts[1]).exists()) + fileEntries[lineParts[0]] = lineParts[1]; } } - else if (fileEntry.size() == 2) - { - if (QFileInfo(fileEntry[1]).exists()) - fileEntries[fileEntry[0]] = fileEntry[1]; - else if (fileEntry[1] == cRemoveText) - removedEntries.append(fileEntry[0]); - - } + continue; } - else + if (strLine.contains("import-iso") && i + 1 < lines.size()) { - if(fileEntry.size() == 2 && fileEntry[0].contains("import-iso", Qt::CaseInsensitive)) - { - if (QFileInfo(fileEntry[1]).exists()) - importISOContentToViso(fileEntry[1]); - } + if (QFileInfo(lines[i+1]).exists()) + importISOContentToViso(lines[i+1]); } } - file.close(); createLoadedFileEntries(fileEntries); processRemovedEntries(removedEntries); } @@ -974,7 +978,7 @@ void UIVisoContentBrowser::createLoadedFileEntries(const QMap pItem->setData(strLocalPath, UIFileSystemModelData_LocalPath); /* Pre-scan and populate the directory since we may need its content while processing removed items: */ if (enmObjectType == KFsObjType_Directory) - scanHostDirectory(pItem, true /* recursive */); + scanHostDirectory(pItem, false /* recursive */); } if (i == pathList.size() - 1) createVisoEntry(pItem->path(), pItem->data(UIFileSystemModelData_LocalPath).toString(), false); @@ -1067,13 +1071,17 @@ void UIVisoContentBrowser::scanHostDirectory(UIFileSystemItem *directoryItem, bo void UIVisoContentBrowser::updateStartItemName() { - if (!rootItem() || !rootItem()->child(0)) + UIFileSystemItem *pRoot = rootItem(); + if (!pRoot) + return; + UIFileSystemItem *pChild = pRoot->child(0); + if (!pChild) return; const QString strName(QDir::toNativeSeparators("/")); - rootItem()->child(0)->setData(strName, UIFileSystemModelData_Name); + pChild->setData(strName, UIFileSystemModelData_Name); /* If the table root index is the start item then we have to update the location selector text here: */ - // if (m_pProxyModel->mapToSource(m_pTableView->rootIndex()).internalPointer() == rootItem()->child(0)) + // if (m_pProxyModel->mapToSource(m_pTableView->rootIndex()).internalPointer() == pChild) // updateLocationSelectorText(strName); m_pProxyModel->invalidate(); } @@ -1137,10 +1145,14 @@ void UIVisoContentBrowser::sltTableSelectionChanged(const QItemSelection &select void UIVisoContentBrowser::sltResetAction() { - if (!rootItem() || !rootItem()->child(0)) + UIFileSystemItem *pRoot = rootItem(); + if (!pRoot) + return; + UIFileSystemItem *pChild = pRoot->child(0); + if (!pChild) return; goToStart(); - rootItem()->child(0)->removeChildren(); + pChild->removeChildren(); m_entryMap.clear(); if (m_pProxyModel) m_pProxyModel->invalidate(); diff --git a/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.h b/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.h index 8cd5e132..294eb1a6 100644 --- a/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.h +++ b/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.h @@ -62,6 +62,7 @@ signals: void sigTableSelectionChanged(bool fIsSelectionEmpty); void sigISOContentImportedOrRemoved(bool fImportedr); + void sigVolumeIdParsed(const QString &strVoludId); public: diff --git a/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp b/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp index 46787191..5b6ff274 100644 --- a/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp +++ b/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp @@ -374,7 +374,7 @@ void UIVisoCreatorWidget::setVisoFilePath(const QString& strPath) { if (m_strVisoFilePath == strPath) return; - m_strVisoFilePath = strPath; + m_strVisoFilePath = QDir::fromNativeSeparators(QDir::cleanPath(strPath)); emit sigVisoFilePathChanged(m_strVisoFilePath); } @@ -439,7 +439,11 @@ void UIVisoCreatorWidget::sltOpenAction() QString strFileName = QIFileDialog::getOpenFileName(UIMediumTools::defaultFolderPathForType(UIMediumDeviceType_DVD), "VISO files (*.viso)", pActive, UIVisoCreatorWidget::tr("Select a VISO file to load")); if (!strFileName.isEmpty() && m_pVISOContentBrowser) + { + setVisoFilePath(QFileInfo(strFileName).absolutePath()); + setVisoName(QFileInfo(strFileName).baseName()); m_pVISOContentBrowser->parseVisoFileContent(strFileName); + } } void UIVisoCreatorWidget::sltSaveAsAction() @@ -485,6 +489,11 @@ void UIVisoCreatorWidget::sltISOContentImportedOrRemoved(bool fImported) m_pRemoveISOAction->setEnabled(fImported); } +void UIVisoCreatorWidget::sltVisoVolumeIdParsed(const QString &strVolumeId) +{ + setVisoName(strVolumeId); +} + void UIVisoCreatorWidget::sltSettingsChanged() { AssertReturnVoid(m_pSettingsWidget); @@ -591,6 +600,8 @@ void UIVisoCreatorWidget::prepareConnections() this, &UIVisoCreatorWidget::sltContentBrowserTableSelectionChanged); connect(m_pVISOContentBrowser, &UIVisoContentBrowser::sigISOContentImportedOrRemoved, this, &UIVisoCreatorWidget::sltISOContentImportedOrRemoved); + connect(m_pVISOContentBrowser, &UIVisoContentBrowser::sigVolumeIdParsed, + this, &UIVisoCreatorWidget::sltVisoVolumeIdParsed); } if (m_pActionPreferences) @@ -987,7 +998,7 @@ bool UIVisoCreatorDialog::saveVISOFile() stream << QString("%1 %2").arg("--iprt-iso-maker-file-marker-bourne-sh").arg(QUuid::createUuid().toString()) << "\n"; stream<< "--volume-id=" << UIVisoContentBrowser::sanitizePath(strVisoName) << "\n"; if (!strImportedISOPath.isEmpty()) - stream << "--import-iso=" << strImportedISOPath << "\n"; + stream << "--import-iso " << strImportedISOPath << "\n"; stream << VisoEntryList.join("\n"); if (!customOptions().isEmpty()) { diff --git a/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h b/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h index 8f375160..88b2233f 100644 --- a/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h +++ b/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h @@ -134,6 +134,7 @@ private slots: void sltISOContentImportedOrRemoved(bool fImported); void sltSettingsChanged(); void sltPanelContainerHidden(); + void sltVisoVolumeIdParsed(const QString &strVolumeId); private: diff --git a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp index 5eebd602..c1f71661 100644 --- a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp +++ b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp @@ -643,6 +643,9 @@ bool UIMachineSettingsDisplay::validate(QList &messages) m_f3DAccelerationSupported = graphicsControllerTypeCurrent() == KGraphicsControllerType_VBoxSVGA ? UIGuestOSTypeHelpers::isWddmCompatibleOsType(m_strGuestOSTypeId) : false; + /* Special handling for MacOS guests, 3D is NOT available at all: */ + else if (m_strGuestOSTypeId.startsWith("MacOS")) + m_f3DAccelerationSupported = false; /* For the rest of guest OS types 3D is available for VMSVGA only: */ else m_f3DAccelerationSupported = graphicsControllerTypeCurrent() == KGraphicsControllerType_VMSVGA; diff --git a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c index 9e31779c..02d96cc1 100644 --- a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c +++ b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c @@ -1744,10 +1744,17 @@ SUPR0DECL(bool) SUPR0FpuBegin(bool fCtxHook) */ Assert(fCtxHook || !RTThreadPreemptIsEnabled(NIL_RTTHREAD)); kernel_fpu_begin(); -# if 0 /* Always do it for now for better test coverage. */ +# if RTLNX_VER_MIN(6,15,0) /* fpregs_unlock may do more than just preempt_enable, so only when necessary now. */ if (fCtxHook) # endif + { +# if RTLNX_VER_MIN(6,15,0) + if (!irqs_disabled()) + fpregs_unlock(); +# else preempt_enable(); +# endif + } return false; /** @todo Not sure if we have license to use any extended state, or * if we're limited to the SSE & x87 FPU. If it's the former, * we should return @a true and the caller can skip @@ -1765,10 +1772,17 @@ SUPR0DECL(void) SUPR0FpuEnd(bool fCtxHook) #if RTLNX_VER_MIN(4,19,0) /* HACK ALERT! See SUPR0FpuBegin for an explanation of this. */ Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); -# if 0 /* Always do it for now for better test coverage. */ +# if RTLNX_VER_MIN(6,15,0) /* fpregs_unlock may do more than just preempt_enable, so only when necessary now. */ if (fCtxHook) # endif + { +# if RTLNX_VER_MIN(6,15,0) + if (!irqs_disabled()) + fpregs_lock(); +# else preempt_disable(); +# endif + } kernel_fpu_end(); #endif } diff --git a/src/VBox/HostDrivers/Support/win/VBoxSup.inf b/src/VBox/HostDrivers/Support/win/VBoxSup.inf index 7838441b..7accd0fc 100644 --- a/src/VBox/HostDrivers/Support/win/VBoxSup.inf +++ b/src/VBox/HostDrivers/Support/win/VBoxSup.inf @@ -42,7 +42,7 @@ Provider=%ORACLE% ;edit-DriverVer=08/26/2008,2.00.0000 DriverPackageType=KernelService ;cat CatalogFile=VBoxSup.cat -;PnpLockdown=1 +PnpLockdown=1 [DestinationDirs] DefaultDestDir = 12 diff --git a/src/VBox/HostDrivers/VBoxNetAdp/win/VBoxNetAdp6.inf b/src/VBox/HostDrivers/VBoxNetAdp/win/VBoxNetAdp6.inf index 4cbe3003..e53067a4 100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/win/VBoxNetAdp6.inf +++ b/src/VBox/HostDrivers/VBoxNetAdp/win/VBoxNetAdp6.inf @@ -43,6 +43,7 @@ Class = Net ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318} Provider = %ORACLE% ;edit-DriverVer=10/23/2014,1.0.1.0 +PnpLockdown=1 [Manufacturer] diff --git a/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf.inf b/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf.inf index 4d67f6d1..2edcabc3 100644 --- a/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf.inf +++ b/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf.inf @@ -41,6 +41,7 @@ Class = NetService ClassGUID = {4D36E974-E325-11CE-BFC1-08002BE10318} Provider = %ORACLE% ;edit-DriverVer=10/23/2014,1.0.1.0 +PnpLockdown=1 [Manufacturer] diff --git a/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUSB.inf b/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUSB.inf index e8ac22ef..ca70e429 100644 --- a/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUSB.inf +++ b/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUSB.inf @@ -41,7 +41,7 @@ ClassGUID={36FC9E60-C465-11CF-8056-444553540000} provider=%ORACLE% ;edit-DriverVer=08/26/2008,2.00.0000 ;cat CatalogFile=VBoxUSB.cat -;PnpLockdown=1 +PnpLockdown=1 [SourceDisksNames] 1=%VBoxUSB_DiskDesc%,,, @@ -50,7 +50,7 @@ provider=%ORACLE% VBoxUSB.sys = 1 [DestinationDirs] -DefaultDestDir = 10,System32\Drivers +DefaultDestDir = 12 [Manufacturer] %ORACLE%=VBoxUSB@COMMA-NT-ARCH@ diff --git a/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUSBMon.inf b/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUSBMon.inf index 4a572f1c..7bc3d14d 100644 --- a/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUSBMon.inf +++ b/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUSBMon.inf @@ -42,7 +42,7 @@ Provider=%ORACLE% ;edit-DriverVer=08/26/2008,2.00.0000 DriverPackageType=KernelService ;cat CatalogFile=VBoxUSBMon.cat -;PnpLockdown=1 +PnpLockdown=1 [SourceDisksNames] 1=%VBoxUSBMon_DiskDesc%, diff --git a/src/VBox/ImageMounter/vboximg-mount/fuse-calls.h b/src/VBox/ImageMounter/vboximg-mount/fuse-calls.h index f7c6fcee..5233b27e 100644 --- a/src/VBox/ImageMounter/vboximg-mount/fuse-calls.h +++ b/src/VBox/ImageMounter/vboximg-mount/fuse-calls.h @@ -1,3 +1,4 @@ +/* $Id: fuse-calls.h $ */ /** @file * Stubs for dynamically loading libfuse/libosxfuse and the symbols which are needed by * VirtualBox. diff --git a/src/VBox/ImageMounter/vboximg-mount/fuse.cpp b/src/VBox/ImageMounter/vboximg-mount/fuse.cpp index db52a4cf..927a0639 100644 --- a/src/VBox/ImageMounter/vboximg-mount/fuse.cpp +++ b/src/VBox/ImageMounter/vboximg-mount/fuse.cpp @@ -1,7 +1,6 @@ /* $Id: fuse.cpp $ */ /** @file - * - * Module to dynamically load libfuse and load all symbols + * Module to dynamically load libfuse/libosxfuse and load all symbols * which are needed by vboximg-mount. */ diff --git a/src/VBox/ImageMounter/vboximg-mount/fuse.h b/src/VBox/ImageMounter/vboximg-mount/fuse.h index 4c6b013e..75625f98 100644 --- a/src/VBox/ImageMounter/vboximg-mount/fuse.h +++ b/src/VBox/ImageMounter/vboximg-mount/fuse.h @@ -1,6 +1,7 @@ +/* $Id: fuse.h $ */ /** @file - * Module to dynamically load libfuse/libosxfuse and load all symbols which are needed by - * vboximg-mount. + * Module to dynamically load libfuse/libosxfuse and load all symbols + * which are needed by vboximg-mount. */ /* diff --git a/src/VBox/ImageMounter/vboximg-mount/vboximgCrypto.cpp b/src/VBox/ImageMounter/vboximg-mount/vboximgCrypto.cpp index 54301d15..6a76c0ae 100644 --- a/src/VBox/ImageMounter/vboximg-mount/vboximgCrypto.cpp +++ b/src/VBox/ImageMounter/vboximg-mount/vboximgCrypto.cpp @@ -1,5 +1,4 @@ /* $Id: vboximgCrypto.cpp $ */ - /** @file * vboximgCypto.cpp - Disk Image Flattening FUSE Program. */ diff --git a/src/VBox/ImageMounter/vboximg-mount/vboximgCrypto.h b/src/VBox/ImageMounter/vboximg-mount/vboximgCrypto.h index f5b3e311..a8d3dda0 100644 --- a/src/VBox/ImageMounter/vboximg-mount/vboximgCrypto.h +++ b/src/VBox/ImageMounter/vboximg-mount/vboximgCrypto.h @@ -1,5 +1,4 @@ /* $Id: vboximgCrypto.h $ */ - /** @file * vboximgCrypto.h */ diff --git a/src/VBox/ImageMounter/vboximg-mount/vboximgMedia.h b/src/VBox/ImageMounter/vboximg-mount/vboximgMedia.h index a3640d9f..51d04392 100644 --- a/src/VBox/ImageMounter/vboximg-mount/vboximgMedia.h +++ b/src/VBox/ImageMounter/vboximg-mount/vboximgMedia.h @@ -1,5 +1,4 @@ /* $Id: vboximgMedia.h $ */ - /** @file * vboximgMedia.h */ diff --git a/src/VBox/ImageMounter/vboximg-mount/vboximgOpts.h b/src/VBox/ImageMounter/vboximg-mount/vboximgOpts.h index dd96fe90..7bd454e7 100644 --- a/src/VBox/ImageMounter/vboximg-mount/vboximgOpts.h +++ b/src/VBox/ImageMounter/vboximg-mount/vboximgOpts.h @@ -1,6 +1,4 @@ - /* $Id: vboximgOpts.h $ */ - /** @file * vboximgOpts.h */ diff --git a/src/VBox/Installer/linux/Makefile-footer.gmk b/src/VBox/Installer/linux/Makefile-footer.gmk index 8f78cbc6..f9538893 100644 --- a/src/VBox/Installer/linux/Makefile-footer.gmk +++ b/src/VBox/Installer/linux/Makefile-footer.gmk @@ -115,6 +115,7 @@ VBOXMOD_EXT := ko # build defs EXTRA_CFLAGS += $(VBOXMOD_CFLAGS) $(addprefix -I,$(KERN_INCL) $(VBOXMOD_INCL)) $(VBOXMOD_0_KFLAGS) $(KDEBUG) +ccflags-y += $(EXTRA_CFLAGS) $(VBOXMOD_0_TARGET)-y := $(VBOXMOD_OBJS) obj-m += $(VBOXMOD_0_TARGET).o diff --git a/src/VBox/Installer/linux/distributions_rpm b/src/VBox/Installer/linux/distributions_rpm index 65f545da..83596ada 100644 --- a/src/VBox/Installer/linux/distributions_rpm +++ b/src/VBox/Installer/linux/distributions_rpm @@ -8,6 +8,7 @@ fedora38 = FEDORA_38 fedora37 = FEDORA_37 fedora36 = FEDORA_36 fedora35 = FEDORA_35 +el10 = EL_10 el9 = EL_9 el8 = EL_8 el7 = EL_7 diff --git a/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec b/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec index 635d9c7d..85adde4f 100644 --- a/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec +++ b/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec @@ -136,29 +136,34 @@ mv virtualbox.xml $RPM_BUILD_ROOT/usr/share/mime/packages old_path="$PATH" PATH=${PATH#/opt/rh/devtoolset-4/root/usr/bin:} %endif +%if "%BUILDREL%" == "openSUSE156" +# For openSUSE156 we need GCC 10+ to build Qt 6.8 related code. However, +# kernel modules need be built with older GCC. +VBOX_EXTRA_FLAGS="CC=gcc-7" +%endif for d in /lib/modules/*; do if [ -L $d/build ]; then rm -f /tmp/vboxdrv-Module.symvers ./src/vboxhost/build_in_tmp \ --save-module-symvers /tmp/vboxdrv-Module.symvers \ --module-source `pwd`/src/vboxhost/vboxdrv \ - KBUILD_VERBOSE= KERN_VER=$(basename $d) INSTALL_MODULE_PATH=$RPM_BUILD_ROOT -j4 \ + KBUILD_VERBOSE= KERN_VER=$(basename $d) INSTALL_MODULE_PATH=$RPM_BUILD_ROOT $VBOX_EXTRA_FLAGS -j4 \ %INSTMOD% ./src/vboxhost/build_in_tmp \ --use-module-symvers /tmp/vboxdrv-Module.symvers \ --module-source `pwd`/src/vboxhost/vboxnetflt \ - KBUILD_VERBOSE= KERN_VER=$(basename $d) INSTALL_MODULE_PATH=$RPM_BUILD_ROOT -j4 \ + KBUILD_VERBOSE= KERN_VER=$(basename $d) INSTALL_MODULE_PATH=$RPM_BUILD_ROOT $VBOX_EXTRA_FLAGS -j4 \ %INSTMOD% ./src/vboxhost/build_in_tmp \ --use-module-symvers /tmp/vboxdrv-Module.symvers \ --module-source `pwd`/src/vboxhost/vboxnetadp \ - KBUILD_VERBOSE= KERN_VER=$(basename $d) INSTALL_MODULE_PATH=$RPM_BUILD_ROOT -j4 \ + KBUILD_VERBOSE= KERN_VER=$(basename $d) INSTALL_MODULE_PATH=$RPM_BUILD_ROOT $VBOX_EXTRA_FLAGS -j4 \ %INSTMOD% if [ -e `pwd`/src/vboxhost/vboxpci ]; then ./src/vboxhost/build_in_tmp \ --use-module-symvers /tmp/vboxdrv-Module.symvers \ --module-source `pwd`/src/vboxhost/vboxpci \ - KBUILD_VERBOSE= KERN_VER=$(basename $d) INSTALL_MODULE_PATH=$RPM_BUILD_ROOT -j4 \ + KBUILD_VERBOSE= KERN_VER=$(basename $d) INSTALL_MODULE_PATH=$RPM_BUILD_ROOT $VBOX_EXTRA_FLAGS -j4 \ %INSTMOD% fi fi @@ -168,6 +173,9 @@ done PATH="$old_path" unset old_path %endif +%if "%BUILDREL%" == "openSUSE156" +unset VBOX_EXTRA_FLAGS +%endif rm -r src %endif for i in additions/VBoxGuestAdditions.iso; do diff --git a/src/VBox/Installer/linux/rpm/rules b/src/VBox/Installer/linux/rpm/rules index 900605f9..f4dee329 100755 --- a/src/VBox/Installer/linux/rpm/rules +++ b/src/VBox/Installer/linux/rpm/rules @@ -124,10 +124,10 @@ ifneq ($(MAKECMDGOALS),clean) $(error Cannot detect package distribution (rpmrel=$(rpmrel))) endif - ifeq ($(filter-out el5 el6 el7 el8 el9 fedora18 fedora19 fedora20 fedora21 fedora22 fedora24 fedora25 fedora26 fedora29 fedora31 fedora32 fedora33 fedora35 fedora36 fedora40,$(rpmrel)),) + ifeq ($(filter-out el5 el6 el7 el8 el9 el10 fedora18 fedora19 fedora20 fedora21 fedora22 fedora24 fedora25 fedora26 fedora29 fedora31 fedora32 fedora33 fedora35 fedora36 fedora40,$(rpmrel)),) rpmspec := rpm_redhat endif - ifeq ($(filter-out openSUSE110 openSUSE111 openSUSE112 openSUSE113 openSUSE114 openSUSE123 openSUSE131 openSUSE132 openSUSE150 openSUSE153 openSUSETW,$(rpmrel)),) + ifeq ($(filter-out openSUSE110 openSUSE111 openSUSE112 openSUSE113 openSUSE114 openSUSE123 openSUSE131 openSUSE132 openSUSE150 openSUSE153 openSUSE156 openSUSETW,$(rpmrel)),) rpmspec := rpm_suse endif ifeq ($(rpmspec),) @@ -182,7 +182,7 @@ cfg_flags := $(if $(NOQT),--disable-qt,) \ $(if $(NOWINE),,--setup-wine) \ $(if $(VNC),--enable-vnc,) \ $(if $(PATH_OUT_BASE),--out-base-dir=$(PATH_OUT_BASE),) \ - --disable-extpack + --disable-extpack --disable-vmmraw --build-libssl --disable-java bld_flags := LOCALCFG=$(instlin)/rpm/LocalConfig.kmk \ PATH_OUT=$(builddir) \ diff --git a/src/VBox/Installer/linux/vboxdrv.sh b/src/VBox/Installer/linux/vboxdrv.sh index a9dbcda5..9e0c6807 100755 --- a/src/VBox/Installer/linux/vboxdrv.sh +++ b/src/VBox/Installer/linux/vboxdrv.sh @@ -100,9 +100,10 @@ fi KERN_VER=`uname -r` -# Prepend PATH for building UEK7 on OL8 distribution. +# Prepend PATH for building UEK on OL8/9 distributions. case "$KERN_VER" in 5.15.0-*.el8uek*) PATH="/opt/rh/gcc-toolset-11/root/usr/bin:$PATH";; + 6.12.0-*.el9uek*)PATH="/opt/rh/gcc-toolset-14/root/usr/bin:$PATH";; esac if test -e "${MODULE_SRC}/vboxpci"; then diff --git a/src/VBox/Installer/solaris/checkinstall.sh b/src/VBox/Installer/solaris/checkinstall.sh index 290b9d69..3043989d 100755 --- a/src/VBox/Installer/solaris/checkinstall.sh +++ b/src/VBox/Installer/solaris/checkinstall.sh @@ -102,9 +102,10 @@ checkdep_ips_python() # python 2.7: S11 FCS -> S11.4 SRU56 [removed in S11.4 SRU57] # python 3.4: S11.3 FCS -> S11.4 SRU26 [removed in S11.4 SRU27] # python 3.5: S11.4 FCS -> S11.4 SRU29 [removed in S11.4 SRU30] - # python 3.7: S11.4 SRU4 -> TBD + # python 3.7: S11.4 SRU4 -> S11.4 SRU71 [removed in S11.4 SRU72] # python 3.9: S11.4 SRU30 -> TBD # python 3.11: S11.4 SRU54 -> TBD + # python 3.13: S11.4 SRU78 -> TBD if test "$UPDATE" -lt 3 || test "$UPDATE" -gt 4; then # S11 FCS - S11.2 SRU15 or anything before S11 FCS PKG_MISSING_IPS="$PKG_MISSING_IPS runtime/python-26 or runtime/python-27" elif test "$UPDATE" -eq 3 && test "$SRU" -le 19; then # S11.3 FCS - S11.3 SRU19 @@ -121,10 +122,12 @@ checkdep_ips_python() PKG_MISSING_IPS="$PKG_MISSING_IPS runtime/python-27 or runtime/python-37 or runtime/python-39" elif test "$UPDATE" -eq 4 && test "$SRU" -le 56; then # S11.4 SRU54 - S11.4 SRU56 PKG_MISSING_IPS="$PKG_MISSING_IPS runtime/python-27 or runtime/python-37 or runtime/python-39 or runtime/python-311" - elif test "$UPDATE" -eq 4 && test "$SRU" -gt 56; then # S11.4 SRU57 - S11.4 SRU + elif test "$UPDATE" -eq 4 && test "$SRU" -le 71; then # S11.4 SRU57 - S11.4 SRU71 PKG_MISSING_IPS="$PKG_MISSING_IPS runtime/python-37 or runtime/python-39 or runtime/python-311" + elif test "$UPDATE" -eq 4 && test "$SRU" -gt 71; then # S11.4 SRU72 - S11.4 SRU + PKG_MISSING_IPS="$PKG_MISSING_IPS runtime/python-39 or runtime/python-311 or runtime/python-313" else # Fall through just in case. - PKG_MISSING_IPS="$PKG_MISSING_IPS runtime/python-37 or runtime/python-39 or runtime/python-311" + PKG_MISSING_IPS="$PKG_MISSING_IPS runtime/python-39 or runtime/python-311 or runtime/python-313" fi return 1 @@ -239,7 +242,7 @@ if test -x "$BIN_PKG"; then checkdep_ips "x11/library/mesa" checkdep_ips "x11/library/toolkit/libxt" checkdep_ips "x11/library/xcb-util" - checkdep_ips_python "runtime/python-26" "runtime/python-27" "runtime/python-34" "runtime/python-35" "runtime/python-37" "runtime/python-39" "runtime/python-311" + checkdep_ips_python "runtime/python-26" "runtime/python-27" "runtime/python-34" "runtime/python-35" "runtime/python-37" "runtime/python-39" "runtime/python-311" "runtime/python-313" checkdep_ips_either "system/library/gcc/gcc-c++-runtime" "system/library/gcc/gcc-c++-runtime-9" checkdep_ips_either "system/library/gcc/gcc-c-runtime" "system/library/gcc/gcc-c-runtime-9" else diff --git a/src/VBox/Installer/solaris/vboxconfig.sh b/src/VBox/Installer/solaris/vboxconfig.sh index 8c4fe51c..7b13708c 100755 --- a/src/VBox/Installer/solaris/vboxconfig.sh +++ b/src/VBox/Installer/solaris/vboxconfig.sh @@ -944,7 +944,7 @@ install_python_bindings() else errorprint "Failed to install bindings for Python $PYTHON_VER" fi - rm "$CONFIG_DIR/python-$CONFIG_FILES" + rm -f "$CONFIG_DIR/python-$CONFIG_FILES" # Remove files created by Python API setup. rm -rf "$MY_PYTHON_INSTALLER_PATH/build" diff --git a/src/VBox/Installer/win/Scripts/VBoxExtPackPuel.inf b/src/VBox/Installer/win/Scripts/VBoxExtPackPuel.inf index d584581b..131e82c3 100644 --- a/src/VBox/Installer/win/Scripts/VBoxExtPackPuel.inf +++ b/src/VBox/Installer/win/Scripts/VBoxExtPackPuel.inf @@ -32,6 +32,7 @@ ClassGuid = {4d36e97d-e325-11ce-bfc1-08002be10318} CatalogFile = VBoxExtPackPuel.cat Provider = %ORACLE% ;edit-DriverVer = 08/26/2008,2.00.0000 +PnpLockdown=1 [SourceDisksNames] 1=%VBoxExtPackPuel.DskDesc%,"",, diff --git a/src/VBox/Installer/win/Scripts/VMMR0.inf b/src/VBox/Installer/win/Scripts/VMMR0.inf index ed5dc93e..ccddfa94 100644 --- a/src/VBox/Installer/win/Scripts/VMMR0.inf +++ b/src/VBox/Installer/win/Scripts/VMMR0.inf @@ -32,6 +32,7 @@ ClassGuid = {4d36e97d-e325-11ce-bfc1-08002be10318} CatalogFile = VMMR0.cat Provider = %ORACLE% ;edit-DriverVer = 08/26/2008,2.00.0000 +PnpLockdown=1 [SourceDisksNames] 1=%VBoxVMM.DskDesc%,"",, diff --git a/src/VBox/Installer/win/UserInterface.wxi b/src/VBox/Installer/win/UserInterface.wxi index 1439346d..90fe3ee8 100644 --- a/src/VBox/Installer/win/UserInterface.wxi +++ b/src/VBox/Installer/win/UserInterface.wxi @@ -1160,7 +1160,7 @@ - + @@ -1202,8 +1202,8 @@ - - + + diff --git a/src/VBox/Installer/win/VirtualBox.wxs b/src/VBox/Installer/win/VirtualBox.wxs index 391752d1..5f40aa6b 100644 --- a/src/VBox/Installer/win/VirtualBox.wxs +++ b/src/VBox/Installer/win/VirtualBox.wxs @@ -130,8 +130,8 @@ Maximum="9.9.99" IncludeMaximum="yes" OnlyDetect="no" /> - - + + diff --git a/src/VBox/Main/src-client/ConsoleVRDPServer.cpp b/src/VBox/Main/src-client/ConsoleVRDPServer.cpp index 53f21a2f..527f4e91 100644 --- a/src/VBox/Main/src-client/ConsoleVRDPServer.cpp +++ b/src/VBox/Main/src-client/ConsoleVRDPServer.cpp @@ -3380,14 +3380,6 @@ DECLCALLBACK(int) ConsoleVRDPServer::ClipboardServiceExtension(void *pvExtension } } break; - case VBOX_CLIPBOARD_EXT_FN_FORMAT_REPORT_TO_GUEST: - { - /* We need to handle this case here, to act as a no-op. - * - * If not being handled, this function otherwise would return VERR_NOT_SUPPORTED, - * which in turn then will invoke the host backend, messing up the VRDE clipboard handling. */ - } break; - case VBOX_CLIPBOARD_EXT_FN_DATA_READ: { /* The clipboard service expects that the pvData buffer will be filled diff --git a/src/VBox/Main/src-client/GuestDirectoryImpl.cpp b/src/VBox/Main/src-client/GuestDirectoryImpl.cpp index 267bfe48..e978cbc4 100644 --- a/src/VBox/Main/src-client/GuestDirectoryImpl.cpp +++ b/src/VBox/Main/src-client/GuestDirectoryImpl.cpp @@ -581,7 +581,7 @@ int GuestDirectory::i_onDirNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRL case GUEST_DIR_NOTIFYTYPE_LIST: { - ASSERT_GUEST_MSG_STMT_BREAK(pSvcCbData->mParms >= 4, ("mParms=%u\n", pSvcCbData->mParms), + ASSERT_GUEST_MSG_STMT_BREAK(pSvcCbData->mParms == 5, ("mParms=%u\n", pSvcCbData->mParms), vrc = VERR_WRONG_PARAMETER_COUNT); ASSERT_GUEST_MSG_STMT_BREAK(pSvcCbData->mpaParms[idx].type == VBOX_HGCM_SVC_PARM_32BIT, ("type=%u\n", pSvcCbData->mpaParms[idx].type), @@ -599,8 +599,6 @@ int GuestDirectory::i_onDirNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRL /* * Fetch buffer with packed directory entries. */ - ASSERT_GUEST_MSG_STMT_BREAK(pSvcCbData->mParms == 5, ("mParms=%u\n", pSvcCbData->mParms), - vrc = VERR_WRONG_PARAMETER_COUNT); ASSERT_GUEST_MSG_STMT_BREAK(pSvcCbData->mpaParms[idx].type == VBOX_HGCM_SVC_PARM_PTR, ("type=%u\n", pSvcCbData->mpaParms[idx].type), vrc = VERR_WRONG_PARAMETER_TYPE); @@ -608,7 +606,6 @@ int GuestDirectory::i_onDirNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRL uint32_t cbBuf; vrc = HGCMSvcGetPv(&pSvcCbData->mpaParms[idx], &pvBuf, &cbBuf); AssertRCBreak(vrc); - AssertBreakStmt(cbBuf >= sizeof(GSTCTLDIRENTRYEX), vrc = VERR_INVALID_PARAMETER); dataCb.u.list.paEntries = (PCALLBACKDATA_DIR_ENTRY *)RTMemAllocZ(dataCb.u.list.cEntries * sizeof(PCALLBACKDATA_DIR_ENTRY)); AssertPtrBreakStmt(dataCb.u.list.paEntries, vrc = VERR_NO_MEMORY); diff --git a/src/VBox/Main/src-client/RecordingCodec.cpp b/src/VBox/Main/src-client/RecordingCodec.cpp index 38f28578..6d620d06 100644 --- a/src/VBox/Main/src-client/RecordingCodec.cpp +++ b/src/VBox/Main/src-client/RecordingCodec.cpp @@ -415,6 +415,7 @@ static DECLCALLBACK(int) recordingCodecVPXEncode(PRECORDINGCODEC pCodec, PRECORD case RECORDINGFRAME_TYPE_CURSOR_SHAPE: { + RecordingVideoFrameFree(pCodec->Video.VPX.pCursorShape); pCodec->Video.VPX.pCursorShape = RecordingVideoFrameDup(&pFrame->u.CursorShape); AssertPtr(pCodec->Video.VPX.pCursorShape); diff --git a/src/VBox/Main/testcase/tstSafeArray.cpp b/src/VBox/Main/testcase/tstSafeArray.cpp index 66320a9a..38cfacb0 100644 --- a/src/VBox/Main/testcase/tstSafeArray.cpp +++ b/src/VBox/Main/testcase/tstSafeArray.cpp @@ -29,11 +29,13 @@ /********************************************************************************************************************************* * Header Files * *********************************************************************************************************************************/ +#include #include #include #include #include +#include #include #include #include @@ -47,8 +49,21 @@ int main() { RTTestBanner(hTest); - /* Sizes / Pre-allocations. */ + HRESULT hrc = com::Initialize(); + if (FAILED(hrc)) + { + RTPrintf("ERROR: failed to initialize COM, hrc=%Rhrc\n", hrc); + return RTEXITCODE_FAILURE; + } + + /* Some simple push-to-front test to catch some off-by-one errors. */ com::SafeArray aInt; + aInt.push_front(42); + + /* Test NULL'ing. */ + aInt.setNull(); + + /* Sizes / Pre-allocations. */ RTTESTI_CHECK(aInt.size() == 0); com::SafeArray aInt2(42); @@ -89,6 +104,54 @@ int main() RTTESTI_CHECK_MSG(aInt[i] == aPushToFront[RT_ELEMENTS(aPushToFront) - i - 1], ("Got %d, expected %d\n", aInt[i], aPushToFront[RT_ELEMENTS(aPushToFront) - i - 1])); + /* Push to back first, then push to front. */ + com::SafeArray aInt4; + for (size_t i = 0; i < RT_ELEMENTS(aPushToBack); i++) + { + RTTESTI_CHECK(aInt4.push_back(aPushToBack[i])); + RTTESTI_CHECK(aInt4.size() == i + 1); + RTTESTI_CHECK(aInt4[i] == aPushToBack[i]); + } + for (size_t i = 0; i < RT_ELEMENTS(aPushToBack); i++) + RTTESTI_CHECK_MSG(aInt4[i] == aPushToBack[i], ("Got %d, expected %d\n", aInt4[i], aPushToBack[i])); + + for (size_t i = 0; i < RT_ELEMENTS(aPushToFront); i++) + { + RTTESTI_CHECK(aInt4.push_front(aPushToFront[i])); + RTTESTI_CHECK(aInt4.size() == i + 1 + RT_ELEMENTS(aPushToBack)); + RTTESTI_CHECK(aInt4[0] == aPushToFront[i]); + } + for (size_t i = 0; i < RT_ELEMENTS(aPushToFront); i++) + RTTESTI_CHECK_MSG(aInt4[i] == aPushToFront[RT_ELEMENTS(aPushToFront) - i - 1], + ("Got %d, expected %d\n", aInt4[i], aPushToFront[RT_ELEMENTS(aPushToFront) - i - 1])); + + aInt4.setNull(); + + /* Push to front first, then push to back. */ + com::SafeArray aInt5; + for (size_t i = 0; i < RT_ELEMENTS(aPushToFront); i++) + { + RTTESTI_CHECK(aInt5.push_front(aPushToFront[i])); + RTTESTI_CHECK(aInt5.size() == i + 1); + RTTESTI_CHECK(aInt5[0] == aPushToFront[i]); + } + for (size_t i = 0; i < RT_ELEMENTS(aPushToFront); i++) + RTTESTI_CHECK_MSG(aInt5[i] == aPushToFront[RT_ELEMENTS(aPushToFront) - i - 1], + ("Got %d, expected %d\n", aInt5[i], aPushToFront[RT_ELEMENTS(aPushToFront) - i - 1])); + + /* Push to back. */ + for (size_t i = 0; i < RT_ELEMENTS(aPushToBack); i++) + { + RTTESTI_CHECK(aInt5.push_back(aPushToBack[i])); + RTTESTI_CHECK(aInt5.size() == i + 1 + RT_ELEMENTS(aPushToFront)); + RTTESTI_CHECK(aInt5[i + RT_ELEMENTS(aPushToFront)] == aPushToBack[i]); + } + for (size_t i = 0; i < RT_ELEMENTS(aPushToBack); i++) + RTTESTI_CHECK_MSG(aInt5[i + RT_ELEMENTS(aPushToFront)] == aPushToBack[i], + ("Got %d, expected %d\n", aInt5[i], aPushToBack[i])); + + aInt5.setNull(); + /* A bit more data. */ aInt.setNull(); for (size_t i = 0; i < RTRandU32Ex(_4K, _64M); i++) diff --git a/src/VBox/Main/webservice/Makefile.kmk b/src/VBox/Main/webservice/Makefile.kmk index 38d53ece..cbee1942 100644 --- a/src/VBox/Main/webservice/Makefile.kmk +++ b/src/VBox/Main/webservice/Makefile.kmk @@ -120,13 +120,11 @@ else endif VBOX_PATH_GSOAP_BIN := $(strip $(VBOX_PATH_GSOAP_BIN)) if "$(VBOX_PATH_GSOAP_BIN)" == "" - VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin - if "$(KBUILD_HOST)" == "darwin" - VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/macosx - else if "$(KBUILD_HOST)" == "win" - VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/win32 + if "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "win.arm64" + # Reuse amd64 binaries + VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin/win.amd64 else - VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP_BIN)/$(KBUILD_HOST).x86 + VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin/$(KBUILD_HOST).$(KBUILD_HOST_ARCH) endif if !exists($(VBOX_PATH_GSOAP_BIN)) VBOX_PATH_GSOAP_BIN := $(VBOX_PATH_GSOAP)/bin diff --git a/src/VBox/Runtime/common/script/scriptlex.cpp b/src/VBox/Runtime/common/script/scriptlex.cpp index 0b1fa1b3..a7a7a3f4 100644 --- a/src/VBox/Runtime/common/script/scriptlex.cpp +++ b/src/VBox/Runtime/common/script/scriptlex.cpp @@ -81,6 +81,8 @@ typedef struct RTSCRIPTLEXINT RTSTRCACHE hStrCacheId; /** String literal string cache. */ RTSTRCACHE hStrCacheStringLit; + /** Comment string cache. */ + RTSTRCACHE hStrCacheComments; /** Status code from the reader. */ int rcRdr; /** Internal error info. */ @@ -105,11 +107,13 @@ typedef RTSCRIPTLEXINT *PRTSCRIPTLEXINT; /** Free the identifier string cache literal on destruction. */ -#define RTSCRIPT_LEX_INT_F_STR_CACHE_ID_FREE RT_BIT_32(0) +#define RTSCRIPT_LEX_INT_F_STR_CACHE_ID_FREE RT_BIT_32(0) /** Free the string literal string cache literal on destruction. */ -#define RTSCRIPT_LEX_INT_F_STR_CACHE_STR_LIT_FREE RT_BIT_32(1) +#define RTSCRIPT_LEX_INT_F_STR_CACHE_STR_LIT_FREE RT_BIT_32(1) +/** Free the comments string cache literal on destruction. */ +#define RTSCRIPT_LEX_INT_F_STR_CACHE_COMMENTS_FREE RT_BIT_32(2) /** End of stream reached. */ -#define RTSCRIPT_LEX_INT_F_EOS RT_BIT_32(2) +#define RTSCRIPT_LEX_INT_F_EOS RT_BIT_32(3) /********************************************************************************************************************************* @@ -266,11 +270,11 @@ DECLINLINE(bool) rtScriptLexLocateExactMatchConsume(PRTSCRIPTLEXINT pThis, char } -DECLINLINE(bool) rtScriptLexIsNewlineConsume(PRTSCRIPTLEXINT pThis, char ch) +DECLINLINE(bool) rtScriptLexIsNewlineConsumeEx(PRTSCRIPTLEXINT pThis, char ch, unsigned *pidx) { - const char **papszNl = pThis->pCfg->pszWhitespace ? pThis->pCfg->papszNewline : g_aszNlDef; + const char **papszNl = pThis->pCfg->papszNewline ? pThis->pCfg->papszNewline : g_aszNlDef; - bool fMatched = rtScriptLexLocateSubStrInStrArrayMatchConsume(pThis, ch, papszNl, NULL); + bool fMatched = rtScriptLexLocateSubStrInStrArrayMatchConsume(pThis, ch, papszNl, pidx); if (fMatched) { pThis->Pos.iLine++; @@ -281,6 +285,33 @@ DECLINLINE(bool) rtScriptLexIsNewlineConsume(PRTSCRIPTLEXINT pThis, char ch) } +DECLINLINE(bool) rtScriptLexIsNewlineConsume(PRTSCRIPTLEXINT pThis, char ch) +{ + return rtScriptLexIsNewlineConsumeEx(pThis, ch, NULL); +} + + +/** + * Checks whether the character is the beginning of a multi line comment. + * + * @returns Flag whether a comment was detected. + * @param hScriptLex The lexer state. + * @param ch The character to check for. + * @param pidxMatch Where to store the index of the matching substring if found, + * optional. + * @note This consumes the start of the single line comment. + */ +DECLINLINE(bool) rtScriptLexIsMultiLineComment(PRTSCRIPTLEXINT pThis, char ch, unsigned *pidxMatch) +{ + const char **papszCommentMultiStart = pThis->pCfg->papszCommentMultiStart; + if ( papszCommentMultiStart + && rtScriptLexLocateSubStrInStrArrayMatchConsume(pThis, ch, papszCommentMultiStart, pidxMatch)) + return true; + + return false; +} + + /** * Checks whether the character is the beginning of a multi line comment, skipping the whole * comment if necessary. @@ -291,12 +322,8 @@ DECLINLINE(bool) rtScriptLexIsNewlineConsume(PRTSCRIPTLEXINT pThis, char ch) */ DECLINLINE(bool) rtScriptLexIsMultiLineCommentConsume(PRTSCRIPTLEXINT pThis, char ch) { - const char **papszCommentMultiStart = pThis->pCfg->papszCommentMultiStart; unsigned idxComment = 0; - - if ( papszCommentMultiStart - && rtScriptLexLocateSubStrInStrArrayMatchConsume(pThis, ch, papszCommentMultiStart, - &idxComment)) + if (rtScriptLexIsMultiLineComment(pThis, ch, &idxComment)) { /* Look for the matching closing lexeme in the input consuming everything along the way. */ const char *pszClosing = pThis->pCfg->papszCommentMultiEnd[idxComment]; @@ -325,6 +352,27 @@ DECLINLINE(bool) rtScriptLexIsMultiLineCommentConsume(PRTSCRIPTLEXINT pThis, cha } +/** + * Checks whether the character is the beginning of a single line comment. + * + * @returns Flag whether a comment was detected. + * @param hScriptLex The lexer state. + * @param ch The character to check for. + * @param pidxMatch Where to store the index of the matching substring if found, + * optional. + * @note This consumes the start of the single line comment. + */ +DECLINLINE(bool) rtScriptLexIsSingleLineComment(PRTSCRIPTLEXINT pThis, char ch, unsigned *pidxMatch) +{ + const char **papszCommentSingleStart = pThis->pCfg->papszCommentSingleStart; + if ( papszCommentSingleStart + && rtScriptLexLocateSubStrInStrArrayMatchConsume(pThis, ch, papszCommentSingleStart, pidxMatch)) + return true; + + return false; +} + + /** * Checks whether the character is the beginning of a single line comment, skipping the whole * comment if necessary. @@ -335,11 +383,7 @@ DECLINLINE(bool) rtScriptLexIsMultiLineCommentConsume(PRTSCRIPTLEXINT pThis, cha */ DECLINLINE(bool) rtScriptLexIsSingleLineCommentConsume(PRTSCRIPTLEXINT pThis, char ch) { - const char **papszCommentSingleStart = pThis->pCfg->papszCommentSingleStart; - - if ( papszCommentSingleStart - && rtScriptLexLocateSubStrInStrArrayMatchConsume(pThis, ch, papszCommentSingleStart, - NULL)) + if (rtScriptLexIsSingleLineComment(pThis, ch, NULL)) { for (;;) { @@ -374,13 +418,14 @@ static int rtScriptLexFillBuffer(PRTSCRIPTLEXINT pThis) AssertReturn(!(pThis->fFlags & RTSCRIPT_LEX_INT_F_EOS), VERR_INVALID_STATE); /* If there is input left to process move it to the front and fill the remainder. */ - if (pThis->pchCur != NULL) + if ( pThis->pchCur != NULL + && pThis->pchCur != &pThis->achBuf[pThis->cchBuf]) { cchToRead = pThis->pchCur - &pThis->achBuf[0]; /* Move the rest to the front. */ - memmove(&pThis->achBuf[0], pThis->pchCur, pThis->cchBuf - cchToRead); - pchRead = (char *)pThis->pchCur + 1; - memset(pchRead, 0, cchToRead); + size_t const cchLeft = pThis->cchBuf - cchToRead; + memmove(&pThis->achBuf[0], pThis->pchCur, cchLeft); + pchRead = &pThis->achBuf[0] + cchLeft; } if (cchToRead) @@ -394,6 +439,8 @@ static int rtScriptLexFillBuffer(PRTSCRIPTLEXINT pThis) pThis->offBufRead += cchRead; if (rc == VINF_EOF) pThis->fFlags |= RTSCRIPT_LEX_INT_F_EOS; + if (cchRead < cchToRead) + memset(pchRead + cchRead, 0, cchToRead - cchRead); rc = VINF_SUCCESS; } else @@ -421,19 +468,11 @@ static void rtScriptLexProduceTokEos(PRTSCRIPTLEXINT pThis, PRTSCRIPTLEXTOKEN pT } -/** - * Produce an error token with the given error message. - * - * @returns IPRT status code. - * @param pThis The lexer state. - * @param pTok The token to fill. - * @param rc The status code to use in the message. - * @param pszMsg The format string for the error message. - * @param ... Arguments to the format string. - */ -static int rtScriptLexProduceTokError(PRTSCRIPTLEXINT pThis, PRTSCRIPTLEXTOKEN pTok, - int rc, const char *pszMsg, ...) +RTDECL(int) RTScriptLexProduceTokError(RTSCRIPTLEX hScriptLex, PRTSCRIPTLEXTOKEN pTok, + int rc, const char *pszMsg, ...) { + PRTSCRIPTLEXINT pThis = hScriptLex; + va_list va; va_start(va, pszMsg); @@ -449,6 +488,218 @@ static int rtScriptLexProduceTokError(PRTSCRIPTLEXINT pThis, PRTSCRIPTLEXTOKEN p } +RTDECL(int) RTScriptLexProduceTokIde(RTSCRIPTLEX hScriptLex, PRTSCRIPTLEXTOKEN pTok, const char *pszIde, size_t cchIde) +{ + PRTSCRIPTLEXINT pThis = hScriptLex; + + /* Insert into string cache. */ + pTok->enmType = RTSCRIPTLEXTOKTYPE_IDENTIFIER; + pTok->Type.Id.pszIde = RTStrCacheEnterN(pThis->hStrCacheId, pszIde, cchIde); + if (RT_UNLIKELY(!pTok->Type.Id.pszIde)) + return RTScriptLexProduceTokError(hScriptLex, pTok, VERR_NO_STR_MEMORY, "Lexer: Out of memory inserting identifier into string cache"); + + pTok->PosEnd = pThis->Pos; + return VINF_SUCCESS; +} + + +/** + * Creates a single line comment token. + * + * @returns Flag whether a matching rule was found. + * @param pThis The lexer state. + * @param idxComment The index into the single line comment token start array. + * @param pTok The token to fill. + */ +static void rtScriptLexProduceTokFromSingleLineComment(PRTSCRIPTLEXINT pThis, unsigned idxComment, PRTSCRIPTLEXTOKEN pTok) +{ + const char *pszCommentSingleStart = pThis->pCfg->papszCommentSingleStart[idxComment]; + AssertPtr(pszCommentSingleStart); + + pTok->PosStart = pThis->Pos; + + /** @todo Optimize */ + size_t cchTmp = 512; + char *pszTmp = (char *)RTMemAlloc(cchTmp); + if (pszTmp) + { + size_t cchComment = 0; + while (*pszCommentSingleStart != '\0') + pszTmp[cchComment++] = *pszCommentSingleStart++; + + for (;;) + { + char chTmp = RTScriptLexGetCh(pThis); + + if ( chTmp == '\0' + || rtScriptLexIsNewlineConsume(pThis, chTmp)) + { + pszTmp[cchComment++] = '\0'; + break; + } + + if (cchComment == cchTmp - 1) + { + char *pszNew = (char *)RTMemRealloc(pszTmp, cchTmp + 512); + if (!pszNew) + { + RTMemFree(pszTmp); + pszTmp = NULL; + RTScriptLexProduceTokError(pThis, pTok, VERR_NO_STR_MEMORY, "Lexer: Out of memory allocating temporary memory for a single line comment"); + break; + } + + cchTmp += 512; + pszTmp = pszNew; + } + + pszTmp[cchComment++] = chTmp; + RTScriptLexConsumeCh(pThis); + } + + if (pszTmp) + { + pTok->enmType = RTSCRIPTLEXTOKTYPE_COMMENT_SINGLE_LINE; + pTok->PosEnd = pThis->Pos; + pTok->Type.Comment.pszComment = RTStrCacheEnterN(pThis->hStrCacheId, pszTmp, cchComment); + pTok->Type.Comment.cchComment = cchComment; + if (RT_UNLIKELY(!pTok->Type.Comment.pszComment)) + RTScriptLexProduceTokError(pThis, pTok, VERR_NO_STR_MEMORY, "Lexer: Out of memory inserting comment into comment cache"); + + RTMemFree(pszTmp); + } + } + else + RTScriptLexProduceTokError(pThis, pTok, VERR_NO_MEMORY, "Lexer: Out of memory allocating temporary memory for a single line comment"); +} + + +/** + * Ensures there is enough space in the given buffer for the given amount of bytes, + * extending the buffer or creating an error token if this fails. + * + * @returns Flag whether there is enough space in the buffer. + * @param pThis The lexer state. + * @param ppchTmp Pointer to the pointer for the character buffer being checked. + * On successful return this might contain a different pointer if + * re-allocation was required. + * @param pcchTmp On input the size of the buffer in characters, on return the new + * size of the buffer if re-allocation was required. + * @param cchCur How much of the current buffer is used. + * @param cchAdd How many additional characters are required. + * @param pTok The token to fill in if re-allocating the buffer failed. + */ +DECLINLINE(bool) rtScriptLexEnsureTmpBufSpace(PRTSCRIPTLEXINT pThis, char **ppchTmp, size_t *pcchTmp, + size_t cchCur, size_t cchAdd, PRTSCRIPTLEXTOKEN pTok) +{ + if (RT_LIKELY(cchCur + cchAdd + 1 <= *pcchTmp)) /* Always keep room for the zero terminator. */ + return true; + + size_t cchNew = *pcchTmp + _1K; + char *pchNew = (char *)RTMemRealloc(*ppchTmp, cchNew); + if (!pchNew) + { + RTMemFree(*ppchTmp); + *ppchTmp = NULL; + RTScriptLexProduceTokError(pThis, pTok, VERR_NO_STR_MEMORY, "Lexer: Out of memory allocating temporary memory for a multi line comment"); + return false; + } + + *ppchTmp = pchNew; + *pcchTmp = cchNew; + return true; +} + + +/** + * Creates a multi line comment token. + * + * @returns Flag whether a matching rule was found. + * @param pThis The lexer state. + * @param idxComment The index into the single line comment token start array. + * @param pTok The token to fill. + */ +static void rtScriptLexProduceTokFromMultiLineComment(PRTSCRIPTLEXINT pThis, unsigned idxComment, PRTSCRIPTLEXTOKEN pTok) +{ + const char *pszCommentMultiStart = pThis->pCfg->papszCommentMultiStart[idxComment]; + AssertPtr(pszCommentMultiStart); + + pTok->PosStart = pThis->Pos; + + /** @todo Optimize */ + size_t cchTmp = _1K; + char *pszTmp = (char *)RTMemAlloc(cchTmp); + if (pszTmp) + { + /* Look for the matching closing lexeme in the input consuming everything along the way. */ + const char *pszClosing = pThis->pCfg->papszCommentMultiEnd[idxComment]; + + size_t cchComment = 0; + while (*pszCommentMultiStart != '\0') + pszTmp[cchComment++] = *pszCommentMultiStart++; + + for (;;) + { + char chTmp = RTScriptLexGetCh(pThis); + + /* Check for new lines explicetly to advance the position information and copy it over. */ + unsigned idxNewLine = 0; + if (rtScriptLexIsNewlineConsumeEx(pThis, chTmp, &idxNewLine)) + { + const char *pszNl = pThis->pCfg->papszNewline + ? pThis->pCfg->papszNewline[idxNewLine] + : g_aszNlDef[idxNewLine]; + if (!rtScriptLexEnsureTmpBufSpace(pThis, &pszTmp, &cchTmp, cchComment, + strlen(pszNl), pTok)) + break; + + while (*pszNl != '\0') + pszTmp[cchComment++] = *pszNl++; + continue; + } + + /* Check for the closing lexeme. */ + if (rtScriptLexMatchStrConsume(pThis, chTmp, pszClosing, NULL)) + { + /* Copy over the closing comment lexeme. */ + if (rtScriptLexEnsureTmpBufSpace(pThis, &pszTmp, &cchTmp, cchComment, + strlen(pszClosing), pTok)) + { + while (*pszClosing != '\0') + pszTmp[cchComment++] = *pszClosing++; + pszTmp[cchComment++] = '\0'; + } + break; + } + + if (chTmp == '\0') + break; /* End of stream before closing lexeme. */ + + if (!rtScriptLexEnsureTmpBufSpace(pThis, &pszTmp, &cchTmp, cchComment, + strlen(pszClosing), pTok)) + break; + + pszTmp[cchComment++] = chTmp; + RTScriptLexConsumeCh(pThis); + } + + if (pszTmp) + { + pTok->enmType = RTSCRIPTLEXTOKTYPE_COMMENT_MULTI_LINE; + pTok->PosEnd = pThis->Pos; + pTok->Type.Comment.pszComment = RTStrCacheEnterN(pThis->hStrCacheId, pszTmp, cchComment); + pTok->Type.Comment.cchComment = cchComment; + if (RT_UNLIKELY(!pTok->Type.Comment.pszComment)) + RTScriptLexProduceTokError(pThis, pTok, VERR_NO_STR_MEMORY, "Lexer: Out of memory inserting comment into comment cache"); + + RTMemFree(pszTmp); + } + } + else + RTScriptLexProduceTokError(pThis, pTok, VERR_NO_MEMORY, "Lexer: Out of memory allocating temporary memory for a multi line comment"); +} + + /** * Create the token from the exact match. * @@ -475,7 +726,7 @@ static void rtScriptLexProduceTokFromExactMatch(PRTSCRIPTLEXINT pThis, PRTSCRIPT pTok->Type.Punctuator.pPunctuator = pMatch; break; default: - rtScriptLexProduceTokError(pThis, pTok, VERR_INVALID_PARAMETER, + RTScriptLexProduceTokError(pThis, pTok, VERR_INVALID_PARAMETER, "Lexer: The match contains an invalid token type: %d\n", pTok->enmType); } @@ -531,8 +782,15 @@ static int rtScriptLexProduceToken(PRTSCRIPTLEXINT pThis, PRTSCRIPTLEXTOKEN pTok char ch = RTScriptLexGetCh(pThis); PCRTSCRIPTLEXTOKMATCH pMatch = NULL; + unsigned idxComment = 0; if (ch == '\0') rtScriptLexProduceTokEos(pThis, pTok); + else if ( (pThis->pCfg->fFlags & RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS) + && rtScriptLexIsSingleLineComment(pThis, ch, &idxComment)) + rtScriptLexProduceTokFromSingleLineComment(pThis, idxComment, pTok); + else if ( (pThis->pCfg->fFlags & RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS) + && rtScriptLexIsMultiLineComment(pThis, ch, &idxComment)) + rtScriptLexProduceTokFromMultiLineComment(pThis, idxComment, pTok); else if (rtScriptLexLocateExactMatchConsume(pThis, ch, &pMatch)) rtScriptLexProduceTokFromExactMatch(pThis, pTok, pMatch); else if (!rtScriptLexProduceTokFromRules(pThis, ch, pTok)) @@ -540,7 +798,7 @@ static int rtScriptLexProduceToken(PRTSCRIPTLEXINT pThis, PRTSCRIPTLEXTOKEN pTok if (pThis->pCfg->pfnProdDef) pThis->rcRdr = pThis->pCfg->pfnProdDef(pThis, ch, pTok, pThis->pCfg->pvProdDefUser); else - rtScriptLexProduceTokError(pThis, pTok, VERR_INVALID_PARAMETER, + RTScriptLexProduceTokError(pThis, pTok, VERR_INVALID_PARAMETER, "Lexer: Invalid character found in input: %c\n", ch); } @@ -573,12 +831,16 @@ static int rtScriptLexPopulate(PRTSCRIPTLEXINT pThis) RTDECL(int) RTScriptLexCreateFromReader(PRTSCRIPTLEX phScriptLex, PFNRTSCRIPTLEXRDR pfnReader, PFNRTSCRIPTLEXDTOR pfnDtor, void *pvUser, size_t cchBuf, PRTSTRCACHE phStrCacheId, PRTSTRCACHE phStrCacheStringLit, - PCRTSCRIPTLEXCFG pCfg) + PRTSTRCACHE phStrCacheComments, PCRTSCRIPTLEXCFG pCfg) { AssertPtrReturn(phScriptLex, VERR_INVALID_POINTER); AssertPtrReturn(pfnReader, VERR_INVALID_POINTER); AssertPtrReturn(pCfg, VERR_INVALID_POINTER); + /* Case insensitivity with internal lower or upper case conversion is mutually exclusive. */ + AssertReturn( (pCfg->fFlags & (RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_LOWER | RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_UPPER)) + != (RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_LOWER | RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_UPPER), VERR_INVALID_PARAMETER); + if (!cchBuf) cchBuf = _16K; int rc = VINF_SUCCESS; @@ -602,6 +864,10 @@ RTDECL(int) RTScriptLexCreateFromReader(PRTSCRIPTLEX phScriptLex, PFNRTSCRIPTLEX pThis->pchCur = NULL; pThis->hStrCacheId = NULL; pThis->hStrCacheStringLit = NULL; + pThis->hStrCacheComments = NULL; + + if (pCfg->fFlags & RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS) + rc = RTStrCacheCreate(&pThis->hStrCacheComments, "LEX-Comments"); rc = RTStrCacheCreate(&pThis->hStrCacheId, "LEX-Ide"); if (RT_SUCCESS(rc)) @@ -624,6 +890,14 @@ RTDECL(int) RTScriptLexCreateFromReader(PRTSCRIPTLEX phScriptLex, PFNRTSCRIPTLEX else pThis->fFlags |= RTSCRIPT_LEX_INT_F_STR_CACHE_STR_LIT_FREE; + if (pCfg->fFlags & RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS) + { + if (phStrCacheComments) + *phStrCacheComments = pThis->hStrCacheComments; + else + pThis->fFlags |= RTSCRIPT_LEX_INT_F_STR_CACHE_COMMENTS_FREE; + } + return VINF_SUCCESS; } @@ -633,6 +907,8 @@ RTDECL(int) RTScriptLexCreateFromReader(PRTSCRIPTLEX phScriptLex, PFNRTSCRIPTLEX RTStrCacheDestroy(pThis->hStrCacheId); } + if (pThis->hStrCacheComments) + RTStrCacheDestroy(pThis->hStrCacheComments); RTMemFree(pThis); } else @@ -667,10 +943,10 @@ static DECLCALLBACK(int) rtScriptLexReaderStr(RTSCRIPTLEX hScriptLex, size_t off RTDECL(int) RTScriptLexCreateFromString(PRTSCRIPTLEX phScriptLex, const char *pszSrc, PRTSTRCACHE phStrCacheId, - PRTSTRCACHE phStrCacheStringLit, PCRTSCRIPTLEXCFG pCfg) + PRTSTRCACHE phStrCacheStringLit, PRTSTRCACHE phStrCacheComments, PCRTSCRIPTLEXCFG pCfg) { return RTScriptLexCreateFromReader(phScriptLex, rtScriptLexReaderStr, NULL, (void *)pszSrc, 0, - phStrCacheId, phStrCacheStringLit, pCfg); + phStrCacheId, phStrCacheStringLit, phStrCacheComments, pCfg); } @@ -700,14 +976,14 @@ static DECLCALLBACK(void) rtScriptLexDtorFile(RTSCRIPTLEX hScriptLex, void *pvUs RTDECL(int) RTScriptLexCreateFromFile(PRTSCRIPTLEX phScriptLex, const char *pszFilename, PRTSTRCACHE phStrCacheId, - PRTSTRCACHE phStrCacheStringLit, PCRTSCRIPTLEXCFG pCfg) + PRTSTRCACHE phStrCacheStringLit, PRTSTRCACHE phStrCacheComments, PCRTSCRIPTLEXCFG pCfg) { RTFILE hFile; int rc = RTFileOpen(&hFile, pszFilename, RTFILE_O_READ | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN); if (RT_SUCCESS(rc)) { rc = RTScriptLexCreateFromReader(phScriptLex, rtScriptLexReaderFile, rtScriptLexDtorFile, (void *)hFile, 0, - phStrCacheId, phStrCacheStringLit, pCfg); + phStrCacheId, phStrCacheStringLit, phStrCacheComments, pCfg); if (RT_FAILURE(rc)) RTFileClose(hFile); } @@ -728,6 +1004,8 @@ RTDECL(void) RTScriptLexDestroy(RTSCRIPTLEX hScriptLex) RTStrCacheDestroy(pThis->hStrCacheId); if (pThis->fFlags & RTSCRIPT_LEX_INT_F_STR_CACHE_STR_LIT_FREE) RTStrCacheDestroy(pThis->hStrCacheStringLit); + if (pThis->fFlags & RTSCRIPT_LEX_INT_F_STR_CACHE_COMMENTS_FREE) + RTStrCacheDestroy(pThis->hStrCacheComments); if (pThis->pszStrLit) RTStrFree(pThis->pszStrLit); @@ -832,6 +1110,10 @@ RTDECL(char) RTScriptLexPeekChEx(RTSCRIPTLEX hScriptLex, unsigned idx, uint32_t PRTSCRIPTLEXINT pThis = hScriptLex; AssertPtrReturn(pThis, '\0'); + /* Try to fill up the input buffer if peeking would overflow it. */ + if (pThis->pchCur + idx >= &pThis->achBuf[pThis->cchBuf]) + rtScriptLexFillBuffer(pThis); + /* Just return the character if it is in the current buffer. */ char ch = '\0'; if (RT_LIKELY(pThis->pchCur + idx < &pThis->achBuf[pThis->cchBuf])) @@ -843,9 +1125,13 @@ RTDECL(char) RTScriptLexPeekChEx(RTSCRIPTLEX hScriptLex, unsigned idx, uint32_t AssertReleaseFailed(); } - if ( (pThis->pCfg->fFlags & RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE) - && !(fFlags & RTSCRIPT_LEX_CONV_F_NOTHING)) - ch = RT_C_TO_LOWER(ch); + if (!(fFlags & RTSCRIPT_LEX_CONV_F_NOTHING)) + { + if (pThis->pCfg->fFlags & RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_LOWER) + ch = RT_C_TO_LOWER(ch); + else if (pThis->pCfg->fFlags & RTSCRIPT_LEX_CFG_F_CASE_INSENSITIVE_UPPER) + ch = RT_C_TO_UPPER(ch); + } return ch; } @@ -879,9 +1165,12 @@ RTDECL(void) RTScriptLexSkipWhitespace(RTSCRIPTLEX hScriptLex) const char *pszWs = pThis->pCfg->pszWhitespace ? pThis->pCfg->pszWhitespace : g_szWsDef; if ( rtScriptLexLocateChInStrConsume(pThis, ch, pszWs) - || rtScriptLexIsNewlineConsume(pThis, ch) - || rtScriptLexIsMultiLineCommentConsume(pThis, ch) - || rtScriptLexIsSingleLineCommentConsume(pThis, ch)) + || rtScriptLexIsNewlineConsume(pThis, ch)) + continue; + + if ( !(pThis->pCfg->fFlags & RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS) + && ( rtScriptLexIsMultiLineCommentConsume(pThis, ch) + || rtScriptLexIsSingleLineCommentConsume(pThis, ch))) continue; /* All white space skipped, next is some real content. */ @@ -913,7 +1202,7 @@ RTDECL(int) RTScriptLexScanNumber(RTSCRIPTLEX hScriptLex, uint8_t uBase, bool fA { /* Some hex prefix? */ char chNext = RTScriptLexPeekCh(hScriptLex, 1); - if (chNext == 'x') + if (chNext == 'x' || chNext == 'X') { uBase = 16; RTScriptLexConsumeCh(hScriptLex); @@ -928,7 +1217,9 @@ RTDECL(int) RTScriptLexScanNumber(RTSCRIPTLEX hScriptLex, uint8_t uBase, bool fA for (;;) { if ( (ch < '0' || ch > '9') - && (ch < 'a' || ch > 'f' || uBase == 10)) + && ( ( !(ch >= 'a' && ch <= 'f') + && !(ch >= 'A' && ch <= 'F')) + || uBase == 10)) { if (pTok->Type.Number.enmType == RTSCRIPTLEXTOKNUMTYPE_INTEGER) pTok->Type.Number.Type.i64 = -(int64_t)u64; @@ -946,6 +1237,11 @@ RTDECL(int) RTScriptLexScanNumber(RTSCRIPTLEX hScriptLex, uint8_t uBase, bool fA Assert(uBase == 16); u64 = (u64 << 4) + 10 + (ch - 'a'); } + else if (ch >= 'A' && ch <= 'F') + { + Assert(uBase == 16); + u64 = (u64 << 4) + 10 + (ch - 'A'); + } ch = RTScriptLexConsumeCh(hScriptLex); } @@ -973,13 +1269,13 @@ RTDECL(int) RTScriptLexScanIdentifier(RTSCRIPTLEX hScriptLex, char ch, if ( idx == sizeof(aszIde) - 1 && rtScriptLexLocateChInStrConsume(hScriptLex, ch, pszCharSet)) - return rtScriptLexProduceTokError(hScriptLex, pTok, VERR_BUFFER_OVERFLOW, "Lexer: Identifier exceeds the allowed length"); + return RTScriptLexProduceTokError(hScriptLex, pTok, VERR_BUFFER_OVERFLOW, "Lexer: Identifier exceeds the allowed length"); /* Insert into string cache. */ pTok->enmType = RTSCRIPTLEXTOKTYPE_IDENTIFIER; pTok->Type.Id.pszIde = RTStrCacheEnterN(pThis->hStrCacheId, &aszIde[0], idx); if (RT_UNLIKELY(!pTok->Type.Id.pszIde)) - return rtScriptLexProduceTokError(hScriptLex, pTok, VERR_NO_STR_MEMORY, "Lexer: Out of memory inserting identifier into string cache"); + return RTScriptLexProduceTokError(hScriptLex, pTok, VERR_NO_STR_MEMORY, "Lexer: Out of memory inserting identifier into string cache"); pTok->PosEnd = pThis->Pos; return VINF_SUCCESS; @@ -1004,7 +1300,7 @@ static int rtScriptLexScanStringLiteralChAdd(PRTSCRIPTLEXINT pThis, char ch, uin { /* Increase memory. */ size_t cchMaxNew = pThis->cchStrLitMax + 64; - char *pszNew = NULL; + char *pszNew = pThis->pszStrLit; rc = RTStrRealloc(&pszNew, cchMaxNew * sizeof(char)); if (RT_SUCCESS(rc)) { @@ -1033,29 +1329,31 @@ RTDECL(int) RTScriptLexScanStringLiteralC(RTSCRIPTLEX hScriptLex, char ch, uint32_t idxChCur = 0; int rc = rtScriptLexScanStringLiteralChAdd(pThis, '\0', idxChCur); if (RT_FAILURE(rc)) - return rtScriptLexProduceTokError(hScriptLex, pTok, rc, "Lexer: Error adding character to string literal"); + return RTScriptLexProduceTokError(hScriptLex, pTok, rc, "Lexer: Error adding character to string literal"); - ch = RTScriptLexGetCh(hScriptLex); + ch = RTScriptLexGetChEx(hScriptLex, RTSCRIPT_LEX_CONV_F_NOTHING); for (;;) { if (ch == '\0') - return rtScriptLexProduceTokError(hScriptLex, pTok, VERR_EOF, "Lexer: End of stream before closing string literal terminal"); + return RTScriptLexProduceTokError(hScriptLex, pTok, VERR_EOF, "Lexer: End of stream before closing string literal terminal"); else if (ch == '\"') { + RTScriptLexConsumeCh(hScriptLex); + /* End of string, add it to the string literal cache and build the token. */ pTok->enmType = RTSCRIPTLEXTOKTYPE_STRINGLIT; pTok->Type.StringLit.cchString = idxChCur; pTok->Type.StringLit.pszString = RTStrCacheEnterN(pThis->hStrCacheStringLit, pThis->pszStrLit, idxChCur); if (RT_UNLIKELY(!pTok->Type.StringLit.pszString)) - return rtScriptLexProduceTokError(hScriptLex, pTok, VERR_NO_STR_MEMORY, "Lexer: Error adding string literal to the cache"); + return RTScriptLexProduceTokError(hScriptLex, pTok, VERR_NO_STR_MEMORY, "Lexer: Error adding string literal to the cache"); else break; } else if (ch == '\\') { /* Start of escape sequence. */ - RTScriptLexConsumeCh(hScriptLex); - ch = RTScriptLexGetCh(hScriptLex); + RTScriptLexConsumeChEx(hScriptLex, RTSCRIPT_LEX_CONV_F_NOTHING); + ch = RTScriptLexGetChEx(hScriptLex, RTSCRIPT_LEX_CONV_F_NOTHING); switch (ch) { case 'a': /* Alert (Bell) */ @@ -1103,7 +1401,7 @@ RTDECL(int) RTScriptLexScanStringLiteralC(RTSCRIPTLEX hScriptLex, char ch, case 'U': /* Unicode point */ default: /* Not supported for now. */ - return rtScriptLexProduceTokError(hScriptLex, pTok, VERR_NOT_SUPPORTED, "Lexer: Invalid/unsupported escape sequence"); + return RTScriptLexProduceTokError(hScriptLex, pTok, VERR_NOT_SUPPORTED, "Lexer: Invalid/unsupported escape sequence"); } } @@ -1111,7 +1409,7 @@ RTDECL(int) RTScriptLexScanStringLiteralC(RTSCRIPTLEX hScriptLex, char ch, if (RT_SUCCESS(rc)) idxChCur++; else - return rtScriptLexProduceTokError(hScriptLex, pTok, rc, "Lexer: Error adding character to string literal"); + return RTScriptLexProduceTokError(hScriptLex, pTok, rc, "Lexer: Error adding character to string literal"); ch = RTScriptLexConsumeChEx(hScriptLex, RTSCRIPT_LEX_CONV_F_NOTHING); } @@ -1131,13 +1429,13 @@ RTDECL(int) RTScriptLexScanStringLiteralPascal(RTSCRIPTLEX hScriptLex, char ch, uint32_t idxChCur = 0; int rc = rtScriptLexScanStringLiteralChAdd(pThis, '\0', idxChCur); if (RT_FAILURE(rc)) - return rtScriptLexProduceTokError(hScriptLex, pTok, rc, "Lexer: Error adding character to string literal"); + return RTScriptLexProduceTokError(hScriptLex, pTok, rc, "Lexer: Error adding character to string literal"); ch = RTScriptLexGetChEx(hScriptLex, RTSCRIPT_LEX_CONV_F_NOTHING); for (;;) { if (ch == '\0') - return rtScriptLexProduceTokError(hScriptLex, pTok, VERR_EOF, "Lexer: End of stream before closing string literal terminal"); + return RTScriptLexProduceTokError(hScriptLex, pTok, VERR_EOF, "Lexer: End of stream before closing string literal terminal"); else if (ch == '\'') { /* @@ -1152,7 +1450,7 @@ RTDECL(int) RTScriptLexScanStringLiteralPascal(RTSCRIPTLEX hScriptLex, char ch, pTok->Type.StringLit.cchString = idxChCur; pTok->Type.StringLit.pszString = RTStrCacheEnterN(pThis->hStrCacheStringLit, pThis->pszStrLit, idxChCur); if (RT_UNLIKELY(!pTok->Type.StringLit.pszString)) - return rtScriptLexProduceTokError(hScriptLex, pTok, VERR_NO_STR_MEMORY, "Lexer: Error adding string literal to the cache"); + return RTScriptLexProduceTokError(hScriptLex, pTok, VERR_NO_STR_MEMORY, "Lexer: Error adding string literal to the cache"); else break; } @@ -1163,7 +1461,7 @@ RTDECL(int) RTScriptLexScanStringLiteralPascal(RTSCRIPTLEX hScriptLex, char ch, if (RT_SUCCESS(rc)) idxChCur++; else - return rtScriptLexProduceTokError(hScriptLex, pTok, rc, "Lexer: Error adding character to string literal"); + return RTScriptLexProduceTokError(hScriptLex, pTok, rc, "Lexer: Error adding character to string literal"); ch = RTScriptLexConsumeChEx(hScriptLex, RTSCRIPT_LEX_CONV_F_NOTHING); } diff --git a/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c index b7b108ef..98956673 100644 --- a/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c +++ b/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c @@ -62,6 +62,18 @@ # define PAGE_READONLY_EXEC PAGE_READONLY #endif +#if RTLNX_VER_MIN(2,6,0) +# ifdef __GFP_REPEAT +# define MY_GFP_REPEAT __GFP_REPEAT +# elif defined (__GFP_RETRY_MAYFAIL) /* Renamed in commit dcda9b04713c3f6ff0875652924844fae28286ea . */ +# define MY_GFP_REPEAT __GFP_RETRY_MAYFAIL +# else /* This is to notice when the flags are renamed/moved around again. */ +# error "Was this flag renamed again?" +# endif +# else +# define MY_GFP_REPEAT 0 +#endif + /** @def IPRT_USE_ALLOC_VM_AREA_FOR_EXEC * Whether we use alloc_vm_area (3.2+) for executable memory. * This is a must for 5.8+, but we enable it all the way back to 3.2.x for @@ -411,10 +423,8 @@ static int rtR0MemObjLinuxAllocPages(PRTR0MEMOBJLNX *ppMemLnx, RTR0MEMOBJTYPE en if (cPages > 255) { -# ifdef __GFP_REPEAT /* Try hard to allocate the memory, but the allocation attempt might fail. */ - fFlagsLnx |= __GFP_REPEAT; -# endif + fFlagsLnx |= MY_GFP_REPEAT; # ifdef __GFP_NOMEMALLOC /* Introduced with Linux 2.6.12: Don't use emergency reserves */ fFlagsLnx |= __GFP_NOMEMALLOC; @@ -989,13 +999,13 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, /* Try to avoid GFP_DMA. GFM_DMA32 was introduced with Linux 2.6.15. */ #if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32) /* ZONE_DMA32: 0-4GB */ - rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_DMA32, + rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_KERNEL | GFP_DMA32, false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY, pszTag); if (RT_FAILURE(rc)) #endif #ifdef RT_ARCH_AMD64 /* ZONE_DMA: 0-16MB */ - rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_DMA, + rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_KERNEL | GFP_DMA, false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY, pszTag); #else # ifdef CONFIG_X86_PAE diff --git a/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c index d3ca7119..2c21338c 100644 --- a/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c +++ b/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c @@ -422,7 +422,11 @@ static void rtTimerLnxStopSubTimer(PRTTIMERLNXSUBTIMER pSubTimer, bool fHighRes) } else #endif +# if RTLNX_VER_MIN(6,15,0) + timer_delete(&pSubTimer->u.Std.LnxTimer); +#else del_timer(&pSubTimer->u.Std.LnxTimer); +#endif rtTimerLnxSetState(&pSubTimer->enmState, RTTIMERLNXSTATE_STOPPED); } @@ -470,7 +474,11 @@ static void rtTimerLnxDestroyIt(PRTTIMER pTimer) hrtimer_cancel(&pTimer->aSubTimers[iCpu].u.Hr.LnxTimer); else #endif +# if RTLNX_VER_MIN(6,15,0) + timer_delete_sync(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer); +#else del_timer_sync(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer); +#endif } /* @@ -1626,8 +1634,13 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_ #ifdef RTTIMER_LINUX_WITH_HRTIMER if (pTimer->fHighRes) { +#if RTLNX_VER_MIN(6,15,0) + hrtimer_setup(&pTimer->aSubTimers[iCpu].u.Hr.LnxTimer, + rtTimerLinuxHrCallback, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); +#else hrtimer_init(&pTimer->aSubTimers[iCpu].u.Hr.LnxTimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); pTimer->aSubTimers[iCpu].u.Hr.LnxTimer.function = rtTimerLinuxHrCallback; +#endif } else #endif diff --git a/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp b/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp index 57bab770..f950f790 100644 --- a/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp +++ b/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp @@ -97,7 +97,7 @@ DECLHIDDEN(int) rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, ui } const char *pszDlError = dlerror(); - RTErrInfoSet(pErrInfo, VERR_FILE_NOT_FOUND, pszDlError); + RTErrInfoSet(pErrInfo, VERR_FILE_NOT_FOUND, RT_VALID_PTR(pszDlError) ? pszDlError : "unknown dlopen error"); LogRel(("rtldrNativeLoad: dlopen('%s', RTLD_NOW | RTLD_LOCAL) failed: %s\n", pszFilename, pszDlError)); return VERR_FILE_NOT_FOUND; } diff --git a/src/VBox/Runtime/r3/win/VBoxRT-openssl-3.0.def b/src/VBox/Runtime/r3/win/VBoxRT-openssl-3.0.def index 2cd27287..58b7dcf4 100644 --- a/src/VBox/Runtime/r3/win/VBoxRT-openssl-3.0.def +++ b/src/VBox/Runtime/r3/win/VBoxRT-openssl-3.0.def @@ -152,6 +152,7 @@ OPENSSL_sk_pop_free OPENSSL_sk_value PEM_read_bio_DHparams + PEM_read_bio_Parameters RAND_load_file RAND_seed RAND_status @@ -166,6 +167,7 @@ SSL_CTX_get_cert_store ;exported above: SSL_CTX_load_verify_locations ;exported above: SSL_CTX_new + SSL_CTX_set0_tmp_dh_pkey SSL_CTX_set_client_CA_list SSL_CTX_set_default_passwd_cb SSL_CTX_set_default_passwd_cb_userdata diff --git a/src/VBox/Runtime/r3/xml.cpp b/src/VBox/Runtime/r3/xml.cpp index 4aab171f..5293215c 100644 --- a/src/VBox/Runtime/r3/xml.cpp +++ b/src/VBox/Runtime/r3/xml.cpp @@ -1871,7 +1871,7 @@ static void xmlParserBaseGenericError(void *pCtx, const char *pszMsg, ...) RT_NO va_end(args); } -#if LIBXML_VERSION >= 21206 +#if LIBXML_VERSION >= 21205 static void xmlStructuredErrorFunc(void *userData, const xmlError *error) RT_NOTHROW_DEF { NOREF(userData); @@ -1893,7 +1893,7 @@ XmlParserBase::XmlParserBase() throw std::bad_alloc(); /* per-thread so it must be here */ xmlSetGenericErrorFunc(NULL, xmlParserBaseGenericError); -#if LIBXML_VERSION >= 21206 +#if LIBXML_VERSION >= 21205 xmlSetStructuredErrorFunc(NULL, xmlStructuredErrorFunc); #else xmlSetStructuredErrorFunc(NULL, xmlParserBaseStructuredError); diff --git a/src/VBox/VMM/VMMR3/VMMR3VTable.cpp b/src/VBox/VMM/VMMR3/VMMR3VTable.cpp index fab05697..f6c7cb47 100644 --- a/src/VBox/VMM/VMMR3/VMMR3VTable.cpp +++ b/src/VBox/VMM/VMMR3/VMMR3VTable.cpp @@ -75,6 +75,16 @@ static DECLCALLBACK(int) vmmR3ReservedVTableEntry(void) } +#ifndef VBOX_WITH_DEBUGGER +/** Stub */ +DBGDECL(int) DBGCCreate(PUVM pUVM, PCDBGCIO pIo, unsigned fFlags) +{ + RT_NOREF(pUVM, pIo, fFlags); + return VERR_NOT_IMPLEMENTED; +} +#endif + + VMMR3DECL(PCVMMR3VTABLE) VMMR3GetVTable(void) { return &g_VMMR3VTable; diff --git a/src/VBox/ValidationKit/testmanager/db/TestManagerDatabase/businessinfo/Business Information.xml b/src/VBox/ValidationKit/testmanager/db/TestManagerDatabase/businessinfo/Business Information.xml new file mode 100644 index 00000000..67ee74c9 --- /dev/null +++ b/src/VBox/ValidationKit/testmanager/db/TestManagerDatabase/businessinfo/Business Information.xml @@ -0,0 +1,7 @@ + + +bird +2012-08-20 21:58:45 UTC +TestManagerDatabase +false + \ No newline at end of file diff --git a/src/VBox/ValidationKit/testmanager/db/TestManagerDatabase/pm/Process Model.xml b/src/VBox/ValidationKit/testmanager/db/TestManagerDatabase/pm/Process Model.xml new file mode 100644 index 00000000..b48fd449 --- /dev/null +++ b/src/VBox/ValidationKit/testmanager/db/TestManagerDatabase/pm/Process Model.xml @@ -0,0 +1,7 @@ + + +bird +2012-08-20 21:58:45 UTC +TestManagerDatabase +false + \ No newline at end of file diff --git a/src/libs/Makefile.kmk b/src/libs/Makefile.kmk index dad1f99c..6a2be564 100644 --- a/src/libs/Makefile.kmk +++ b/src/libs/Makefile.kmk @@ -109,7 +109,7 @@ if !defined(VBOX_ONLY_SDK) \ && (!defined(VBOX_ONLY_ADDITIONS) || !defined(VBOX_ONLY_ADDITIONS_WITHOUT_RTISOMAKER)) \ && (!defined(VBOX_ONLY_EXTPACKS) || defined(VBOX_NEED_EXTPACK_OPENSSL) || defined(VBOX_WITH_BLD_RTSIGNTOOL_SIGNING) || !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)) \ && ("$(SDK_VBoxOpenSslStatic_INCS)" == "$(SDK_VBoxOpenSslStatic_VBOX_DEFAULT_INCS)" || defined(VBOX_NEED_EXTPACK_OPENSSL)) - include $(PATH_SUB_CURRENT)/openssl-3.3.2/Makefile.kmk + include $(PATH_SUB_CURRENT)/openssl-3.4.1/Makefile.kmk endif @@ -133,8 +133,8 @@ endif # liblzma is used by the IPRT compression code and the iPXE ROM tool. if defined(VBOX_WITH_LIBLZMA) \ && !defined(VBOX_ONLY_SDK) \ - && "$(SDK_VBoxLibLzma_INCS)" == "$(PATH_ROOT)/src/libs/liblzma-5.4.1/api" - include $(PATH_SUB_CURRENT)/liblzma-5.4.1/Makefile.kmk + && "$(SDK_VBoxLibLzma_INCS)" == "$(PATH_ROOT)/src/libs/liblzma-5.8.1/api" + include $(PATH_SUB_CURRENT)/liblzma-5.8.1/Makefile.kmk endif diff --git a/src/libs/xpcom18a4/Config.kmk b/src/libs/xpcom18a4/Config.kmk index 13acfe98..605cbf6d 100644 --- a/src/libs/xpcom18a4/Config.kmk +++ b/src/libs/xpcom18a4/Config.kmk @@ -229,26 +229,19 @@ endif # # Template for building XPCOM executables for running at build time. # -# It extends the BLDPROG template in config.kmk but overrides CFLAGS -# and CXXFLAGS completely at the moment. -# TEMPLATE_XPComBldProg = XPCOM Build programs executables TEMPLATE_XPComBldProg_EXTENDS = VBoxAdvBldProg TEMPLATE_XPComBldProg_DEFS.$(KBUILD_HOST) = $(TEMPLATE_VBoxAdvBldProg_DEFS.$(KBUILD_HOST)) $(TEMPLATE_XPComExe_DEFS.$(KBUILD_HOST)) TEMPLATE_XPComBldProg_DEFS.x86 = $(TEMPLATE_VBoxAdvBldProg_DEFS.x86) $(TEMPLATE_XPComExe_DEFS.x86) TEMPLATE_XPComBldProg_DEFS.amd64 = $(TEMPLATE_VBoxAdvBldProg_DEFS.amd64) $(TEMPLATE_XPComExe_DEFS.amd64) TEMPLATE_XPComBldProg_DEFS.arm64 = $(TEMPLATE_VBoxAdvBldProg_DEFS.arm64) $(TEMPLATE_XPComExe_DEFS.arm64) +TEMPLATE_XPComBldProg_CFLAGS += -std=c99 TEMPLATE_XPComBldProg_INCS = \ $(VBOX_PATH_SDK)/bindings/xpcom/include \ $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \ $(VBOX_PATH_SDK)/bindings/xpcom/include/string \ $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \ $(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd -TEMPLATE_XPComBldProg_CFLAGS = $(filter-out $(VBOX_GCC_PEDANTIC_C), $(TEMPLATE_VBoxAdvBldProg_CFLAGS)) \ - $(VBOX_GCC_Wno-int-to-pointer-cast) $(VBOX_GCC_Wno-pointer-to-int-cast) $(VBOX_GCC_NON_PEDANTIC_C) -TEMPLATE_XPComBldProg_CXXFLAGS.darwin = $(TEMPLATE_VBoxAdvBldProg_CXXFLAGS.darwin) -fpascal-strings -fshort-wchar -fno-common -fno-rtti -TEMPLATE_XPComBldProg_CXXFLAGS.solaris = $(TEMPLATE_VBoxAdvBldProg_CXXFLAGS.solaris) -fno-omit-frame-pointer # for now anyway. -TEMPLATE_XPComBldProg_LDFLAGS.darwin = $(TEMPLATE_VBoxAdvBldProg_LDFLAGS.darwin) -fpascal-strings -fshort-wchar -fno-rtti -fno-exceptions TEMPLATE_XPComBldProg_ORDERDEPS = $(foreach hdrinst, $(filter %-HEADERS, $(INSTALLS)), $($(hdrinst)_1_TARGET)) TEMPLATE_XPComBldProg_LIBS.darwin = \ iconv diff --git a/src/libs/xpcom18a4/Makefile.kmk b/src/libs/xpcom18a4/Makefile.kmk index cb9b13a9..4828d92d 100644 --- a/src/libs/xpcom18a4/Makefile.kmk +++ b/src/libs/xpcom18a4/Makefile.kmk @@ -304,53 +304,17 @@ xpidl_TEMPLATE = XPComBldProg xpidl_DEFS = EXPORT_XPT_API ## @todo This assumes HOST == TARGET. xpidl_INST = $(INST_BIN) -## Obsolete hack: MacPorts is 32-bit on 10.5 and 64-bit on 10.6. Set your KBUILD_HOST_ARCH env.vars. accordingly. -#if "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "darwin.amd64" && defined(VBOX_MACOS_10_5_WORKAROUND) -# xpidl_BLD_TRG_ARCH = x86 -# ## @todo kBuild ticket 84 workarounds: -# xpidl_DEFS.x86 = $(TEMPLATE_XPComBldProg_DEFS.x86) -# xpidl_CFLAGS.x86 = $(TEMPLATE_XPComBldProg_CFLAGS.x86) -# xpidl_CXXFLAGS.x86 = $(TEMPLATE_XPComBldProg_CXXFLAGS.x86) -# xpidl_LDFLAGS.x86 = $(TEMPLATE_XPComBldProg_LDFLAGS.x86) -#endif -ifdef VBOX_WITH_JAVA_SUPPORT_IN_XPIDL - xpidl_DEFS += VBOX_XPIDL_EMULATE_GENJIFACES VBOX_XPIDL_EMULATE_GENJIFACES_DIFF -endif xpidl_SOURCES = \ xpcom/typelib/xpidl/xpidl.c \ xpcom/typelib/xpidl/xpidl_idl.c \ xpcom/typelib/xpidl/xpidl_util.c \ xpcom/typelib/xpidl/xpidl_header.c \ xpcom/typelib/xpidl/xpidl_typelib.c \ - xpcom/typelib/xpidl/xpidl_doc.c \ - xpcom/typelib/xpidl/xpidl_java.c \ xpcom/typelib/xpt/src/xpt_arena.c \ xpcom/typelib/xpt/src/xpt_struct.c \ - xpcom/typelib/xpt/src/xpt_xdr.c + xpcom/typelib/xpt/src/xpt_xdr.c \ + ../../VBox/Runtime/common/script/scriptlex.cpp -# We do these ONCE. -libIDL_config_cflags := $(shell $(VBOX_LIBIDL_CONFIG) --cflags) -libIDL_config_libs := $(shell $(VBOX_LIBIDL_CONFIG) --libs) -xpidl_CFLAGS = \ - $(libIDL_config_cflags) -if1of ($(KBUILD_HOST), linux solaris) - xpidl_LDFLAGS = \ - $(filter-out -l%,$(libIDL_config_libs)) - xpidl_LIBS.$(KBUILD_HOST) += \ - $(subst -l,,$(filter -l%,$(libIDL_config_libs))) -else - ifeq ($(KBUILD_HOST),darwin) - # Need to put the SDK /usr/lib before the libIDL path to make it pick the system iconv - xpidl_LDFLAGS = \ - -L$(VBOX_PATH_MACOSX_SDK)/usr/lib \ - $(libIDL_config_libs) - else - xpidl_LDFLAGS = \ - $(libIDL_config_libs) - endif -endif -xpidl_LDFLAGS.linux = \ - $(VBOX_LD_as_needed) # # The XPT linker. diff --git a/src/libs/xpcom18a4/java/Makefile.kmk b/src/libs/xpcom18a4/java/Makefile.kmk index b8386a89..1da8b6e8 100644 --- a/src/libs/xpcom18a4/java/Makefile.kmk +++ b/src/libs/xpcom18a4/java/Makefile.kmk @@ -91,11 +91,7 @@ INSTALLS += VBoxJXpcom-inst-jar VBOX_JXPCOM_JAR = $(VBoxJXpcom-inst-jar_0_OUTDIR)/vboxjxpcom.jar VBOX_JXPCOM_NSERROR = $(VBOX_JXPCOM_GEN)/java/XPCOMError.java -ifndef VBOX_WITH_JAVA_SUPPORT_IN_XPIDL - VBOX_JXPCOM_GEN = $(VBOX_JXPCOM_TARGET)/jxpcomgen -else - VBOX_JXPCOM_GEN = $(VBOX_JXPCOM_TARGET)/jxpcomgen-idl -endif +VBOX_JXPCOM_GEN = $(VBOX_JXPCOM_TARGET)/jxpcomgen VBoxJXpcom-inst-jar_INST = $(INST_SDK)bindings/xpcom/java/ VBoxJXpcom-inst-jar_MODE = a+r,u+w @@ -138,41 +134,21 @@ $(VBOX_JXPCOM_NSERROR): $(VBOX_PATH_XPCOM_SRC)/xpcom/base/nsError.h $(VBOX_JXPCO $(call MSG_L1,Generating $@) $(QUIET)perl $(VBOX_JXPCOM_SRC)/tools/gen-nsError.pl < $< > $@ -ifndef VBOX_WITH_JAVA_SUPPORT_IN_XPIDL - # - # Generate .java interface files from .xidl - # - - $(VBOX_JXPCOM_GEN)/jxpcomgen.list: \ - $(VBOX_XIDL_FILE) \ - $(VBOX_FILESPLIT) \ - $(VBOX_JXPCOM_SRC)/tools/genjifaces.xsl \ - | $(VBOX_JXPCOM_GEN)/java/interfaces/ +# +# Generate .java interface files from .xidl +# +$(VBOX_JXPCOM_GEN)/jxpcomgen.list: \ + $(VBOX_XIDL_FILE) \ + $(VBOX_FILESPLIT) \ + $(VBOX_JXPCOM_SRC)/tools/genjifaces.xsl \ + | $(VBOX_JXPCOM_GEN)/java/interfaces/ $(call MSG_L1,Generating Java interface files) $(QUIET)$(RM) -f $(wildcard $(VBOX_JXPCOM_GEN)/java/interfaces/*.java) $(QUIET)$(VBOX_XSLTPROC) \ - -o $(VBOX_JXPCOM_GEN)/java/interfaces/merged.file $(VBOX_JXPCOM_SRC)/tools/genjifaces.xsl $< + -o $(VBOX_JXPCOM_GEN)/java/interfaces/merged.file $(VBOX_JXPCOM_SRC)/tools/genjifaces.xsl $< $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JXPCOM_GEN)/java/interfaces/merged.file $(VBOX_JXPCOM_GEN)/java/interfaces $(QUIET)echo $(VBOX_JXPCOM_GEN)/java/interfaces/*.java > $@ -else # VBOX_WITH_JAVA_SUPPORT_IN_XPIDL - # - # Generate .java interface files from the XPCOM and VirtualBox IDL files. - # - # Note! There is not a 1:1 relationship between input and output files here, unfortunately. - # Note! VBOX_JXPCOM_NSERROR shares the output directory with us. - # - $(VBOX_JXPCOM_GEN)/jxpcomgen.list: \ - $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl \ - $$(addprefix $(VBOX_PATH_XPCOM_SRC)/,$$(XPCOM_IDLFILES)) \ - $(VBOX_XPIDL) \ - | $(VBOX_JXPCOM_GEN)/java/ - $(call MSG_L1,Generating XPCOM Java interface files from IDL) - $(QUIET)$(RM) -f $(filter-out %/XPCOMError.java, $(wildcard $(VBOX_JXPCOM_GEN)/java/*.java)) - $(foreach idl, $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl $(addprefix $(VBOX_PATH_XPCOM_SRC)/,$(XPCOM_IDLFILES))\ - , $(NLTAB)$(QUIET)$(VBOX_XPIDL) -m java $(XPIDL_INCS) -e $(VBOX_JXPCOM_GEN)/java/$(basename $(notdir $(idl))).java $(idl) ) - $(QUIET)echo $(VBOX_JXPCOM_GEN)/java/*.java > $@ -endif # VBOX_WITH_JAVA_SUPPORT_IN_XPIDL $(VBOX_JXPCOM_GEN)/jxpcomglue.list: \ $(VBOX_XIDL_FILE) \ diff --git a/src/libs/xpcom18a4/xpcom/components/nsIClassInfo.idl b/src/libs/xpcom18a4/xpcom/components/nsIClassInfo.idl index e934057c..8a9bd727 100644 --- a/src/libs/xpcom18a4/xpcom/components/nsIClassInfo.idl +++ b/src/libs/xpcom18a4/xpcom/components/nsIClassInfo.idl @@ -100,22 +100,22 @@ interface nsIClassInfo : nsISupports /** * Bitflags for 'flags' attribute. */ - const PRUint32 SINGLETON = 1 << 0; - const PRUint32 THREADSAFE = 1 << 1; - const PRUint32 MAIN_THREAD_ONLY = 1 << 2; - const PRUint32 DOM_OBJECT = 1 << 3; - const PRUint32 PLUGIN_OBJECT = 1 << 4; - const PRUint32 EAGER_CLASSINFO = 1 << 5; + const PRUint32 SINGLETON = 0x01; + const PRUint32 THREADSAFE = 0x02; + const PRUint32 MAIN_THREAD_ONLY = 0x04; + const PRUint32 DOM_OBJECT = 0x08; + const PRUint32 PLUGIN_OBJECT = 0x10; + const PRUint32 EAGER_CLASSINFO = 0x20; /** * 'flags' attribute bitflag: whether objects of this type implement * nsIContent. */ - const PRUint32 CONTENT_NODE = 1 << 6; + const PRUint32 CONTENT_NODE = 0x40; // The high order bit is RESERVED for consumers of these flags. // No implementor of this interface should ever return flags // with this bit set. - const PRUint32 RESERVED = 1 << 31; + const PRUint32 RESERVED = 0x80000000; readonly attribute PRUint32 flags; diff --git a/src/libs/xpcom18a4/xpcom/components/nsIComponentManager.idl b/src/libs/xpcom18a4/xpcom/components/nsIComponentManager.idl index 20661803..bb514ac8 100644 --- a/src/libs/xpcom18a4/xpcom/components/nsIComponentManager.idl +++ b/src/libs/xpcom18a4/xpcom/components/nsIComponentManager.idl @@ -108,4 +108,4 @@ interface nsIComponentManager : nsISupports #include "nsComponentManagerUtils.h" #include "nsComponentManagerObsolete.h" #endif -%} C++ +%} diff --git a/src/libs/xpcom18a4/xpcom/components/nsIComponentManagerObsolete.idl b/src/libs/xpcom18a4/xpcom/components/nsIComponentManagerObsolete.idl index ac5f7975..def81bbd 100644 --- a/src/libs/xpcom18a4/xpcom/components/nsIComponentManagerObsolete.idl +++ b/src/libs/xpcom18a4/xpcom/components/nsIComponentManagerObsolete.idl @@ -347,5 +347,5 @@ interface nsIComponentManagerObsolete : nsISupports %{ C++ /* include after the class def'n, because it needs to see it. */ #include "nsComponentManagerUtils.h" -%} C++ +%} diff --git a/src/libs/xpcom18a4/xpcom/components/xcDll.cpp b/src/libs/xpcom18a4/xpcom/components/xcDll.cpp index 2fbc0335..289939ba 100644 --- a/src/libs/xpcom18a4/xpcom/components/xcDll.cpp +++ b/src/libs/xpcom18a4/xpcom/components/xcDll.cpp @@ -131,7 +131,7 @@ PRBool nsDll::Load(void) #ifdef NS_BUILD_REFCNT_LOGGING nsTraceRefcntImpl::SetActivityIsLegal(PR_FALSE); #endif - +#ifndef VBOX /* This is related to DEPENDENT_LIBS, which we've disabled. */ // Load any library dependencies // The Component Loader Manager may hold onto some extra data // set by either the native component loader or the native @@ -145,6 +145,7 @@ PRBool nsDll::Load(void) if (!manager) return PR_TRUE; + nsXPIDLCString extraData; manager->GetOptionalData(m_dllSpec, nsnull, getter_Copies(extraData)); @@ -220,12 +221,14 @@ PRBool nsDll::Load(void) } nsMemory::Free(buffer); } +#endif /* !VBOX */ // load the component nsCOMPtr lf(do_QueryInterface(m_dllSpec)); NS_ASSERTION(lf, "nsIFile here must implement a nsILocalFile"); lf->Load(&m_hMod); +#ifndef VBOX /* This is related to DEPENDENT_LIBS, which we've disabled. */ // Unload any of library dependencies we loaded earlier. The assumption // here is that the component will have a "internal" reference count to // the dependency library we just loaded. @@ -236,6 +239,7 @@ PRBool nsDll::Load(void) for (PRInt32 index = 0; index < arrayCount; index++) RTLdrClose((RTLDRMOD)dependentLibArray.ElementAt(index)); } +#endif /* !VBOX */ #ifdef NS_BUILD_REFCNT_LOGGING nsTraceRefcntImpl::SetActivityIsLegal(PR_TRUE); diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpidl/README b/src/libs/xpcom18a4/xpcom/typelib/xpidl/README deleted file mode 100644 index b7a400e0..00000000 --- a/src/libs/xpcom18a4/xpcom/typelib/xpidl/README +++ /dev/null @@ -1,16 +0,0 @@ -Wed Dec 2 14:35:41 EST 1998 - -xpidl depends on Andrew Veliath and Elliot Lee's libIDL, a part of the -GNOME ORBit C ORB. We currently require libIDL >= 0.6.3, which in turn -requires glib >= 1.2.0. - -libIDL builds for Linux and Win32 can be found, along with source -tarballs, at http://www.rpi.edu/~veliaa/libIDL/, and Win32 users will -need glib 1.2 and glib 1.2-dev from -http://user.sgic.fi/~tml/gimp/win32/. Source and Linux RPMs are also -available from ftp://ftp.mozilla.org/pub/mozilla/libraries, and Win32 -binaries are included in the wintools.zip file at -ftp://ftp.mozilla.org/pub/mozilla/source/wintools.zip. A Mac project -is in progress, and should be appearing shortly. - -glib tarballs and RPMs for Linux can be found through http://www.gtk.org. diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl.c b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl.c index 28602662..2fd3cff3 100644 --- a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl.c +++ b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl.c @@ -45,8 +45,6 @@ static ModeData modes[] = { {"header", "Generate C++ header", "h", xpidl_header_dispatch}, {"typelib", "Generate XPConnect typelib", "xpt", xpidl_typelib_dispatch}, - {"doc", "Generate HTML documentation", "html", xpidl_doc_dispatch}, - {"java", "Generate Java interface", "java", xpidl_java_dispatch}, {0, 0, 0, 0} }; @@ -61,11 +59,11 @@ FindMode(char *mode) return NULL; } -gboolean enable_debug = FALSE; -gboolean enable_warnings = FALSE; -gboolean verbose_mode = FALSE; -gboolean emit_typelib_annotations = FALSE; -gboolean explicit_output_filename = FALSE; +bool enable_debug = false; +bool enable_warnings = false; +bool verbose_mode = false; +bool emit_typelib_annotations = false; +bool explicit_output_filename = false; /* The following globals are explained in xpt_struct.h */ PRUint8 major_version = XPT_MAJOR_VERSION; @@ -86,9 +84,9 @@ static char xpidl_usage_str[] = static void xpidl_usage(int argc, char *argv[]) { - int i; + RT_NOREF(argc); fprintf(stderr, xpidl_usage_str, argv[0]); - for (i = 0; modes[i].mode; i++) { + for (int i = 0; modes[i].mode; i++) { fprintf(stderr, " %-12s %-30s (.%s)\n", modes[i].mode, modes[i].modeInfo, modes[i].suffix); } @@ -99,18 +97,15 @@ int main(int argc, char *argv[]) RTR3InitExeNoArguments(0); int i; - IncludePathEntry *inc, *inc_head, **inc_tail; + RTLISTANCHOR LstIncludePaths; char *file_basename = NULL; ModeData *mode = NULL; - gboolean create_old_typelib = FALSE; - /* turn this on for extra checking of our code */ -/* IDL_check_cast_enable(TRUE); */ + RTListInit(&LstIncludePaths); - inc_head = xpidl_malloc(sizeof *inc); - inc_head->directory = "."; - inc_head->next = NULL; - inc_tail = &inc_head->next; + PXPIDLINCLUDEDIR pInc = (PXPIDLINCLUDEDIR)xpidl_malloc(sizeof(*pInc)); + pInc->pszPath = "."; + RTListAppend(&LstIncludePaths, &pInc->NdIncludes); for (i = 1; i < argc; i++) { if (argv[i][0] != '-') @@ -122,13 +117,13 @@ int main(int argc, char *argv[]) case 0: /* - is a legal input filename (stdin) */ goto done_options; case 'a': - emit_typelib_annotations = TRUE; + emit_typelib_annotations = true; break; case 'w': - enable_warnings = TRUE; + enable_warnings = true; break; case 'v': - verbose_mode = TRUE; + verbose_mode = true; break; case 't': { @@ -146,15 +141,6 @@ int main(int argc, char *argv[]) return 1; } - /* Do not allow more than one "-t" definition */ - if (create_old_typelib) { - fprintf(stderr, - "ERROR: -t argument used twice. " - "Cannot specify more than one version\n"); - xpidl_usage(argc, argv); - return 1; - } - /* * Assume that the argument after "-t" is the version number string * and search for it in our internal list of acceptable version @@ -165,8 +151,6 @@ int main(int argc, char *argv[]) case XPT_VERSION_CURRENT: break; case XPT_VERSION_OLD: - create_old_typelib = TRUE; - break; case XPT_VERSION_UNSUPPORTED: fprintf(stderr, "ERROR: version \"%s\" not supported.\n", argv[i]); @@ -187,20 +171,16 @@ int main(int argc, char *argv[]) xpidl_usage(argc, argv); return 1; } - inc = xpidl_malloc(sizeof *inc); + pInc = (PXPIDLINCLUDEDIR)xpidl_malloc(sizeof(*pInc)); if (argv[i][2] == '\0') { /* is it the -I foo form? */ - inc->directory = argv[++i]; + pInc->pszPath = argv[++i]; } else { /* must be the -Ifoo form. Don't preincrement i. */ - inc->directory = argv[i] + 2; + pInc->pszPath = argv[i] + 2; } -#ifdef DEBUG_shaver_includes - fprintf(stderr, "adding %s to include path\n", inc->directory); -#endif - inc->next = NULL; - *inc_tail = inc; - inc_tail = &inc->next; + + RTListAppend(&LstIncludePaths, &pInc->NdIncludes); break; case 'o': if (i == argc) { @@ -209,7 +189,7 @@ int main(int argc, char *argv[]) return 1; } file_basename = argv[++i]; - explicit_output_filename = FALSE; + explicit_output_filename = false; break; case 'e': if (i == argc) { @@ -218,7 +198,7 @@ int main(int argc, char *argv[]) return 1; } file_basename = argv[++i]; - explicit_output_filename = TRUE; + explicit_output_filename = true; break; case 'm': if (i + 1 == argc) { @@ -261,8 +241,12 @@ int main(int argc, char *argv[]) * Don't try to process multiple files, given that we don't handle -o * multiply. */ - if (xpidl_process_idl(argv[i], inc_head, file_basename, mode)) + int rc = xpidl_process_idl(argv[i], &LstIncludePaths, file_basename, mode); + if (RT_SUCCESS(rc)) return 0; + /** @todo Free include paths. */ + + printf("Failed to process IDL file\n"); return 1; } diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl.h b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl.h index 9f41737b..7aa44186 100644 --- a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl.h +++ b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl.h @@ -42,100 +42,278 @@ #ifndef __xpidl_h #define __xpidl_h +#include +#include +#include + #include #include #include #include -#include -#include /* After glib.h to avoid warnings about shadowing 'index'. */ - -#ifndef XP_MAC -#include -#else -#include -#endif +#include #include -#define XPIDL_WARNING(x) IDL_tree_warning x + +/** + * An include path. + */ +typedef struct XPIDLINCLUDEDIR +{ + /** Node for the list of include paths. */ + RTLISTNODE NdIncludes; + /** The zero terminated include path. */ + const char *pszPath; +} XPIDLINCLUDEDIR; +/** Pointer to an include path. */ +typedef XPIDLINCLUDEDIR *PXPIDLINCLUDEDIR; +/** Pointer to a const include path. */ +typedef const XPIDLINCLUDEDIR *PCXPIDLINCLUDEDIR; + + +/** + * The input stream. + */ +typedef struct XPIDLINPUT +{ + /** Node for the list of inputs. */ + RTLISTNODE NdInput; + /** Node for the list of include. */ + RTLISTNODE NdInclude; + /** The list of includes this input generated. */ + RTLISTANCHOR LstIncludes; + /** The basename for this input. */ + char *pszBasename; + /** The filename for this input. */ + char *pszFilename; + /** The lexer instance for this input. */ + RTSCRIPTLEX hIdlLex; +} XPIDLINPUT; +/** Pointer to an input stream. */ +typedef XPIDLINPUT *PXPIDLINPUT; +/** Pointer to a const input stream. */ +typedef const XPIDLINPUT *PCXPIDLINPUT; + + +/** + * IDL node type. + */ +typedef enum XPIDLNDTYPE +{ + kXpidlNdType_Invalid = 0, + kXpidlNdType_RawBlock, + kXpidlNdType_Typedef, + kXpidlNdType_BaseType, + kXpidlNdType_Identifier, + kXpidlNdType_Native, + kXpidlNdType_Interface_Forward_Decl, + kXpidlNdType_Interface_Def, + kXpidlNdType_Attribute, + kXpidlNdType_Method, + kXpidlNdType_Parameter, + kXpidlNdType_Const +} XPIDLNDTYPE; + + +/** + * IDL base type. + */ +typedef enum XPIDLTYPE +{ + kXpidlType_Invalid = 0, + kXpidlType_Void, + kXpidlType_Boolean, + kXpidlType_Octet, + kXpidlType_Char, + kXpidlType_Wide_Char, + kXpidlType_Short, + kXpidlType_Long, + kXpidlType_Long_Long, + kXpidlType_Unsigned_Short, + kXpidlType_Unsigned_Long, + kXpidlType_Unsigned_Long_Long, + kXpidlType_String, + kXpidlType_Wide_String, + kXpidlType_Double, + kXpidlType_Float, +} XPIDLTYPE; + + +/** + * IDL direction. + */ +typedef enum XPIDLDIRECTION +{ + kXpidlDirection_Invalid = 0, + kXpidlDirection_In, + kXpidlDirection_InOut, + kXpidlDirection_Out +} XPIDLDIRECTION; + + +/** + * A node attribute. + */ +typedef struct XPIDLATTR +{ + /** The attribute name. */ + const char *pszName; + /** The value assigned if any. */ + const char *pszVal; +} XPIDLATTR; +/** Pointer to an attribute. */ +typedef XPIDLATTR *PXPIDLATTR; +/** Pointer to a const attribute. */ +typedef const XPIDLATTR *PCXPIDLATTR; + + +/** Pointer to an IDL node. */ +typedef struct XPIDLNODE *PXPIDLNODE; +/** Pointer to a const IDL node. */ +typedef const struct XPIDLNODE *PCXPIDLNODE; + +/** + * IDL node. + */ +typedef struct XPIDLNODE +{ + /** Node for the list this node is in. */ + RTLISTNODE NdLst; + /** The parent node (if any). */ + PCXPIDLNODE pParent; + /** The input stream this node was generated from (via #include's). */ + PCXPIDLINPUT pInput; + /** The type this node references (for identifiers and the inheritance for interfaces only). */ + PCXPIDLNODE pNdTypeRef; + /** The node type. */ + XPIDLNDTYPE enmType; + /** Node type dependent data. */ + union + { + struct + { + const char *pszRaw; + size_t cchRaw; + } RawBlock; + struct + { + PCXPIDLNODE pNodeTypeSpec; + const char *pszName; + } Typedef; + XPIDLTYPE enmBaseType; + const char *pszIde; + struct + { + const char *pszName; + const char *pszNative; + } Native; + const char *pszIfFwdName; + struct + { + const char *pszIfName; + const char *pszIfInherit; + RTLISTANCHOR LstBody; + } If; + struct + { + bool fReadonly; + PCXPIDLNODE pNdTypeSpec; + const char *pszName; + } Attribute; + struct + { + PCXPIDLNODE pNdTypeSpecRet; + const char *pszName; + RTLISTANCHOR LstParams; + } Method; + struct + { + PCXPIDLNODE pNdTypeSpec; + const char *pszName; + XPIDLDIRECTION enmDir; + } Param; + struct + { + PCXPIDLNODE pNdTypeSpec; + const char *pszName; + uint64_t u64Const; /* Only allowing numbers for now. */ + } Const; + } u; + /** Number of entries in the attribute array. */ + uint32_t cAttrs; + /** Node attributes array - variable in size. */ + XPIDLATTR aAttrs[1]; +} XPIDLNODE; + + +/** + * The IDL parsing state. + */ +typedef struct XPIDLPARSE +{ + /** List of input files. */ + RTLISTANCHOR LstInputs; + /** The list of XPIDL nodes from the root. */ + RTLISTANCHOR LstNodes; + /** Extended error info. */ + RTERRINFOSTATIC ErrInfo; + /** Current attributes parsed. */ + XPIDLATTR aAttrs[32]; + /** Number of entries in the attribute array. */ + uint32_t cAttrs; +} XPIDLPARSE; +/** Pointer to an IDL parsing state. */ +typedef XPIDLPARSE *PXPIDLPARSE; +/** Pointer to a const IDL parsing state. */ +typedef const XPIDLPARSE *PCXPIDLPARSE; + /* * Internal operation flags. */ -extern gboolean enable_debug; -extern gboolean enable_warnings; -extern gboolean verbose_mode; -extern gboolean emit_typelib_annotations; -extern gboolean explicit_output_filename; +extern bool enable_debug; +extern bool enable_warnings; +extern bool verbose_mode; +extern bool emit_typelib_annotations; +extern bool explicit_output_filename; extern PRUint8 major_version; extern PRUint8 minor_version; -typedef struct TreeState TreeState; -/* - * A function to handle an IDL_tree type. +/** + * Dispatch callback. + * + * @returns IPRT status code. + * @param pFile The file to output to. + * @param pInput The original input file to generate for. + * @param pParse The parsing state. + * @param pErrInfo Error information. */ -typedef gboolean (*nodeHandler)(TreeState *); +typedef DECLCALLBACKTYPE(int, FNXPIDLDISPATCH,(FILE *pFile, PCXPIDLINPUT pInput, PCXPIDLPARSE pParse, PRTERRINFO pErrInfo)); +/** Pointer to a dispatch callback. */ +typedef FNXPIDLDISPATCH *PFNXPIDLDISPATCH; -/* - * Struct containing functions to define the behavior of a given output mode. - */ -typedef struct backend { - nodeHandler *dispatch_table; /* nodeHandlers table, indexed by node type. */ - nodeHandler emit_prolog; /* called at beginning of output generation. */ - nodeHandler emit_epilog; /* called at end. */ -} backend; -/* Function that produces a struct of output-generation functions */ -typedef backend *(*backendFactory)(); - -extern backend *xpidl_header_dispatch(void); -extern backend *xpidl_typelib_dispatch(void); -extern backend *xpidl_doc_dispatch(void); -extern backend *xpidl_java_dispatch(void); +DECL_HIDDEN_CALLBACK(int) xpidl_header_dispatch(FILE *pFile, PCXPIDLINPUT pInput, PCXPIDLPARSE pParse, PRTERRINFO pErrInfo); +DECL_HIDDEN_CALLBACK(int) xpidl_typelib_dispatch(FILE *pFile, PCXPIDLINPUT pInput, PCXPIDLPARSE pParse, PRTERRINFO pErrInfo); typedef struct ModeData { char *mode; char *modeInfo; char *suffix; - backendFactory factory; + PFNXPIDLDISPATCH dispatch; } ModeData; -typedef struct IncludePathEntry { - char *directory; - struct IncludePathEntry *next; -} IncludePathEntry; - -struct TreeState { - FILE *file; - /* Maybe supplied by -o. Not related to (g_)basename from string.h or glib */ - char *basename; - IDL_ns ns; - IDL_tree tree; - GSList *base_includes; - nodeHandler *dispatch; - void *priv; /* mode-private data */ -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - char *real_outname; -#endif - -}; /* * Process an IDL file, generating InterfaceInfo, documentation and headers as * appropriate. */ int -xpidl_process_idl(char *filename, IncludePathEntry *include_path, +xpidl_process_idl(char *filename, PRTLISTANCHOR pLstIncludePaths, char *file_basename, ModeData *mode); -/* - * Iterate over an IDLN_LIST -- why is this not part of libIDL? - */ -void -xpidl_list_foreach(IDL_tree p, IDL_tree_func foreach, gpointer user_data); - /* * Wrapper whines to stderr then exits after null return from malloc or strdup. */ @@ -152,20 +330,6 @@ xpidl_strdup(const char *s); char * xpidl_basename(const char * path); -/* - * Process an XPIDL node and its kids, if any. - */ -gboolean -xpidl_process_node(TreeState *state); - -/* - * Write a newline folllowed by an indented, one-line comment containing IDL - * source decompiled from state->tree. - */ -void -xpidl_write_comment(TreeState *state, int indent); - - /* * Functions for parsing and printing UUIDs. @@ -180,81 +344,86 @@ xpidl_write_comment(TreeState *state, int indent); * Print an iid to into a supplied buffer; the buffer should be at least * UUID_LENGTH bytes. */ -gboolean +bool xpidl_sprint_iid(nsID *iid, char iidbuf[]); /* * Parse a uuid string into an nsID struct. We cannot link against libxpcom, * so we re-implement nsID::Parse here. */ -gboolean +bool xpidl_parse_iid(nsID *id, const char *str); +DECLHIDDEN(PCXPIDLATTR) xpidlNodeAttrFind(PCXPIDLNODE pNd, const char *pszAttr); + + +DECLHIDDEN(int) xpidlIdlError(PRTERRINFO pErrInfo, PCXPIDLNODE pNd, int rc, const char *pszFmt, ...); + /* Try to common a little node-handling stuff. */ -/* is this node from an aggregate type (interface)? */ -#define UP_IS_AGGREGATE(node) \ - (IDL_NODE_UP(node) && \ - (IDL_NODE_TYPE(IDL_NODE_UP(node)) == IDLN_INTERFACE || \ - IDL_NODE_TYPE(IDL_NODE_UP(node)) == IDLN_FORWARD_DCL)) -#define UP_IS_NATIVE(node) \ - (IDL_NODE_UP(node) && \ - IDL_NODE_TYPE(IDL_NODE_UP(node)) == IDLN_NATIVE) +DECLINLINE(bool) xpidlNdIsStringType(PCXPIDLNODE pNd) +{ + return pNd->enmType == kXpidlNdType_BaseType + && ( pNd->u.enmBaseType == kXpidlType_String + || pNd->u.enmBaseType == kXpidlType_Wide_String); +} + + +/* is this node from an aggregate type (interface)? */ +#define UP_IS_AGGREGATE(a_pNd) \ + ( a_pNd->pNdTypeRef \ + && ( a_pNd->pNdTypeRef->enmType == kXpidlNdType_Interface_Forward_Decl \ + || a_pNd->pNdTypeRef->enmType == kXpidlNdType_Interface_Def)) + +#define UP_IS_NATIVE(a_pNd) \ + ( a_pNd->pNdTypeRef \ + && a_pNd->pNdTypeRef->enmType == kXpidlNdType_Native) /* is this type output in the form " *"? */ -#define STARRED_TYPE(node) (IDL_NODE_TYPE(node) == IDLN_TYPE_STRING || \ - IDL_NODE_TYPE(node) == IDLN_TYPE_WIDE_STRING || \ - (IDL_NODE_TYPE(node) == IDLN_IDENT && \ - UP_IS_AGGREGATE(node))) +#define STARRED_TYPE(a_pNd) (xpidlNdIsStringType(a_pNd) || \ + (a_pNd->enmType == kXpidlNdType_Identifier && \ + UP_IS_AGGREGATE(a_pNd))) + +#define DIPPER_TYPE(a_pNd) \ + (xpidlNodeAttrFind(a_pNd, "domstring") != NULL || \ + xpidlNodeAttrFind(a_pNd, "utf8string") != NULL || \ + xpidlNodeAttrFind(a_pNd, "cstring") != NULL || \ + xpidlNodeAttrFind(a_pNd, "astring") != NULL) -#define DIPPER_TYPE(node) \ - (NULL != IDL_tree_property_get(node, "domstring") || \ - NULL != IDL_tree_property_get(node, "utf8string") || \ - NULL != IDL_tree_property_get(node, "cstring") || \ - NULL != IDL_tree_property_get(node, "astring")) /* * Find the underlying type of an identifier typedef. Returns NULL * (and doesn't complain) on failure. */ -IDL_tree /* IDL_TYPE_DCL */ -find_underlying_type(IDL_tree typedef_ident); +DECLHIDDEN(PCXPIDLNODE) find_underlying_type(PCXPIDLNODE pNd); + +/* + * Verifies the interface declaration + */ +DECLHIDDEN(int) verify_interface_declaration(PCXPIDLNODE pNd, PRTERRINFO pErrInfo); /* * Check that const declarations match their stated sign and are of the * appropriate types. */ -gboolean -verify_const_declaration(IDL_tree const_tree); +DECLHIDDEN(int) verify_const_declaration(PCXPIDLNODE pNd, PRTERRINFO pErrInfo); /* * Check that scriptable attributes in scriptable interfaces actually are. */ -gboolean -verify_attribute_declaration(IDL_tree method_tree); +DECLHIDDEN(int) verify_attribute_declaration(PCXPIDLNODE pNd, PRTERRINFO pErrInfo); /* * Perform various validation checks on methods. */ -gboolean -verify_method_declaration(IDL_tree method_tree); - -/* - * Verifies the interface declaration - */ -gboolean -verify_interface_declaration(IDL_tree method_tree); +DECLHIDDEN(int) verify_method_declaration(PCXPIDLNODE pNd, PRTERRINFO pErrInfo); /* * Verify that a native declaration has an associated C++ expression, i.e. that * it's of the form native () */ -gboolean -check_native(TreeState *state); - -void -printlist(FILE *outfile, GSList *slist); +DECLHIDDEN(int) check_native(PCXPIDLNODE pNd, PRTERRINFO pErrInfo); #endif /* __xpidl_h */ diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_doc.c b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_doc.c deleted file mode 100644 index d560e407..00000000 --- a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_doc.c +++ /dev/null @@ -1,312 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Netscape Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "xpidl.h" - -/* - * Generates documentation from javadoc-style comments in XPIDL files. - */ - -static gboolean -doc_prolog(TreeState *state) -{ - fprintf(state->file, "\n"); - fprintf(state->file, "\n"); - - fprintf(state->file, - "\n", - state->basename); - fprintf(state->file, "documentation for %s.idl interfaces\n", - state->basename); - fprintf(state->file, "\n\n"); - fprintf(state->file, "\n"); - - return TRUE; -} - -static gboolean -doc_epilog(TreeState *state) -{ - fprintf(state->file, "\n"); - fprintf(state->file, "\n"); - - return TRUE; -} - - -static gboolean -doc_list(TreeState *state) -{ - IDL_tree iter; - for (iter = state->tree; iter; iter = IDL_LIST(iter).next) { - state->tree = IDL_LIST(iter).data; - if (!xpidl_process_node(state)) - return FALSE; - } - return TRUE; -} - -static gboolean -print_list(FILE *outfile, IDL_tree list) -{ - if (list == NULL) - return TRUE; - - fprintf(outfile, "
    \n"); - while (list != NULL) { - fprintf(outfile, "
  • %s\n", - IDL_IDENT(IDL_LIST(list).data).str); - list = IDL_LIST(list).next; - } - fprintf(outfile, "
\n"); - return TRUE; -} - -static gboolean -doc_interface(TreeState *state) -{ - IDL_tree iface = state->tree; - IDL_tree iter; - IDL_tree orig; - char *classname = IDL_IDENT(IDL_INTERFACE(iface).ident).str; - GSList *doc_comments = IDL_IDENT(IDL_INTERFACE(iface).ident).comments; - - fprintf(state->file, "interface %s
\n", classname); - - /* Much more could happen at this step. */ - /* - * If parsing doc comments, you might need to take some care with line - * endings, as the xpidl frontend will return comments containing of /r, - * /n, /r/n depending on the platform. It's best to leave out platform - * #defines and just treat them all as equivalent. - */ - if (doc_comments != NULL) { - fprintf(state->file, "doc comments:
\n"); - fprintf(state->file, "
\n");
-        printlist(state->file, doc_comments);
-        fprintf(state->file, "
\n"); - fprintf(state->file, "
\n"); - } - - /* inherits from */ - /* - * Note that we accept multiple inheritance here (for e.g. gnome idl) - * even though the header backend (specific to mozilla idl) rejects it. - */ - if ((iter = IDL_INTERFACE(iface).inheritance_spec)) { - fprintf(state->file, "%s inherits from:
\n", classname); - print_list(state->file, iter); - fprintf(state->file, "
\n"); - } - - /* - * Call xpidl_process_node to recur through list of declarations in - * interface body; another option would be to explicitly iterate through - * the list. xpidl_process_node currently requires twiddling the state to - * get the right node; I'll fix that soon to just take the node. Makes it - * easier to follow what's going on, I think... - */ - orig = state->tree; - state->tree = IDL_INTERFACE(iface).body; - if (state->tree && !xpidl_process_node(state)) - return FALSE; - state->tree = orig; - - return TRUE; -} - -/* - * Copied from xpidl_header.c. You'll probably want to change it; if you can - * use it verbatim or abstract it, we could move it to xpidl_util.c and share - * it from there. - */ -static gboolean -write_type(IDL_tree type_tree, FILE *outfile) -{ - if (!type_tree) { - fputs("void", outfile); - return TRUE; - } - - switch (IDL_NODE_TYPE(type_tree)) { - case IDLN_TYPE_INTEGER: { - gboolean sign = IDL_TYPE_INTEGER(type_tree).f_signed; - switch (IDL_TYPE_INTEGER(type_tree).f_type) { - case IDL_INTEGER_TYPE_SHORT: - fputs(sign ? "PRInt16" : "PRUint16", outfile); - break; - case IDL_INTEGER_TYPE_LONG: - fputs(sign ? "PRInt32" : "PRUint32", outfile); - break; - case IDL_INTEGER_TYPE_LONGLONG: - fputs(sign ? "PRInt64" : "PRUint64", outfile); - break; - default: - g_error("Unknown integer type %d\n", - IDL_TYPE_INTEGER(type_tree).f_type); - return FALSE; - } - break; - } - case IDLN_TYPE_CHAR: - fputs("char", outfile); - break; - case IDLN_TYPE_WIDE_CHAR: - fputs("PRUnichar", outfile); /* wchar_t? */ - break; - case IDLN_TYPE_WIDE_STRING: - fputs("PRUnichar *", outfile); - break; - case IDLN_TYPE_STRING: - fputs("char *", outfile); - break; - case IDLN_TYPE_BOOLEAN: - fputs("PRBool", outfile); - break; - case IDLN_TYPE_OCTET: - fputs("PRUint8", outfile); - break; - case IDLN_TYPE_FLOAT: - switch (IDL_TYPE_FLOAT(type_tree).f_type) { - case IDL_FLOAT_TYPE_FLOAT: - fputs("float", outfile); - break; - case IDL_FLOAT_TYPE_DOUBLE: - fputs("double", outfile); - break; - /* XXX 'long double' just ignored, or what? */ - default: - fprintf(outfile, "unknown_type_%d", IDL_NODE_TYPE(type_tree)); - break; - } - break; - case IDLN_IDENT: - if (UP_IS_NATIVE(type_tree)) { - fputs(IDL_NATIVE(IDL_NODE_UP(type_tree)).user_type, outfile); - if (IDL_tree_property_get(type_tree, "ptr")) { - fputs(" *", outfile); - } else if (IDL_tree_property_get(type_tree, "ref")) { - fputs(" &", outfile); - } - } else { - fputs(IDL_IDENT(type_tree).str, outfile); - } - if (UP_IS_AGGREGATE(type_tree)) - fputs(" *", outfile); - break; - default: - fprintf(outfile, "unknown_type_%d", IDL_NODE_TYPE(type_tree)); - break; - } - return TRUE; -} - -/* handle ATTR_DCL (attribute declaration) nodes */ -static gboolean -doc_attribute_declaration(TreeState *state) -{ - IDL_tree attr = state->tree; - - if (!verify_attribute_declaration(attr)) - return FALSE; - /* - * Attribute idents can also take doc comments. They're ignored here; - * should they be? - */ - - if (IDL_ATTR_DCL(attr).f_readonly) - fprintf(state->file, "readonly "); - - fprintf(state->file, "attribute "); - - if (!write_type(IDL_ATTR_DCL(attr).param_type_spec, state->file)) - return FALSE; - - fprintf(state->file, "\n"); - print_list(state->file, IDL_ATTR_DCL(attr).simple_declarations); - fprintf(state->file, "
\n"); - - return TRUE; -} - -/* handle OP_DCL (method declaration) nodes */ -static gboolean -doc_method_declaration(TreeState *state) -{ - /* - * Doc comment for attributes also applies here. - */ - - /* - * Look at 'write_method_signature' in xpidl_header.c for an example of how - * to navigate parse trees for methods. For here, I just print the method - * name. - */ - - fprintf(state->file, - "method %s
\n", - IDL_IDENT(IDL_OP_DCL(state->tree).ident).str); - - return TRUE; -} - -backend * -xpidl_doc_dispatch(void) -{ - static backend result; - static nodeHandler table[IDLN_LAST]; - static gboolean initialized = FALSE; - - result.emit_prolog = doc_prolog; - result.emit_epilog = doc_epilog; - - if (!initialized) { - /* Initialize non-NULL elements */ - - /* I just handle a few... many still to be filled in! */ - - table[IDLN_LIST] = doc_list; - table[IDLN_INTERFACE] = doc_interface; - table[IDLN_ATTR_DCL] = doc_attribute_declaration; - table[IDLN_OP_DCL] = doc_method_declaration; - - initialized = TRUE; - } - - result.dispatch_table = table; - return &result; -} diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_header.c b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_header.c index 952ed0dc..474ca4a1 100644 --- a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_header.c +++ b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_header.c @@ -38,90 +38,17 @@ /* * Generate XPCOM headers from XPIDL. */ +#include +#include #include "xpidl.h" #include -#define AS_DECL 0 -#define AS_CALL 1 -#define AS_IMPL 2 - -static gboolean write_method_signature(IDL_tree method_tree, FILE *outfile, - int mode, const char *className); -static gboolean write_attr_accessor(IDL_tree attr_tree, FILE * outfile, - gboolean getter, - int mode, const char *className); - -static void -write_indent(FILE *outfile) { +static void write_indent(FILE *outfile) +{ fputs(" ", outfile); } -static gboolean -header_prolog(TreeState *state) -{ - char *define = xpidl_basename(state->basename); - fprintf(state->file, "/*\n * DO NOT EDIT. THIS FILE IS GENERATED FROM" - " %s.idl\n */\n", state->basename); - fprintf(state->file, - "\n#ifndef __gen_%s_h__\n" - "#define __gen_%s_h__\n", - define, define); - g_free(define); - if (state->base_includes != NULL) { - guint len = g_slist_length(state->base_includes); - guint i; - - fputc('\n', state->file); - for (i = 0; i < len; i++) { - char *ident, *dot; - - ident = (char *)g_slist_nth_data(state->base_includes, i); - - /* suppress any trailing .extension */ - - /* XXX use g_basename instead ? ? */ - - dot = strrchr(ident, '.'); - if (dot != NULL) - *dot = '\0'; - - - /* begin include guard */ - fprintf(state->file, - "\n#ifndef __gen_%s_h__\n", - ident); - - fprintf(state->file, "#include \"%s.h\"\n", - (char *)g_slist_nth_data(state->base_includes, i)); - - fprintf(state->file, "#endif\n"); - - } - if (i > 0) - fputc('\n', state->file); - } - /* - * Support IDL files that don't include a root IDL file that defines - * NS_NO_VTABLE. - */ - fprintf(state->file, - "/* For IDL files that don't want to include root IDL files. */\n" - "#ifndef NS_NO_VTABLE\n" - "#define NS_NO_VTABLE\n" - "#endif\n"); - - return TRUE; -} - -static gboolean -header_epilog(TreeState *state) -{ - char *define = xpidl_basename(state->basename); - fprintf(state->file, "\n#endif /* __gen_%s_h__ */\n", define); - g_free(define); - return TRUE; -} static void write_classname_iid_define(FILE *file, const char *className) @@ -139,780 +66,160 @@ write_classname_iid_define(FILE *file, const char *className) fputs("_IID", file); } -static gboolean -interface(TreeState *state) + +static int xpidlHdrWriteIdlType(PCXPIDLNODE pNd, FILE *pFile) { - IDL_tree iface = state->tree, iter, orig; - char *className = IDL_IDENT(IDL_INTERFACE(iface).ident).str; - char *classNameUpper = NULL; - char *classNameImpl = NULL; - char *cp; - gboolean ok = TRUE; - gboolean keepvtable; - const char *iid; - const char *name_space; - struct nsID id; - char iid_parsed[UUID_LENGTH]; - GSList *doc_comments = IDL_IDENT(IDL_INTERFACE(iface).ident).comments; - - if (!verify_interface_declaration(iface)) - return FALSE; - -#define FAIL do {ok = FALSE; goto out;} while(0) - - fprintf(state->file, "\n/* starting interface: %s */\n", - className); - - name_space = IDL_tree_property_get(IDL_INTERFACE(iface).ident, "namespace"); - if (name_space) { - fprintf(state->file, "/* namespace: %s */\n", - name_space); - fprintf(state->file, "/* fully qualified name: %s.%s */\n", - name_space,className); - } - - iid = IDL_tree_property_get(IDL_INTERFACE(iface).ident, "uuid"); - if (iid) { - /* Redundant, but a better error than 'cannot parse.' */ - if (strlen(iid) != 36) { - IDL_tree_error(state->tree, "IID %s is the wrong length\n", iid); - FAIL; - } - - /* - * Parse uuid and then output resulting nsID to string, to validate - * uuid and normalize resulting .h files. - */ - if (!xpidl_parse_iid(&id, iid)) { - IDL_tree_error(state->tree, "cannot parse IID %s\n", iid); - FAIL; - } - if (!xpidl_sprint_iid(&id, iid_parsed)) { - IDL_tree_error(state->tree, "error formatting IID %s\n", iid); - FAIL; - } - - /* #define NS_ISUPPORTS_IID_STR "00000000-0000-0000-c000-000000000046" */ - fputs("#define ", state->file); - write_classname_iid_define(state->file, className); - fprintf(state->file, "_STR \"%s\"\n", iid_parsed); - fputc('\n', state->file); - - /* #define NS_ISUPPORTS_IID { {0x00000000 .... 0x46 }} */ - fprintf(state->file, "#define "); - write_classname_iid_define(state->file, className); - fprintf(state->file, " \\\n" - " {0x%.8x, 0x%.4x, 0x%.4x, \\\n" - " { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, " - "0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }}\n", - id.m0, id.m1, id.m2, - id.m3[0], id.m3[1], id.m3[2], id.m3[3], - id.m3[4], id.m3[5], id.m3[6], id.m3[7]); - fputc('\n', state->file); - } else { - IDL_tree_error(state->tree, "interface %s lacks a uuid attribute\n", - className); - FAIL; - } - - if (doc_comments != NULL) - printlist(state->file, doc_comments); - - /* - * NS_NO_VTABLE is defined in nsISupportsUtils.h, and defined on windows - * to __declspec(novtable) on windows. This optimization is safe - * whenever the constructor calls no virtual methods. Writing in IDL - * almost guarantees this, except for the case when a %{C++ block occurs in - * the interface. We detect that case, and emit a macro call that disables - * the optimization. - */ - keepvtable = FALSE; - for (iter = IDL_INTERFACE(state->tree).body; - iter != NULL; - iter = IDL_LIST(iter).next) + if (pNd->enmType == kXpidlNdType_BaseType) { - IDL_tree data = IDL_LIST(iter).data; - if (IDL_NODE_TYPE(data) == IDLN_CODEFRAG) - keepvtable = TRUE; - } - - /* The interface declaration itself. */ - fprintf(state->file, - "class %s%s", - (keepvtable ? "" : "NS_NO_VTABLE "), className); - - if ((iter = IDL_INTERFACE(iface).inheritance_spec)) { - fputs(" : ", state->file); - if (IDL_LIST(iter).next != NULL) { - IDL_tree_error(iter, - "multiple inheritance is not supported by xpidl"); - FAIL; - } - fprintf(state->file, "public %s", IDL_IDENT(IDL_LIST(iter).data).str); - } - fputs(" {\n" - " public: \n\n", state->file); - - fputs(" NS_DEFINE_STATIC_IID_ACCESSOR(", state->file); - write_classname_iid_define(state->file, className); - fputs(")\n\n", state->file); - - orig = state->tree; /* It would be nice to remove this state-twiddling. */ - - state->tree = IDL_INTERFACE(iface).body; - - if (state->tree && !xpidl_process_node(state)) - FAIL; - - fputs("};\n", state->file); - fputc('\n', state->file); - - /* - * #define NS_DECL_NSIFOO - create method prototypes that can be used in - * class definitions that support this interface. - * - * Walk the tree explicitly to prototype a reworking of xpidl to get rid of - * the callback mechanism. - */ - state->tree = orig; - fputs("/* Use this macro when declaring classes that implement this " - "interface. */\n", state->file); - fputs("#define NS_DECL_", state->file); - classNameUpper = xpidl_strdup(className); - if (!classNameUpper) - FAIL; - - for (cp = classNameUpper; *cp != '\0'; cp++) - *cp = toupper(*cp); - fprintf(state->file, "%s \\\n", classNameUpper); - if (IDL_INTERFACE(state->tree).body == NULL) { - write_indent(state->file); - fputs("/* no methods! */\n", state->file); - } - - for (iter = IDL_INTERFACE(state->tree).body; - iter != NULL; - iter = IDL_LIST(iter).next) - { - IDL_tree data = IDL_LIST(iter).data; - - switch(IDL_NODE_TYPE(data)) { - case IDLN_OP_DCL: - write_indent(state->file); - write_method_signature(data, state->file, AS_DECL, NULL); - break; - - case IDLN_ATTR_DCL: - write_indent(state->file); - if (!write_attr_accessor(data, state->file, TRUE, AS_DECL, NULL)) - FAIL; - if (!IDL_ATTR_DCL(data).f_readonly) { - fputs(" NS_OVERRIDE; \\\n", state->file); /* Terminate the previous one. */ - write_indent(state->file); - if (!write_attr_accessor(data, state->file, - FALSE, AS_DECL, NULL)) - FAIL; - /* '; \n' at end will clean up. */ - } - break; - - case IDLN_CONST_DCL: - /* ignore it here; it doesn't contribute to the macro. */ - continue; - - case IDLN_CODEFRAG: - XPIDL_WARNING((iter, IDL_WARNING1, - "%%{ .. %%} code fragment within interface " - "ignored when generating NS_DECL_%s macro; " - "if the code fragment contains method " - "declarations, the macro probably isn't " - "complete.", classNameUpper)); - continue; - - default: - IDL_tree_error(iter, - "unexpected node type %d! " - "Please file a bug against the xpidl component.", - IDL_NODE_TYPE(data)); - FAIL; - } - - if (IDL_LIST(iter).next != NULL) { - fprintf(state->file, " NS_OVERRIDE; \\\n"); - } else { - fprintf(state->file, " NS_OVERRIDE; \n"); - } - } - fputc('\n', state->file); - - /* XXX abstract above and below into one function? */ - /* - * #define NS_FORWARD_NSIFOO - create forwarding methods that can delegate - * behavior from in implementation to another object. As generated by - * idlc. - */ - fprintf(state->file, - "/* Use this macro to declare functions that forward the " - "behavior of this interface to another object. */\n" - "#define NS_FORWARD_%s(_to) \\\n", - classNameUpper); - if (IDL_INTERFACE(state->tree).body == NULL) { - write_indent(state->file); - fputs("/* no methods! */\n", state->file); - } - - for (iter = IDL_INTERFACE(state->tree).body; - iter != NULL; - iter = IDL_LIST(iter).next) - { - IDL_tree data = IDL_LIST(iter).data; - - switch(IDL_NODE_TYPE(data)) { - case IDLN_OP_DCL: - write_indent(state->file); - write_method_signature(data, state->file, AS_DECL, NULL); - fputs(" { return _to ", state->file); - write_method_signature(data, state->file, AS_CALL, NULL); - break; - - case IDLN_ATTR_DCL: - write_indent(state->file); - if (!write_attr_accessor(data, state->file, TRUE, AS_DECL, NULL)) - FAIL; - fputs(" { return _to ", state->file); - if (!write_attr_accessor(data, state->file, TRUE, AS_CALL, NULL)) - FAIL; - if (!IDL_ATTR_DCL(data).f_readonly) { - fputs("; } \\\n", state->file); /* Terminate the previous one. */ - write_indent(state->file); - if (!write_attr_accessor(data, state->file, - FALSE, AS_DECL, NULL)) - FAIL; - fputs(" { return _to ", state->file); - if (!write_attr_accessor(data, state->file, - FALSE, AS_CALL, NULL)) - FAIL; - /* '; } \n' at end will clean up. */ - } - break; - - case IDLN_CONST_DCL: - case IDLN_CODEFRAG: - continue; - - default: - FAIL; - } - - if (IDL_LIST(iter).next != NULL) { - fprintf(state->file, "; } \\\n"); - } else { - fprintf(state->file, "; } \n"); - } - } - fputc('\n', state->file); - - - /* XXX abstract above and below into one function? */ - /* - * #define NS_FORWARD_SAFE_NSIFOO - create forwarding methods that can delegate - * behavior from in implementation to another object. As generated by - * idlc. - */ - fprintf(state->file, - "/* Use this macro to declare functions that forward the " - "behavior of this interface to another object in a safe way. */\n" - "#define NS_FORWARD_SAFE_%s(_to) \\\n", - classNameUpper); - if (IDL_INTERFACE(state->tree).body == NULL) { - write_indent(state->file); - fputs("/* no methods! */\n", state->file); - } - - for (iter = IDL_INTERFACE(state->tree).body; - iter != NULL; - iter = IDL_LIST(iter).next) - { - IDL_tree data = IDL_LIST(iter).data; - - switch(IDL_NODE_TYPE(data)) { - case IDLN_OP_DCL: - write_indent(state->file); - write_method_signature(data, state->file, AS_DECL, NULL); - fputs(" { return !_to ? NS_ERROR_NULL_POINTER : _to->", state->file); - write_method_signature(data, state->file, AS_CALL, NULL); - break; - - case IDLN_ATTR_DCL: - write_indent(state->file); - if (!write_attr_accessor(data, state->file, TRUE, AS_DECL, NULL)) - FAIL; - fputs(" { return !_to ? NS_ERROR_NULL_POINTER : _to->", state->file); - if (!write_attr_accessor(data, state->file, TRUE, AS_CALL, NULL)) - FAIL; - if (!IDL_ATTR_DCL(data).f_readonly) { - fputs("; } \\\n", state->file); /* Terminate the previous one. */ - write_indent(state->file); - if (!write_attr_accessor(data, state->file, - FALSE, AS_DECL, NULL)) - FAIL; - fputs(" { return !_to ? NS_ERROR_NULL_POINTER : _to->", state->file); - if (!write_attr_accessor(data, state->file, - FALSE, AS_CALL, NULL)) - FAIL; - /* '; } \n' at end will clean up. */ - } - break; - - case IDLN_CONST_DCL: - case IDLN_CODEFRAG: - continue; - - default: - FAIL; - } - - if (IDL_LIST(iter).next != NULL) { - fprintf(state->file, "; } \\\n"); - } else { - fprintf(state->file, "; } \n"); - } - } - fputc('\n', state->file); - - /* - * Build a sample implementation template. - */ - if (strlen(className) >= 3 && className[2] == 'I') { - classNameImpl = xpidl_strdup(className); - if (!classNameImpl) - FAIL; - memmove(&classNameImpl[2], &classNameImpl[3], strlen(classNameImpl) - 2); - } else { - classNameImpl = xpidl_strdup("_MYCLASS_"); - if (!classNameImpl) - FAIL; - } - - fputs("#if 0\n" - "/* Use the code below as a template for the " - "implementation class for this interface. */\n" - "\n" - "/* Header file */" - "\n", - state->file); - fprintf(state->file, "class %s : public %s\n", classNameImpl, className); - fputs("{\n" - "public:\n", state->file); - write_indent(state->file); - fputs("NS_DECL_ISUPPORTS\n", state->file); - write_indent(state->file); - fprintf(state->file, "NS_DECL_%s\n", classNameUpper); - fputs("\n", state->file); - write_indent(state->file); - fprintf(state->file, "%s();\n", classNameImpl); - fputs("\n" - "private:\n", state->file); - write_indent(state->file); - fprintf(state->file, "~%s();\n", classNameImpl); - fputs("\n" - "protected:\n", state->file); - write_indent(state->file); - fputs("/* additional members */\n", state->file); - fputs("};\n\n", state->file); - - fputs("/* Implementation file */\n", state->file); - - fprintf(state->file, - "NS_IMPL_ISUPPORTS1(%s, %s)\n", classNameImpl, className); - fputs("\n", state->file); - - fprintf(state->file, "%s::%s()\n", classNameImpl, classNameImpl); - fputs("{\n", state->file); - write_indent(state->file); - fputs("/* member initializers and constructor code */\n", state->file); - fputs("}\n\n", state->file); - - fprintf(state->file, "%s::~%s()\n", classNameImpl, classNameImpl); - fputs("{\n", state->file); - write_indent(state->file); - fputs("/* destructor code */\n", state->file); - fputs("}\n\n", state->file); - - for (iter = IDL_INTERFACE(state->tree).body; - iter != NULL; - iter = IDL_LIST(iter).next) - { - IDL_tree data = IDL_LIST(iter).data; - - switch(IDL_NODE_TYPE(data)) { - case IDLN_OP_DCL: - /* It would be nice to remove this state-twiddling. */ - orig = state->tree; - state->tree = data; - xpidl_write_comment(state, 0); - state->tree = orig; - - write_method_signature(data, state->file, AS_IMPL, classNameImpl); - fputs("\n{\n", state->file); - write_indent(state->file); - write_indent(state->file); - fputs("return NS_ERROR_NOT_IMPLEMENTED;\n" - "}\n" - "\n", state->file); - break; - - case IDLN_ATTR_DCL: - /* It would be nice to remove this state-twiddling. */ - orig = state->tree; - state->tree = data; - xpidl_write_comment(state, 0); - state->tree = orig; - - if (!write_attr_accessor(data, state->file, TRUE, - AS_IMPL, classNameImpl)) - FAIL; - fputs("\n{\n", state->file); - write_indent(state->file); - write_indent(state->file); - fputs("return NS_ERROR_NOT_IMPLEMENTED;\n" - "}\n", state->file); - - if (!IDL_ATTR_DCL(data).f_readonly) { - if (!write_attr_accessor(data, state->file, FALSE, - AS_IMPL, classNameImpl)) - FAIL; - fputs("\n{\n", state->file); - write_indent(state->file); - write_indent(state->file); - fputs("return NS_ERROR_NOT_IMPLEMENTED;\n" - "}\n", state->file); - } - fputs("\n", state->file); - break; - - case IDLN_CONST_DCL: - case IDLN_CODEFRAG: - continue; - - default: - FAIL; - } - } - - fputs("/* End of implementation class template. */\n" - "#endif\n" - "\n", state->file); - -#undef FAIL - -out: - if (classNameUpper) - free(classNameUpper); - if (classNameImpl) - free(classNameImpl); - return ok; -} - -static gboolean -list(TreeState *state) -{ - IDL_tree iter; - for (iter = state->tree; iter; iter = IDL_LIST(iter).next) { - state->tree = IDL_LIST(iter).data; - if (!xpidl_process_node(state)) - return FALSE; - } - return TRUE; -} - -static gboolean -write_type(IDL_tree type_tree, gboolean is_out, FILE *outfile) -{ - if (!type_tree) { - fputs("void", outfile); - return TRUE; - } - - switch (IDL_NODE_TYPE(type_tree)) { - case IDLN_TYPE_INTEGER: { - gboolean sign = IDL_TYPE_INTEGER(type_tree).f_signed; - switch (IDL_TYPE_INTEGER(type_tree).f_type) { - case IDL_INTEGER_TYPE_SHORT: - fputs(sign ? "PRInt16" : "PRUint16", outfile); - break; - case IDL_INTEGER_TYPE_LONG: - fputs(sign ? "PRInt32" : "PRUint32", outfile); - break; - case IDL_INTEGER_TYPE_LONGLONG: - fputs(sign ? "PRInt64" : "PRUint64", outfile); - break; - default: - g_error("Unknown integer type %d\n", - IDL_TYPE_INTEGER(type_tree).f_type); - return FALSE; - } - break; - } - case IDLN_TYPE_CHAR: - fputs("char", outfile); - break; - case IDLN_TYPE_WIDE_CHAR: - fputs("PRUnichar", outfile); /* wchar_t? */ - break; - case IDLN_TYPE_WIDE_STRING: - fputs("PRUnichar *", outfile); - break; - case IDLN_TYPE_STRING: - fputs("char *", outfile); - break; - case IDLN_TYPE_BOOLEAN: - fputs("PRBool", outfile); - break; - case IDLN_TYPE_OCTET: - fputs("PRUint8", outfile); - break; - case IDLN_TYPE_FLOAT: - switch (IDL_TYPE_FLOAT(type_tree).f_type) { - case IDL_FLOAT_TYPE_FLOAT: - fputs("float", outfile); - break; - case IDL_FLOAT_TYPE_DOUBLE: - fputs("double", outfile); - break; - /* XXX 'long double' just ignored, or what? */ - default: - fprintf(outfile, "unknown_type_%d", IDL_NODE_TYPE(type_tree)); - break; - } - break; - case IDLN_IDENT: - if (UP_IS_NATIVE(type_tree)) { - if (IDL_tree_property_get(type_tree, "domstring") || - IDL_tree_property_get(type_tree, "astring")) { - fputs("nsAString", outfile); - } else if (IDL_tree_property_get(type_tree, "utf8string")) { - fputs("nsACString", outfile); - } else if (IDL_tree_property_get(type_tree, "cstring")) { - fputs("nsACString", outfile); - } else { - fputs(IDL_NATIVE(IDL_NODE_UP(type_tree)).user_type, outfile); - } - if (IDL_tree_property_get(type_tree, "ptr")) { - fputs(" *", outfile); - } else if (IDL_tree_property_get(type_tree, "ref")) { - fputs(" &", outfile); - } - } else { - fputs(IDL_IDENT(type_tree).str, outfile); - } - if (UP_IS_AGGREGATE(type_tree)) - fputs(" *", outfile); - break; - default: - fprintf(outfile, "unknown_type_%d", IDL_NODE_TYPE(type_tree)); - break; - } - return TRUE; -} - -/* - * An attribute declaration looks like: - * - * [ IDL_ATTR_DCL] - * - param_type_spec [IDL_TYPE_* or NULL for void] - * - simple_declarations [IDL_LIST] - * - data [IDL_IDENT] - * - next [IDL_LIST or NULL if no more idents] - * - data [IDL_IDENT] - */ - -#define ATTR_IDENT(tree) (IDL_IDENT(IDL_LIST(IDL_ATTR_DCL(tree).simple_declarations).data)) -#define ATTR_TYPE_DECL(tree) (IDL_ATTR_DCL(tree).param_type_spec) -#define ATTR_TYPE(tree) (IDL_NODE_TYPE(ATTR_TYPE_DECL(tree))) - -/* - * AS_DECL writes 'NS_IMETHOD foo(string bar, long sil)' - * AS_IMPL writes 'NS_IMETHODIMP className::foo(string bar, long sil)' - * AS_CALL writes 'foo(bar, sil)' - */ -static gboolean -write_attr_accessor(IDL_tree attr_tree, FILE * outfile, - gboolean getter, int mode, const char *className) -{ - char *attrname = ATTR_IDENT(attr_tree).str; - - if (mode == AS_DECL) { - fputs("NS_IMETHOD ", outfile); - } else if (mode == AS_IMPL) { - fprintf(outfile, "NS_IMETHODIMP %s::", className); - } - fprintf(outfile, "%cet%c%s(", - getter ? 'G' : 'S', - toupper(*attrname), attrname + 1); - if (mode == AS_DECL || mode == AS_IMPL) { - /* Setters for string, wstring, nsid, domstring, utf8string, - * cstring and astring get const. - */ - if (!getter && - (IDL_NODE_TYPE(ATTR_TYPE_DECL(attr_tree)) == IDLN_TYPE_STRING || - IDL_NODE_TYPE(ATTR_TYPE_DECL(attr_tree)) == IDLN_TYPE_WIDE_STRING || - IDL_tree_property_get(ATTR_TYPE_DECL(attr_tree), "nsid") || - IDL_tree_property_get(ATTR_TYPE_DECL(attr_tree), "domstring") || - IDL_tree_property_get(ATTR_TYPE_DECL(attr_tree), "utf8string") || - IDL_tree_property_get(ATTR_TYPE_DECL(attr_tree), "cstring") || - IDL_tree_property_get(ATTR_TYPE_DECL(attr_tree), "astring"))) + switch (pNd->u.enmBaseType) { - fputs("const ", outfile); + case kXpidlType_Void: + fputs("void", pFile); + break; + case kXpidlType_Boolean: + fputs("boolean", pFile); + break; + case kXpidlType_Octet: + fputs("octet", pFile); + break; + case kXpidlType_Char: + fputs("char", pFile); + break; + case kXpidlType_Wide_Char: + fputs("wchar", pFile); /* wchar_t? */ + break; + case kXpidlType_Short: + fputs("short", pFile); + break; + case kXpidlType_Long: + fputs("long", pFile); + break; + case kXpidlType_Long_Long: + fputs("long long", pFile); + break; + case kXpidlType_Unsigned_Short: + fputs("unsigned short", pFile); + break; + case kXpidlType_Unsigned_Long: + fputs("unsigned long", pFile); + break; + case kXpidlType_Unsigned_Long_Long: + fputs("unsigned long long", pFile); + break; + case kXpidlType_String: + fputs("string", pFile); + break; + case kXpidlType_Wide_String: + fputs("wstring", pFile); + break; + case kXpidlType_Double: + fputs("double", pFile); + break; + case kXpidlType_Float: + fputs("float", pFile); + break; + default: + AssertReleaseFailed(); } - - if (!write_type(ATTR_TYPE_DECL(attr_tree), getter, outfile)) - return FALSE; - fprintf(outfile, "%s%s", - (STARRED_TYPE(attr_tree) ? "" : " "), - (getter && !DIPPER_TYPE(ATTR_TYPE_DECL(attr_tree)))? "*" : ""); } - fprintf(outfile, "a%c%s)", toupper(attrname[0]), attrname + 1); - return TRUE; + else + { + Assert(pNd->enmType == kXpidlNdType_Identifier); + fputs(pNd->u.pszIde, pFile); + } + + return VINF_SUCCESS; } -static gboolean -attr_dcl(TreeState *state) +static int xpidlHdrWriteType(PCXPIDLNODE pNd, FILE *outfile) { - GSList *doc_comments; - - if (!verify_attribute_declaration(state->tree)) - return FALSE; - - doc_comments = - IDL_IDENT(IDL_LIST(IDL_ATTR_DCL - (state->tree).simple_declarations).data).comments; - - if (doc_comments != NULL) { - write_indent(state->file); - printlist(state->file, doc_comments); - } - - /* - * XXX lists of attributes with the same type, e.g. - * attribute string foo, bar sil; - * are legal IDL... but we don't do anything with 'em. - */ - if (IDL_LIST(IDL_ATTR_DCL(state->tree).simple_declarations).next != NULL) { - XPIDL_WARNING((state->tree, IDL_WARNING1, - "multiple attributes in a single declaration aren't " - "currently supported by xpidl")); - } - - xpidl_write_comment(state, 2); - - write_indent(state->file); - if (!write_attr_accessor(state->tree, state->file, TRUE, AS_DECL, NULL)) - return FALSE; - fputs(" = 0;\n", state->file); - - if (!IDL_ATTR_DCL(state->tree).f_readonly) { - write_indent(state->file); - if (!write_attr_accessor(state->tree, state->file, FALSE, AS_DECL, NULL)) - return FALSE; - fputs(" = 0;\n", state->file); - } - fputc('\n', state->file); - - return TRUE; -} - -static gboolean -do_enum(TreeState *state) -{ - IDL_tree_error(state->tree, "enums not supported, " - "see http://bugzilla.mozilla.org/show_bug.cgi?id=8781"); - return FALSE; -} - -static gboolean -do_const_dcl(TreeState *state) -{ - struct _IDL_CONST_DCL *dcl = &IDL_CONST_DCL(state->tree); - const char *name = IDL_IDENT(dcl->ident).str; - gboolean is_signed; - GSList *doc_comments = IDL_IDENT(dcl->ident).comments; - IDL_tree real_type; - const char *const_format; - - if (!verify_const_declaration(state->tree)) - return FALSE; - - if (doc_comments != NULL) { - write_indent(state->file); - printlist(state->file, doc_comments); - } - - /* Could be a typedef; try to map it to the real type. */ - real_type = find_underlying_type(dcl->const_type); - real_type = real_type ? real_type : dcl->const_type; - is_signed = IDL_TYPE_INTEGER(real_type).f_signed; - - const_format = is_signed ? "%" IDL_LL "d" : "%" IDL_LL "uU"; - write_indent(state->file); - fprintf(state->file, "enum { %s = ", name); - fprintf(state->file, const_format, IDL_INTEGER(dcl->const_exp).value); - fprintf(state->file, " };\n\n"); - - return TRUE; -} - -static gboolean -do_typedef(TreeState *state) -{ - IDL_tree type = IDL_TYPE_DCL(state->tree).type_spec; - IDL_tree dcls = IDL_TYPE_DCL(state->tree).dcls; - IDL_tree complex; - GSList *doc_comments; - - if (IDL_NODE_TYPE(type) == IDLN_TYPE_SEQUENCE) { - XPIDL_WARNING((state->tree, IDL_WARNING1, - "sequences not supported, ignored")); - } else { - if (IDL_NODE_TYPE(complex = IDL_LIST(dcls).data) == IDLN_TYPE_ARRAY) { - IDL_tree dim = IDL_TYPE_ARRAY(complex).size_list; - doc_comments = IDL_IDENT(IDL_TYPE_ARRAY(complex).ident).comments; - - if (doc_comments != NULL) - printlist(state->file, doc_comments); - - fputs("typedef ", state->file); - if (!write_type(type, FALSE, state->file)) - return FALSE; - fputs(" ", state->file); - - fprintf(state->file, "%s", - IDL_IDENT(IDL_TYPE_ARRAY(complex).ident).str); - do { - fputc('[', state->file); - if (IDL_LIST(dim).data) { - fprintf(state->file, "%ld", - (long)IDL_INTEGER(IDL_LIST(dim).data).value); - } - fputc(']', state->file); - } while ((dim = IDL_LIST(dim).next) != NULL); - } else { - doc_comments = IDL_IDENT(IDL_LIST(dcls).data).comments; - - if (doc_comments != NULL) - printlist(state->file, doc_comments); - - fputs("typedef ", state->file); - if (!write_type(type, FALSE, state->file)) - return FALSE; - fputs(" ", state->file); - fputs(IDL_IDENT(IDL_LIST(dcls).data).str, state->file); + if (pNd->enmType == kXpidlNdType_BaseType) + { + switch (pNd->u.enmBaseType) + { + case kXpidlType_Void: + fputs("void", outfile); + break; + case kXpidlType_Boolean: + fputs("PRBool", outfile); + break; + case kXpidlType_Octet: + fputs("PRUint8", outfile); + break; + case kXpidlType_Char: + fputs("char", outfile); + break; + case kXpidlType_Wide_Char: + fputs("PRUnichar", outfile); /* wchar_t? */ + break; + case kXpidlType_Short: + fputs("PRInt16", outfile); + break; + case kXpidlType_Long: + fputs("PRInt32", outfile); + break; + case kXpidlType_Long_Long: + fputs("PRInt64", outfile); + break; + case kXpidlType_Unsigned_Short: + fputs("PRUint16", outfile); + break; + case kXpidlType_Unsigned_Long: + fputs("PRUint32", outfile); + break; + case kXpidlType_Unsigned_Long_Long: + fputs("PRUint64", outfile); + break; + case kXpidlType_String: + fputs("char *", outfile); + break; + case kXpidlType_Wide_String: + fputs("PRUnichar *", outfile); + break; + case kXpidlType_Double: + fputs("double", outfile); + break; + case kXpidlType_Float: + fputs("float", outfile); + break; + default: + AssertReleaseFailed(); } - fputs(";\n\n", state->file); } - return TRUE; + else + { + Assert( pNd->enmType == kXpidlNdType_Identifier + && pNd->pNdTypeRef); + + PCXPIDLNODE pNdType = pNd->pNdTypeRef; + if (pNdType->enmType == kXpidlNdType_Native) + { + if ( xpidlNodeAttrFind(pNdType, "domstring") + || xpidlNodeAttrFind(pNdType, "astring")) + fputs("nsAString", outfile); + else if (xpidlNodeAttrFind(pNdType, "utf8string")) + fputs("nsACString", outfile); + else if (xpidlNodeAttrFind(pNdType, "cstring")) + fputs("nsACString", outfile); + else + fputs(pNdType->u.Native.pszNative, outfile); + + if (xpidlNodeAttrFind(pNdType, "ptr")) + fputs(" *", outfile); + else if (xpidlNodeAttrFind(pNdType, "ref")) + fputs(" &", outfile); + } + else + fputs(pNd->u.pszIde, outfile); + + if (UP_IS_AGGREGATE(pNd)) + fputs(" *", outfile); + } + + return VINF_SUCCESS; } + /* * param generation: * in string foo --> nsString *foo @@ -921,266 +228,744 @@ do_typedef(TreeState *state) */ /* If notype is true, just write the param name. */ -static gboolean -write_param(IDL_tree param_tree, FILE *outfile) +static int write_param(PCXPIDLNODE pNd, FILE *pFile) { - IDL_tree param_type_spec = IDL_PARAM_DCL(param_tree).param_type_spec; - gboolean is_in = IDL_PARAM_DCL(param_tree).attr == IDL_PARAM_IN; + PCXPIDLNODE pNdTypeSpec = find_underlying_type(pNd->u.Param.pNdTypeSpec); + bool is_in = pNd->u.Param.enmDir == kXpidlDirection_In; /* in string, wstring, nsid, domstring, utf8string, cstring and * astring any explicitly marked [const] are const */ if (is_in && - (IDL_NODE_TYPE(param_type_spec) == IDLN_TYPE_STRING || - IDL_NODE_TYPE(param_type_spec) == IDLN_TYPE_WIDE_STRING || - IDL_tree_property_get(IDL_PARAM_DCL(param_tree).simple_declarator, - "const") || - IDL_tree_property_get(param_type_spec, "nsid") || - IDL_tree_property_get(param_type_spec, "domstring") || - IDL_tree_property_get(param_type_spec, "utf8string") || - IDL_tree_property_get(param_type_spec, "cstring") || - IDL_tree_property_get(param_type_spec, "astring"))) { - fputs("const ", outfile); + (xpidlNdIsStringType(pNdTypeSpec) || + xpidlNodeAttrFind(pNd, "const") || + xpidlNodeAttrFind(pNdTypeSpec, "nsid") || + xpidlNodeAttrFind(pNdTypeSpec, "domstring") || + xpidlNodeAttrFind(pNdTypeSpec, "utf8string") || + xpidlNodeAttrFind(pNdTypeSpec, "cstring") || + xpidlNodeAttrFind(pNdTypeSpec, "astring"))) { + fputs("const ", pFile); } - else if (IDL_PARAM_DCL(param_tree).attr == IDL_PARAM_OUT && - IDL_tree_property_get(IDL_PARAM_DCL(param_tree).simple_declarator, - "shared")) { - fputs("const ", outfile); + else if ( pNd->u.Param.enmDir == kXpidlDirection_Out + && xpidlNodeAttrFind(pNd, "shared")) { + fputs("const ", pFile); } - if (!write_type(param_type_spec, !is_in, outfile)) - return FALSE; + int rc = xpidlHdrWriteType(pNd->u.Param.pNdTypeSpec, pFile); + AssertRC(rc); + if (RT_FAILURE(rc)) + return rc; /* unless the type ended in a *, add a space */ - if (!STARRED_TYPE(param_type_spec)) - fputc(' ', outfile); + if (!STARRED_TYPE(pNdTypeSpec)) + fputc(' ', pFile); /* out and inout params get a bonus '*' (unless this is type that has a * 'dipper' class that is passed in to receive 'out' data) */ - if (IDL_PARAM_DCL(param_tree).attr != IDL_PARAM_IN && - !DIPPER_TYPE(param_type_spec)) { - fputc('*', outfile); - } + if ( !is_in + && !DIPPER_TYPE(pNdTypeSpec)) + fputc('*', pFile); + /* arrays get a bonus * too */ /* XXX Should this be a leading '*' or a trailing "[]" ?*/ - if (IDL_tree_property_get(IDL_PARAM_DCL(param_tree).simple_declarator, - "array")) - fputc('*', outfile); + if (xpidlNodeAttrFind(pNd, "array")) + fputc('*', pFile); - fputs(IDL_IDENT(IDL_PARAM_DCL(param_tree).simple_declarator).str, outfile); - - return TRUE; + fputs(pNd->u.Param.pszName, pFile); + return VINF_SUCCESS; } -/* - * A forward declaration, usually an interface. - */ -static gboolean -forward_dcl(TreeState *state) -{ - IDL_tree iface = state->tree; - const char *className = IDL_IDENT(IDL_FORWARD_DCL(iface).ident).str; - - if (!className) - return FALSE; - - fprintf(state->file, "class %s; /* forward declaration */\n\n", className); - return TRUE; -} /* * Shared between the interface class declaration and the NS_DECL_IFOO macro * provided to aid declaration of implementation classes. - * mode... - * AS_DECL writes 'NS_IMETHOD foo(string bar, long sil)' - * AS_IMPL writes 'NS_IMETHODIMP className::foo(string bar, long sil)' - * AS_CALL writes 'foo(bar, sil)' */ -static gboolean -write_method_signature(IDL_tree method_tree, FILE *outfile, int mode, - const char *className) +static int write_method_signature(PCXPIDLNODE pNd, FILE *pFile, bool fDecl) { - struct _IDL_OP_DCL *op = &IDL_OP_DCL(method_tree); - gboolean no_generated_args = TRUE; - gboolean op_notxpcom = - (IDL_tree_property_get(op->ident, "notxpcom") != NULL); - const char *name; - IDL_tree iter; + bool no_generated_args = true; + bool op_notxpcom = (xpidlNodeAttrFind(pNd, "notxpcom") != NULL); - if (mode == AS_DECL) { + if (fDecl) + { if (op_notxpcom) { - fputs("NS_IMETHOD_(", outfile); - if (!write_type(op->op_type_spec, FALSE, outfile)) - return FALSE; - fputc(')', outfile); + fputs("NS_IMETHOD_(", pFile); + int rc = xpidlHdrWriteType(pNd->u.Method.pNdTypeSpecRet, pFile); + if (RT_FAILURE(rc)) + return rc; + fputc(')', pFile); } else { - fputs("NS_IMETHOD", outfile); + fputs("NS_IMETHOD", pFile); } - fputc(' ', outfile); + fputc(' ', pFile); } - else if (mode == AS_IMPL) { - if (op_notxpcom) { - fputs("NS_IMETHODIMP_(", outfile); - if (!write_type(op->op_type_spec, FALSE, outfile)) - return FALSE; - fputc(')', outfile); - } else { - fputs("NS_IMETHODIMP", outfile); + + const char *pszName = pNd->u.Method.pszName; + fprintf(pFile, "%c%s(", toupper(*pszName), pszName + 1); + + PCXPIDLNODE pIt; + RTListForEach(&pNd->u.Method.LstParams, pIt, XPIDLNODE, NdLst) + { + if (fDecl) + { + int rc = write_param(pIt, pFile); + if (RT_FAILURE(rc)) + return rc; } - fputc(' ', outfile); - } - name = IDL_IDENT(op->ident).str; - if (mode == AS_IMPL) { - fprintf(outfile, "%s::%c%s(", className, toupper(*name), name + 1); - } else { - fprintf(outfile, "%c%s(", toupper(*name), name + 1); - } - for (iter = op->parameter_dcls; iter; iter = IDL_LIST(iter).next) { - if (mode == AS_DECL || mode == AS_IMPL) { - if (!write_param(IDL_LIST(iter).data, outfile)) - return FALSE; - } else { - fputs(IDL_IDENT(IDL_PARAM_DCL(IDL_LIST(iter).data) - .simple_declarator).str, - outfile); - } - if ((IDL_LIST(iter).next || - (!op_notxpcom && op->op_type_spec) || op->f_varargs)) - fputs(", ", outfile); - no_generated_args = FALSE; + else + fputs(pIt->u.Param.pszName, pFile); + + if (!RTListNodeIsLast(&pNd->u.Method.LstParams, &pIt->NdLst)) + fputs(", ", pFile); + no_generated_args = false; } /* make IDL return value into trailing out argument */ - if (op->op_type_spec && !op_notxpcom) { - IDL_tree fake_param = IDL_param_dcl_new(IDL_PARAM_OUT, - op->op_type_spec, - IDL_ident_new("_retval")); - if (!fake_param) - return FALSE; - if (mode == AS_DECL || mode == AS_IMPL) { - if (!write_param(fake_param, outfile)) - return FALSE; - } else { - fputs("_retval", outfile); + if ( pNd->u.Method.pNdTypeSpecRet + && ( pNd->u.Method.pNdTypeSpecRet->enmType != kXpidlNdType_BaseType + || pNd->u.Method.pNdTypeSpecRet->u.enmBaseType != kXpidlType_Void) + && !op_notxpcom) + { + if (!no_generated_args) + fputs(", ", pFile); + XPIDLNODE Nd; + Nd.enmType = kXpidlNdType_Parameter; + Nd.u.Param.pszName = "_retval"; + Nd.u.Param.enmDir = kXpidlDirection_Out; + Nd.u.Param.pNdTypeSpec = pNd->u.Method.pNdTypeSpecRet; + Nd.cAttrs = 0; + int rc = write_param(&Nd, pFile); + if (RT_FAILURE(rc)) + { + AssertFailed(); + return VERR_INVALID_PARAMETER; } + +#if 0 if (op->f_varargs) - fputs(", ", outfile); - no_generated_args = FALSE; + fputs(", ", pFile); +#endif + no_generated_args = false; } +#if 0 /** @todo No varargs allowed. */ /* varargs go last */ if (op->f_varargs) { if (mode == AS_DECL || mode == AS_IMPL) { - fputs("nsVarArgs *", outfile); + fputs("nsVarArgs *", pFile); } - fputs("_varargs", outfile); + fputs("_varargs", pFile); no_generated_args = FALSE; } +#endif /* * If generated method has no arguments, output 'void' to avoid C legacy * behavior of disabling type checking. */ - if (no_generated_args && mode == AS_DECL) { - fputs("void", outfile); - } + if (no_generated_args && fDecl) + fputs("void", pFile); - fputc(')', outfile); - - return TRUE; + fputc(')', pFile); + return VINF_SUCCESS; } -/* - * A method is an `operation', therefore a method decl is an `op dcl'. - * I blame Elliot. - */ -static gboolean -op_dcl(TreeState *state) -{ - GSList *doc_comments = IDL_IDENT(IDL_OP_DCL(state->tree).ident).comments; +static void xpidlHdrWriteIdlAttrs(PCXPIDLNODE pIt, FILE *pFile) +{ + if (pIt->cAttrs) + { + fputs("[", pFile); + uint32_t i; + for (i = 0; i < pIt->cAttrs; i++) + { + if (pIt->aAttrs[i].pszVal) + fprintf(pFile, "%s (%s)", pIt->aAttrs[i].pszName, pIt->aAttrs[i].pszVal); + else + fprintf(pFile, "%s", pIt->aAttrs[i].pszName); + + if (i < pIt->cAttrs - 1) + fputs(", ", pFile); + } + fputs("] ", pFile); + } +} + + +static int xpidlHdrWriteMethod(PCXPIDLNODE pNd, FILE *pFile, PRTERRINFO pErrInfo) +{ /* * Verify that e.g. non-scriptable methods in [scriptable] interfaces * are declared so. Do this in a separate verification pass? */ - if (!verify_method_declaration(state->tree)) - return FALSE; + int rc = verify_method_declaration(pNd, pErrInfo); + if (RT_FAILURE(rc)) + return rc; - if (doc_comments != NULL) { - write_indent(state->file); - printlist(state->file, doc_comments); + /* Dump the signature as a comment. */ + write_indent(pFile); + fputs("/* ", pFile); + xpidlHdrWriteIdlAttrs(pNd, pFile); + xpidlHdrWriteIdlType(pNd->u.Method.pNdTypeSpecRet, pFile); + fprintf(pFile, " %s (", pNd->u.Method.pszName); + PCXPIDLNODE pIt; + RTListForEach(&pNd->u.Method.LstParams, pIt, XPIDLNODE, NdLst) + { + xpidlHdrWriteIdlAttrs(pIt, pFile); + if (pIt->u.Param.enmDir == kXpidlDirection_In) + fputs("in ", pFile); + else if (pIt->u.Param.enmDir == kXpidlDirection_Out) + fputs("out ", pFile); + else + fputs("inout ", pFile); + + xpidlHdrWriteIdlType(pIt->u.Param.pNdTypeSpec, pFile); + fprintf(pFile, " %s", pIt->u.Param.pszName); + + if (!RTListNodeIsLast(&pNd->u.Method.LstParams, &pIt->NdLst)) + fputs(", ", pFile); } - xpidl_write_comment(state, 2); + fputs("); */\n", pFile); - write_indent(state->file); - if (!write_method_signature(state->tree, state->file, AS_DECL, NULL)) - return FALSE; - fputs(" = 0;\n\n", state->file); + write_indent(pFile); + rc = write_method_signature(pNd, pFile, true /*fDecl*/); + if (RT_FAILURE(rc)) + return rc; + fputs(" = 0;\n\n", pFile); - return TRUE; + return VINF_SUCCESS; } -static void -write_codefrag_line(gpointer data, gpointer user_data) + +static int xpidlHdrWriteAttrAccessor(PCXPIDLNODE pNd, FILE *pFile, bool getter, bool fDecl) { - TreeState *state = (TreeState *)user_data; - const char *line = (const char *)data; - fputs(line, state->file); - fputc('\n', state->file); + const char *pszName = pNd->u.Attribute.pszName; + + if (fDecl) + fputs("NS_IMETHOD ", pFile); + fprintf(pFile, "%cet%c%s(", + getter ? 'G' : 'S', + toupper(*pszName), pszName + 1); + if (fDecl) + { + /* Setters for string, wstring, nsid, domstring, utf8string, + * cstring and astring get const. + */ + PCXPIDLNODE pNdTypeSpec = find_underlying_type(pNd->u.Attribute.pNdTypeSpec); + + if (!getter && + (xpidlNdIsStringType(pNdTypeSpec) || + xpidlNodeAttrFind(pNdTypeSpec, "nsid") || + xpidlNodeAttrFind(pNdTypeSpec, "domstring") || + xpidlNodeAttrFind(pNdTypeSpec, "utf8string") || + xpidlNodeAttrFind(pNdTypeSpec, "cstring") || + xpidlNodeAttrFind(pNdTypeSpec, "astring"))) + fputs("const ", pFile); + + int rc = xpidlHdrWriteType(pNd->u.Attribute.pNdTypeSpec, pFile); + if (RT_FAILURE(rc)) + return rc; + fprintf(pFile, "%s%s", + (STARRED_TYPE(pNdTypeSpec) ? "" : " "), + (getter && !DIPPER_TYPE(pNdTypeSpec) ? "*" : "")); + } + fprintf(pFile, "a%c%s)", toupper(pszName[0]), pszName + 1); + return VINF_SUCCESS; } -static gboolean -codefrag(TreeState *state) +static int xpidlHdrWriteAttribute(PCXPIDLNODE pNd, FILE *pFile, PRTERRINFO pErrInfo) { - const char *desc = IDL_CODEFRAG(state->tree).desc; - GSList *lines = IDL_CODEFRAG(state->tree).lines; + int rc = verify_attribute_declaration(pNd, pErrInfo); + if (RT_FAILURE(rc)) + return rc; - if (strcmp(desc, "C++") && /* libIDL bug? */ strcmp(desc, "C++\r")) { - XPIDL_WARNING((state->tree, IDL_WARNING1, - "ignoring '%%{%s' escape. " - "(Use '%%{C++' to escape verbatim C++ code.)", desc)); + /* Write the attribute as a comment. */ + write_indent(pFile); + if (pNd->u.Attribute.fReadonly) + fputs("/* readonly attribute ", pFile); + else + fputs("/* attribute ", pFile); + xpidlHdrWriteIdlType(pNd->u.Attribute.pNdTypeSpec, pFile); + fprintf(pFile, " %s; */\n", pNd->u.Attribute.pszName); - return TRUE; + write_indent(pFile); + rc = xpidlHdrWriteAttrAccessor(pNd, pFile, true, true /*fDecl*/); + if (RT_FAILURE(rc)) + return rc; + fputs(" = 0;\n", pFile); + + if (!pNd->u.Attribute.fReadonly) { + write_indent(pFile); + rc = xpidlHdrWriteAttrAccessor(pNd, pFile, false, true /*fDecl*/); + if (RT_FAILURE(rc)) + return rc; + fputs(" = 0;\n", pFile); + } + fputc('\n', pFile); + + return VINF_SUCCESS; +} + + +static int xpidlHdrWriteConst(PCXPIDLNODE pNd, FILE *pFile, PRTERRINFO pErrInfo) +{ + int rc = verify_const_declaration(pNd, pErrInfo); + if (RT_FAILURE(rc)) + return rc; + + write_indent(pFile); + fprintf(pFile, "enum { %s = ", pNd->u.Const.pszName); +#ifdef RT_OS_DARWIN + fprintf(pFile, "%lluU", pNd->u.Const.u64Const); +#else + fprintf(pFile, "%luU", pNd->u.Const.u64Const); +#endif + fprintf(pFile, " };\n\n"); + + return VINF_SUCCESS; +} + + +static int xpidlHdrWriteInterface(PCXPIDLNODE pNd, FILE *pFile, PRTERRINFO pErrInfo) +{ + char *classNameUpper = NULL; + char *cp; + struct nsID id; + char iid_parsed[UUID_LENGTH]; + + int rc = verify_interface_declaration(pNd, pErrInfo); + if (RT_FAILURE(rc)) + return rc; + +#define FAIL do {/*AssertFailed();*/ goto out;} while(0) + + fprintf(pFile, "\n/* starting interface: %s */\n", pNd->u.If.pszIfName); + + AssertRelease(!xpidlNodeAttrFind(pNd, "namespace")); /* Not supported right now. */ + + PCXPIDLATTR pAttrIid = xpidlNodeAttrFind(pNd, "uuid"); + if (pAttrIid) + { + AssertPtr(pAttrIid->pszVal); + + /* Redundant, but a better error than 'cannot parse.' */ + if (strlen(pAttrIid->pszVal) != 36) + { + rc = xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "IID %s is the wrong length", pAttrIid->pszVal); + FAIL; + } + + /* + * Parse uuid and then output resulting nsID to string, to validate + * uuid and normalize resulting .h files. + */ + if (!xpidl_parse_iid(&id, pAttrIid->pszVal)) + { + rc = xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "cannot parse IID %s\n", pAttrIid->pszVal); + FAIL; + } + if (!xpidl_sprint_iid(&id, iid_parsed)) + { + rc = xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "error formatting IID %s\n", pAttrIid->pszVal); + FAIL; + } + + /* #define NS_ISUPPORTS_IID_STR "00000000-0000-0000-c000-000000000046" */ + fputs("#define ", pFile); + write_classname_iid_define(pFile, pNd->u.If.pszIfName); + fprintf(pFile, "_STR \"%s\"\n", iid_parsed); + fputc('\n', pFile); + + /* #define NS_ISUPPORTS_IID { {0x00000000 .... 0x46 }} */ + fprintf(pFile, "#define "); + write_classname_iid_define(pFile, pNd->u.If.pszIfName); + fprintf(pFile, " \\\n" + " {0x%.8x, 0x%.4x, 0x%.4x, \\\n" + " { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, " + "0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }}\n", + id.m0, id.m1, id.m2, + id.m3[0], id.m3[1], id.m3[2], id.m3[3], + id.m3[4], id.m3[5], id.m3[6], id.m3[7]); + fputc('\n', pFile); + } + else + { + rc = xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "interface %s lacks a uuid attribute\n", pNd->u.If.pszIfName); + FAIL; } /* - * Emit #file directive to point debuggers back to the original .idl file - * for the duration of the code fragment. We look at internal IDL node - * properties _file, _line to do this; hopefully they won't change. - * - * _line seems to refer to the line immediately after the closing %}, so - * we backtrack to get the proper line for the beginning of the block. + * NS_NO_VTABLE is defined in nsISupportsUtils.h, and defined on windows + * to __declspec(novtable) on windows. This optimization is safe + * whenever the constructor calls no virtual methods. Writing in IDL + * almost guarantees this, except for the case when a %{C++ block occurs in + * the interface. We detect that case, and emit a macro call that disables + * the optimization. */ - g_slist_foreach(lines, write_codefrag_line, (gpointer)state); - - return TRUE; -} - -backend * -xpidl_header_dispatch(void) -{ - static backend result; - static nodeHandler table[IDLN_LAST]; - static gboolean initialized = FALSE; - - result.emit_prolog = header_prolog; - result.emit_epilog = header_epilog; - - if (!initialized) { - table[IDLN_LIST] = list; - table[IDLN_ATTR_DCL] = attr_dcl; - table[IDLN_OP_DCL] = op_dcl; - table[IDLN_FORWARD_DCL] = forward_dcl; - table[IDLN_TYPE_ENUM] = do_enum; - table[IDLN_INTERFACE] = interface; - table[IDLN_CODEFRAG] = codefrag; - table[IDLN_TYPE_DCL] = do_typedef; - table[IDLN_CONST_DCL] = do_const_dcl; - table[IDLN_NATIVE] = check_native; - initialized = TRUE; + bool keepvtable = false; + PCXPIDLNODE pIt; + RTListForEach(&pNd->u.If.LstBody, pIt, XPIDLNODE, NdLst) + { + if (pIt->enmType == kXpidlNdType_RawBlock) + { + keepvtable = true; + break; + } } - result.dispatch_table = table; - return &result; + + /* The interface declaration itself. */ + fprintf(pFile, + "class %s%s", + (keepvtable ? "" : "NS_NO_VTABLE "), pNd->u.If.pszIfName); + + if (pNd->u.If.pszIfInherit) { + fputs(" : ", pFile); + fprintf(pFile, "public %s", pNd->u.If.pszIfInherit); + } + fputs(" {\n" + " public: \n\n", pFile); + + fputs(" NS_DEFINE_STATIC_IID_ACCESSOR(", pFile); + write_classname_iid_define(pFile, pNd->u.If.pszIfName); + fputs(")\n\n", pFile); + + RTListForEach(&pNd->u.If.LstBody, pIt, XPIDLNODE, NdLst) + { + switch (pIt->enmType) + { + case kXpidlNdType_Const: + rc = xpidlHdrWriteConst(pIt, pFile, pErrInfo); + if (RT_FAILURE(rc)) + FAIL; + break; + case kXpidlNdType_Attribute: + rc = xpidlHdrWriteAttribute(pIt, pFile, pErrInfo); + if (RT_FAILURE(rc)) + FAIL; + break; + case kXpidlNdType_Method: + rc = xpidlHdrWriteMethod(pIt, pFile, pErrInfo); + if (RT_FAILURE(rc)) + FAIL; + break; + case kXpidlNdType_RawBlock: + fprintf(pFile, "%.*s", (int)pIt->u.RawBlock.cchRaw, pIt->u.RawBlock.pszRaw); + break; + default: + rc = VERR_INVALID_PARAMETER; + FAIL; + } + } + + fputs("};\n", pFile); + fputc('\n', pFile); + + /* + * #define NS_DECL_NSIFOO - create method prototypes that can be used in + * class definitions that support this interface. + * + * Walk the tree explicitly to prototype a reworking of xpidl to get rid of + * the callback mechanism. + */ + fputs("/* Use this macro when declaring classes that implement this " + "interface. */\n", pFile); + fputs("#define NS_DECL_", pFile); + classNameUpper = xpidl_strdup(pNd->u.If.pszIfName); + if (!classNameUpper) + FAIL; + + for (cp = classNameUpper; *cp != '\0'; cp++) + *cp = toupper(*cp); + fprintf(pFile, "%s \\\n", classNameUpper); + if (RTListIsEmpty(&pNd->u.If.LstBody)) + { + write_indent(pFile); + fputs("/* no methods! */\n", pFile); + } + + RTListForEach(&pNd->u.If.LstBody, pIt, XPIDLNODE, NdLst) + { + switch (pIt->enmType) + { + case kXpidlNdType_Const: + case kXpidlNdType_RawBlock: + /* ignore it here; it doesn't contribute to the macro. */ + continue; + case kXpidlNdType_Attribute: + { + write_indent(pFile); + rc = xpidlHdrWriteAttrAccessor(pIt, pFile, true, true /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + if (!pIt->u.Attribute.fReadonly) + { + fputs(" NS_OVERRIDE; \\\n", pFile); /* Terminate the previous one. */ + write_indent(pFile); + rc = xpidlHdrWriteAttrAccessor(pIt, pFile, false, true /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + /* '; \n' at end will clean up. */ + } + break; + } + case kXpidlNdType_Method: + write_indent(pFile); + rc = write_method_signature(pIt, pFile, true /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + break; + default: + rc = VERR_INVALID_PARAMETER; + FAIL; + } + + if (!RTListNodeIsLast(&pNd->u.If.LstBody, &pIt->NdLst)) + fprintf(pFile, " NS_OVERRIDE; \\\n"); + else + fprintf(pFile, " NS_OVERRIDE; \n"); + } + fputc('\n', pFile); + + /* XXX abstract above and below into one function? */ + /* + * #define NS_FORWARD_NSIFOO - create forwarding methods that can delegate + * behavior from in implementation to another object. As generated by + * idlc. + */ + fprintf(pFile, + "/* Use this macro to declare functions that forward the " + "behavior of this interface to another object. */\n" + "#define NS_FORWARD_%s(_to) \\\n", + classNameUpper); + if (RTListIsEmpty(&pNd->u.If.LstBody)) + { + write_indent(pFile); + fputs("/* no methods! */\n", pFile); + } + + RTListForEach(&pNd->u.If.LstBody, pIt, XPIDLNODE, NdLst) + { + switch (pIt->enmType) + { + case kXpidlNdType_Const: + case kXpidlNdType_RawBlock: + continue; + case kXpidlNdType_Attribute: + { + write_indent(pFile); + rc = xpidlHdrWriteAttrAccessor(pIt, pFile, true, true /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + fputs(" { return _to ", pFile); + rc = xpidlHdrWriteAttrAccessor(pIt, pFile, true, false /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + if (!pIt->u.Attribute.fReadonly) + { + fputs("; } \\\n", pFile); /* Terminate the previous one. */ + write_indent(pFile); + rc = xpidlHdrWriteAttrAccessor(pIt, pFile, false, true /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + fputs(" { return _to ", pFile); + rc = xpidlHdrWriteAttrAccessor(pIt, pFile, false, false /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + /* '; } \n' at end will clean up. */ + } + break; + } + case kXpidlNdType_Method: + write_indent(pFile); + rc = write_method_signature(pIt, pFile, true /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + fputs(" { return _to ", pFile); + rc = write_method_signature(pIt, pFile, false /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + break; + default: + rc = VERR_INVALID_PARAMETER; + FAIL; + } + + if (!RTListNodeIsLast(&pNd->u.If.LstBody, &pIt->NdLst)) + fprintf(pFile, "; } \\\n"); + else + fprintf(pFile, "; } \n"); + } + fputc('\n', pFile); + + + /* XXX abstract above and below into one function? */ + /* + * #define NS_FORWARD_SAFE_NSIFOO - create forwarding methods that can delegate + * behavior from in implementation to another object. As generated by + * idlc. + */ + fprintf(pFile, + "/* Use this macro to declare functions that forward the " + "behavior of this interface to another object in a safe way. */\n" + "#define NS_FORWARD_SAFE_%s(_to) \\\n", + classNameUpper); + if (RTListIsEmpty(&pNd->u.If.LstBody)) + { + write_indent(pFile); + fputs("/* no methods! */\n", pFile); + } + + RTListForEach(&pNd->u.If.LstBody, pIt, XPIDLNODE, NdLst) + { + switch (pIt->enmType) + { + case kXpidlNdType_Const: + case kXpidlNdType_RawBlock: + continue; + case kXpidlNdType_Attribute: + { + write_indent(pFile); + rc = xpidlHdrWriteAttrAccessor(pIt, pFile, true, true /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + fputs(" { return !_to ? NS_ERROR_NULL_POINTER : _to->", pFile); + rc = xpidlHdrWriteAttrAccessor(pIt, pFile, true, false /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + if (!pIt->u.Attribute.fReadonly) + { + fputs("; } \\\n", pFile); /* Terminate the previous one. */ + write_indent(pFile); + rc = xpidlHdrWriteAttrAccessor(pIt, pFile, false, true /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + fputs(" { return !_to ? NS_ERROR_NULL_POINTER : _to->", pFile); + rc = xpidlHdrWriteAttrAccessor(pIt, pFile, false, false /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + /* '; } \n' at end will clean up. */ + } + break; + } + case kXpidlNdType_Method: + write_indent(pFile); + rc = write_method_signature(pIt, pFile, true /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + fputs(" { return !_to ? NS_ERROR_NULL_POINTER : _to->", pFile); + rc = write_method_signature(pIt, pFile, false /*fDecl*/); + if (RT_FAILURE(rc)) + FAIL; + break; + default: + rc = VERR_INVALID_PARAMETER; + FAIL; + } + + if (!RTListNodeIsLast(&pNd->u.If.LstBody, &pIt->NdLst)) + fprintf(pFile, "; } \\\n"); + else + fprintf(pFile, "; } \n"); + } + fputc('\n', pFile); + +#undef FAIL + +out: + if (classNameUpper) + free(classNameUpper); + return rc; +} + + +DECL_HIDDEN_CALLBACK(int) xpidl_header_dispatch(FILE *pFile, PCXPIDLINPUT pInput, PCXPIDLPARSE pParse, PRTERRINFO pErrInfo) +{ + char *define = RTPathFilename(pInput->pszBasename); + fprintf(pFile, "/*\n * DO NOT EDIT. THIS FILE IS GENERATED FROM" + " %s.idl\n */\n", pInput->pszBasename); + fprintf(pFile, + "\n#ifndef __gen_%s_h__\n" + "#define __gen_%s_h__\n", + define, define); + + if (!RTListIsEmpty(&pInput->LstIncludes)) + { + fputc('\n', pFile); + PCXPIDLINPUT pIt; + RTListForEach(&pInput->LstIncludes, pIt, XPIDLINPUT, NdInclude) + { + char *dot = strrchr(pIt->pszBasename, '.'); + if (dot != NULL) + *dot = '\0'; + + + /* begin include guard */ + fprintf(pFile, + "\n#ifndef __gen_%s_h__\n", + pIt->pszBasename); + + fprintf(pFile, "#include \"%s.h\"\n", pIt->pszBasename); + + fprintf(pFile, "#endif\n"); + } + + fputc('\n', pFile); + } + /* + * Support IDL files that don't include a root IDL file that defines + * NS_NO_VTABLE. + */ + fprintf(pFile, + "/* For IDL files that don't want to include root IDL files. */\n" + "#ifndef NS_NO_VTABLE\n" + "#define NS_NO_VTABLE\n" + "#endif\n"); + + PCXPIDLNODE pNd; + RTListForEach(&pParse->LstNodes, pNd, XPIDLNODE, NdLst) + { + /* Only output nodes from the first level input and not for any includes. */ + if (pNd->pInput != pInput) + continue; + + int rc = VINF_SUCCESS; + switch (pNd->enmType) + { + case kXpidlNdType_RawBlock: + { + fprintf(pFile, "%.*s", (int)pNd->u.RawBlock.cchRaw, pNd->u.RawBlock.pszRaw); + break; + } + case kXpidlNdType_Interface_Forward_Decl: + { + fprintf(pFile, "class %s; /* forward declaration */\n\n", pNd->u.pszIfFwdName); + break; + } + case kXpidlNdType_Interface_Def: + { + rc = xpidlHdrWriteInterface(pNd, pFile, pErrInfo); + break; + } + case kXpidlNdType_Typedef: + { + fprintf(pFile, "typedef "); + rc = xpidlHdrWriteType(pNd->u.Typedef.pNodeTypeSpec, pFile); + if (RT_SUCCESS(rc)) + fprintf(pFile, " %s;\n\n", pNd->u.Typedef.pszName); + break; + } + default: /* Ignore */ + break; + } + if (RT_FAILURE(rc)) + return rc; + } + + fprintf(pFile, "\n#endif /* __gen_%s_h__ */\n", define); + return VINF_SUCCESS; } diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_idl.c b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_idl.c index 8b1b5af5..2405decb 100644 --- a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_idl.c +++ b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_idl.c @@ -1,741 +1,1384 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Netscape Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Michael Ang - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* $Id: xpidl_idl.c $ */ +/** @file + * VBox xpidl clone - IDL parsing. + */ /* - * Common IDL-processing code. + * Copyright (C) 2025 Oracle and/or its affiliates. + * + * This file is part of VirtualBox base platform packages, as + * available from https://www.virtualbox.org. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, in version 3 of the + * License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + * + * SPDX-License-Identifier: GPL-3.0-only */ +#include #include #include #include +#include +#include +#include +#include #include "xpidl.h" -static gboolean parsed_empty_file; -/* - * The bulk of the generation happens here. - */ -gboolean -xpidl_process_node(TreeState *state) +typedef enum XPIDLKEYWORD { - gint type; - nodeHandler *dispatch, handler; + kXpidlKeyword_Invalid = 0, + kXpidlKeyword_Include, + kXpidlKeyword_Typedef, + kXpidlKeyword_Void, + kXpidlKeyword_Char, + kXpidlKeyword_Wide_Char, + kXpidlKeyword_Unsigned, + kXpidlKeyword_Long, + kXpidlKeyword_Short, + kXpidlKeyword_Boolean, + kXpidlKeyword_Octet, + kXpidlKeyword_String, + kXpidlKeyword_Wide_String, + kXpidlKeyword_Double, + kXpidlKeyword_Float, + kXpidlKeyword_Native, + kXpidlKeyword_Interface, + kXpidlKeyword_Readonly, + kXpidlKeyword_Attribute, + kXpidlKeyword_In, + kXpidlKeyword_Out, + kXpidlKeyword_InOut, + kXpidlKeyword_Const, + kXpidlKeyword_32Bit_Hack = 0x7fffffff +} XPIDLKEYWORD; +typedef const XPIDLKEYWORD *PCXPIDLKEYWORD; +typedef XPIDLKEYWORD *PXPIDLKEYWORD; - XPT_ASSERT(state->tree); - type = IDL_NODE_TYPE(state->tree); +static DECLCALLBACK(int) xpidlIdlLexParseNumberIdentifierOrUuid(RTSCRIPTLEX hScriptLex, char ch, PRTSCRIPTLEXTOKEN pToken, void *pvUser); - if ((dispatch = state->dispatch) && (handler = dispatch[type])) - return handler(state); - return TRUE; -} -static int -msg_callback(int level, int num, int line, const char *file, - const char *message) +static const char *s_aszSingleStart[] = { - char *warning_message; + "//", + NULL +}; - /* - * Egregious hack to permit empty files. - * XXX libIDL needs an API to detect this case robustly. - */ - if (0 == strcmp(message, "File empty after optimization")) { - parsed_empty_file = TRUE; - return 1; - } - if (!file) - file = ""; - warning_message = g_strdup_printf("%s:%d: %s\n", file, line, message); - - fputs(warning_message, stderr); - g_free(warning_message); - return 1; -} - -/* - * To keep track of the state associated with a given input file. The 'next' - * field lets us maintain a stack of input files. - */ -typedef struct input_data { - char *filename; /* where did I come from? */ - unsigned int lineno; /* last lineno processed */ - char *buf; /* contents of file */ - char *point; /* next char to feed to libIDL */ - char *max; /* 1 past last char in buf */ - struct input_data *next; /* file from which we were included */ -} input_data; - -/* - * Passed to us by libIDL. Holds global information and the current stack of - * include files. - */ -typedef struct input_callback_state { - struct input_data *input_stack; /* linked list of input_data */ - GHashTable *already_included; /* to prevent redundant includes */ - IncludePathEntry *include_path; /* search path for included files */ - GSList *base_includes; /* to accumulate #includes from *first* file; - * for passing thru TreeState to - * xpidl_header backend. */ -} input_callback_state; - -static void * -file_read_from_includes(const char *filename, IncludePathEntry *include_path, size_t *pcbFile) +static const char *s_aszMultiStart[] = { - IncludePathEntry *current_path = include_path; - char *pathname; + "/*", + "%{C++", + "%{ C++", + NULL +}; - if (filename[0] != '/') { - while (current_path) { - pathname = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", - current_path->directory, filename); - if (!pathname) - return NULL; - void *pvFile = NULL; - int vrc = RTFileReadAll(pathname, &pvFile, pcbFile); - g_free(pathname); - if (RT_SUCCESS(vrc)) - return pvFile; - current_path = current_path->next; - } - } else { - void *pvFile = NULL; - int vrc = RTFileReadAll(filename, &pvFile, pcbFile); - if (RT_SUCCESS(vrc)) - return pvFile; - } - return NULL; -} -#if defined(XP_MAC) && defined(XPIDL_PLUGIN) -extern FILE* mac_fopen(const char* filename, const char *mode); -#endif - -static input_data * -new_input_data(const char *filename, IncludePathEntry *include_path) +static const char *s_aszMultiEnd[] = { - input_data *new_data; + "*/", + "%}", + "%}", + NULL +}; - /* - * Rather than try to keep track of many different varieties of state - * around the boundaries of a circular buffer, we just read in the entire - * file. - */ - size_t cbFile = 0; - void *pvFile = file_read_from_includes(filename, include_path, &cbFile); - if (!pvFile) - return NULL; - /* Need to copy the data over into a new buffer in order to be able to append a zero terminator. */ - char *pbBuf = (char *)RTMemDupEx(pvFile, cbFile, 1 /* for the zero terminator */); - if (!pbBuf) +static const RTSCRIPTLEXTOKMATCH s_aMatches[] = +{ + { RT_STR_TUPLE("#include"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Include }, + + { RT_STR_TUPLE("void"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Void }, + { RT_STR_TUPLE("char"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Char }, + { RT_STR_TUPLE("long"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Long }, + { RT_STR_TUPLE("wchar"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Wide_Char }, + { RT_STR_TUPLE("wstring"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Wide_String }, + { RT_STR_TUPLE("boolean"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Boolean }, + { RT_STR_TUPLE("double"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Double }, + { RT_STR_TUPLE("float"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Float }, + { RT_STR_TUPLE("octet"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Octet }, + { RT_STR_TUPLE("short"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Short }, + { RT_STR_TUPLE("string"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_String }, + { RT_STR_TUPLE("unsigned"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Unsigned }, + + { RT_STR_TUPLE("typedef"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Typedef }, + { RT_STR_TUPLE("native"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Native }, + { RT_STR_TUPLE("interface"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Interface }, + { RT_STR_TUPLE("readonly"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Readonly }, + { RT_STR_TUPLE("attribute"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Attribute }, + { RT_STR_TUPLE("in"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_In }, + { RT_STR_TUPLE("inout"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_InOut }, + { RT_STR_TUPLE("out"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Out }, + { RT_STR_TUPLE("const"), RTSCRIPTLEXTOKTYPE_KEYWORD, true, kXpidlKeyword_Const }, + + { RT_STR_TUPLE(","), RTSCRIPTLEXTOKTYPE_PUNCTUATOR, false, ',' }, + { RT_STR_TUPLE("["), RTSCRIPTLEXTOKTYPE_PUNCTUATOR, false, '[' }, + { RT_STR_TUPLE("]"), RTSCRIPTLEXTOKTYPE_PUNCTUATOR, false, ']' }, + { RT_STR_TUPLE("{"), RTSCRIPTLEXTOKTYPE_PUNCTUATOR, false, '{' }, + { RT_STR_TUPLE("}"), RTSCRIPTLEXTOKTYPE_PUNCTUATOR, false, '}' }, + { RT_STR_TUPLE("("), RTSCRIPTLEXTOKTYPE_PUNCTUATOR, false, '(' }, + { RT_STR_TUPLE(")"), RTSCRIPTLEXTOKTYPE_PUNCTUATOR, false, ')' }, + { RT_STR_TUPLE(";"), RTSCRIPTLEXTOKTYPE_PUNCTUATOR, false, ';' }, + { RT_STR_TUPLE("="), RTSCRIPTLEXTOKTYPE_PUNCTUATOR, false, '=' }, + { RT_STR_TUPLE(":"), RTSCRIPTLEXTOKTYPE_PUNCTUATOR, false, ':' }, + { NULL, 0, RTSCRIPTLEXTOKTYPE_INVALID, false, 0 } +}; + + +static const RTSCRIPTLEXRULE s_aRules[] = +{ + { '\"', '\"', RTSCRIPT_LEX_RULE_CONSUME, RTScriptLexScanStringLiteralC, NULL}, /** @todo This is not correct. */ + { '0', '9', RTSCRIPT_LEX_RULE_DEFAULT, xpidlIdlLexParseNumberIdentifierOrUuid, NULL}, + { 'a', 'z', RTSCRIPT_LEX_RULE_DEFAULT, xpidlIdlLexParseNumberIdentifierOrUuid, NULL}, + { 'A', 'Z', RTSCRIPT_LEX_RULE_DEFAULT, xpidlIdlLexParseNumberIdentifierOrUuid, NULL}, + { '_', '_', RTSCRIPT_LEX_RULE_DEFAULT, RTScriptLexScanIdentifier, NULL}, + { '\0', '\0', RTSCRIPT_LEX_RULE_DEFAULT, NULL, NULL} +}; + + +static const RTSCRIPTLEXCFG g_IdlLexCfg = +{ + /** pszName */ + "IDL", + /** pszDesc */ + "IDL lexer", + /** fFlags */ + RTSCRIPT_LEX_CFG_F_COMMENTS_AS_TOKENS, + /** pszWhitespace */ + NULL, + /** pszNewline */ + NULL, + /** papszCommentMultiStart */ + s_aszMultiStart, + /** papszCommentMultiEnd */ + s_aszMultiEnd, + /** papszCommentSingleStart */ + s_aszSingleStart, + /** paTokMatches */ + s_aMatches, + /** paRules */ + s_aRules, + /** pfnProdDef */ + NULL, + /** pfnProdDefUser */ + NULL +}; + + +static bool g_fParsingAttributes = false; +static bool g_fRequiredUuid = false; + +static int xpidlParseIdl(PXPIDLPARSE pThis, PXPIDLINPUT pInput, PRTLISTANCHOR pLstIncludePaths); + + +static DECLCALLBACK(int) xpidlIdlLexParseNumberIdentifierOrUuid(RTSCRIPTLEX hScriptLex, char ch, PRTSCRIPTLEXTOKEN pToken, void *pvUser) +{ + RT_NOREF(pvUser); + if (g_fRequiredUuid) { - RTFileReadAllFree(pvFile, cbFile); - return NULL; + g_fRequiredUuid = false; + /* Scan as an identifier. */ + static const char *g_aszIdeCharSetUuid = "abcdefABCDEF01234567809-"; + RTScriptLexConsumeCh(hScriptLex); + return RTScriptLexScanIdentifier(hScriptLex, ch, pToken, (void *)g_aszIdeCharSetUuid); } + else if (ch >= '0' && ch <= '9') + return RTScriptLexScanNumber(hScriptLex, 0 /*uBase*/, false /*fAllowReal*/, pToken); - memcpy(pbBuf, pvFile, cbFile); - RTFileReadAllFree(pvFile, cbFile); + RTScriptLexConsumeCh(hScriptLex); + return RTScriptLexScanIdentifier(hScriptLex, ch, pToken, NULL); +} - new_data = xpidl_malloc(sizeof (struct input_data)); - if (!new_data) + +/** + * Create a new lexer from the given filename, possibly searching the include paths. + * + * @returns IPRT status code. + * @param pszFilename The filename to read. + * @param pLstIncludePaths The list of include paths to search for relative filenames. + * @param phIdlLex Where to store the handle to the lexer on success. + */ +static int xpidlCreateLexerFromFilename(const char *pszFilename, PRTLISTANCHOR pLstIncludePaths, + PRTSCRIPTLEX phIdlLex) +{ + char szPath[RTPATH_MAX]; + + if (pszFilename[0] != '/') { - RTMemFree(pbBuf); - return NULL; - } + PCXPIDLINCLUDEDIR pIt; + RTListForEach(pLstIncludePaths, pIt, XPIDLINCLUDEDIR, NdIncludes) + { + ssize_t cch = RTStrPrintf2(&szPath[0], sizeof(szPath), "%s%c%s", + pIt->pszPath, RTPATH_SLASH, pszFilename); + if (cch <= 0) + return VERR_BUFFER_OVERFLOW; - new_data->point = new_data->buf = pbBuf; - new_data->max = pbBuf + cbFile; - *new_data->max = '\0'; - new_data->filename = xpidl_strdup(filename); - /* libIDL expects the line number to be that of the *next* line */ - new_data->lineno = 2; - new_data->next = NULL; - return new_data; -} - -/* process pending raw section */ -static int -NextIsRaw(input_data *data, char **startp, int *lenp) -{ - char *end, *start; - - /* - * XXXmccabe still needed: an in_raw flag to handle the case where we're in - * a raw block, but haven't managed to copy it all to xpidl. This will - * happen when we have a raw block larger than - * IDL_input_data->fill.max_size (currently 8192.) - */ - if (!(data->point[0] == '%' && data->point[1] == '{')) - return 0; - - start = *startp = data->point; - - end = NULL; - while (start < data->max && (end = strstr(start, "%}"))) { - if (end[-1] == '\r' || - end[-1] == '\n') - break; - start = end + 1; - } - - if (end && start < data->max) { - *lenp = end - data->point + 2; - return 1; - } else { - const char *filename; - int lineno; - - IDL_file_get(&filename, &lineno); - msg_callback(IDL_ERROR, 0, lineno, filename, - "unterminated %{ block"); - return -1; - } -} - -/* process pending comment */ -static int -NextIsComment(input_data *data, char **startp, int *lenp) -{ - char *end; - - if (!(data->point[0] == '/' && data->point[1] == '*')) - return 0; - - end = strstr(data->point, "*/"); - *lenp = 0; - if (end) { - int skippedLines = 0; - char *tempPoint; - - /* get current lineno */ - IDL_file_get(NULL,(int *)&data->lineno); - - /* get line count */ - for (tempPoint = data->point; tempPoint < end; tempPoint++) { - if (*tempPoint == '\n') - skippedLines++; - } - - data->lineno += skippedLines; - IDL_file_set(data->filename, (int)data->lineno); - - *startp = end + 2; - - /* If it's a ** comment, tell libIDL about it. */ - if (data->point[2] == '*') { - /* hack termination. +2 to get past '*' '/' */ - char t = *(end + 2); - *(end + 2) = '\0'; - IDL_queue_new_ident_comment(data->point); - *(end + 2) = t; - } - - data->point = *startp; /* XXXmccabe move this out of function? */ - return 1; - } else { - const char *filename; - int lineno; - - IDL_file_get(&filename, &lineno); - msg_callback(IDL_ERROR, 0, lineno, filename, - "unterminated comment"); - return -1; - } -} - -static int -NextIsInclude(input_callback_state *callback_state, char **startp, - int *lenp) -{ - input_data *data = callback_state->input_stack; - input_data *new_data; - char *filename, *end; - const char *scratch; - - /* process the #include that we're in now */ - if (strncmp(data->point, "#include \"", 10)) { - return 0; - } - - filename = data->point + 10; /* skip #include " */ - XPT_ASSERT(filename < data->max); - end = filename; - while (end < data->max) { - if (*end == '\"' || *end == '\n' || *end == '\r') - break; - end++; - } - - if (*end != '\"') { - /* - * Didn't find end of include file. Scan 'til next whitespace to find - * some reasonable approximation of the filename, and use it to report - * an error. - */ - - end = filename; - while (end < data->max) { - if (*end == ' ' || *end == '\n' || *end == '\r' || *end == '\t') + if (RTFileExists(szPath)) + { + pszFilename = szPath; break; - end++; - } - *end = '\0'; - - /* make sure we have accurate line info */ - IDL_file_get(&scratch, (int *)&data->lineno); - fprintf(stderr, - "%s:%u: didn't find end of quoted include name \"%s\n", - scratch, data->lineno, filename); - return -1; - } - - *end = '\0'; - *startp = end + 1; - - if (data->next == NULL) { - /* - * If we're in the initial file, add this filename to the list - * of filenames to be turned into #include "filename.h" - * directives in xpidl_header.c. We do it here rather than in the - * block below so it still gets added to the list even if it's - * already been recursively included from some other file. - */ - char *filename_cp = xpidl_strdup(filename); - - /* note that g_slist_append accepts and likes null as list-start. */ - callback_state->base_includes = - g_slist_append(callback_state->base_includes, filename_cp); - } - - /* store offset for when we pop, or if we skip this one */ - data->point = *startp; - - if (!g_hash_table_lookup(callback_state->already_included, filename)) { - filename = xpidl_strdup(filename); - g_hash_table_insert(callback_state->already_included, - filename, (void *)TRUE); - new_data = new_input_data(filename, callback_state->include_path); - if (!new_data) { - char *error_message; - IDL_file_get(&scratch, (int *)&data->lineno); - error_message = - g_strdup_printf("can't open included file %s for reading\n", - filename); - msg_callback(IDL_ERROR, 0, - data->lineno, scratch, error_message); - g_free(error_message); - return -1; - } - - new_data->next = data; - /* tell libIDL to exclude this IDL from the toplevel tree */ - IDL_inhibit_push(); - IDL_file_get(&scratch, (int *)&data->lineno); - callback_state->input_stack = new_data; - IDL_file_set(new_data->filename, (int)new_data->lineno); - } - - *lenp = 0; /* this is magic, see the comment below */ - return 1; -} - -static void -FindSpecial(input_data *data, char **startp, int *lenp) -{ - char *point = data->point; - - /* magic sequences are: - * "%{" raw block - * "/\*" comment - * "#include \"" include - * The first and last want a newline [\r\n] before, or the start of the - * file. - */ - -#define LINE_START(data, point) (point == data->buf || \ - (point > data->point && \ - (point[-1] == '\r' || point[-1] == '\n'))) - - while (point < data->max) { - if (point[0] == '/' && point[1] == '*') - break; - if (LINE_START(data, point)) { - if (point[0] == '%' && point[1] == '{') - break; - if (point[0] == '#' && !strncmp(point + 1, "include \"", 9)) - break; - } - point++; - } - -#undef LINE_START - - *startp = data->point; - *lenp = point - data->point; -} - -#ifndef VBOX -/* set this with a debugger to see exactly what libIDL sees */ -static FILE *tracefile = NULL; -#endif - -static int -input_callback(IDL_input_reason reason, union IDL_input_data *cb_data, - gpointer user_data) -{ - input_callback_state *callback_state = user_data; - input_data *data = callback_state->input_stack; - input_data *new_data = NULL; - unsigned int len, copy; - int rv; - char *start; - - switch(reason) { - case IDL_INPUT_REASON_INIT: - if (data == NULL || data->next == NULL) { - /* - * This is the first file being processed. As it's the target - * file, we only look for it in the first entry in the include - * path, which we assume to be the current directory. - */ - - /* XXXmccabe proper assumption? Do we handle files in other - directories? */ - - IncludePathEntry first_entry; - - first_entry.directory = callback_state->include_path->directory; - first_entry.next = NULL; - - new_data = new_input_data(cb_data->init.filename, - &first_entry); - } else { - new_data = new_input_data(cb_data->init.filename, - callback_state->include_path); - } - - if (!new_data) - return -1; - - IDL_file_set(new_data->filename, (int)new_data->lineno); - callback_state->input_stack = new_data; - return 0; - - case IDL_INPUT_REASON_FILL: - start = NULL; - len = 0; - - while (data->point >= data->max) { - if (!data->next) - return 0; - - /* Current file is done; revert to including file */ - callback_state->input_stack = data->next; - free(data->filename); - RTMemFree(data->buf); - free(data); - data = callback_state->input_stack; - - IDL_file_set(data->filename, (int)data->lineno); - IDL_inhibit_pop(); - } - - /* - * Now we scan for sequences which require special attention: - * \n#include begins an include statement - * \n%{ begins a raw-source block - * /\* begins a comment - * - * We used to be fancier here, so make sure that we sent the most - * data possible at any given time. To that end, we skipped over - * \n%{ raw \n%} blocks and then _continued_ the search for special - * sequences like \n#include or /\* comments . - * - * It was really ugly, though -- liberal use of goto! lots of implicit - * state! what fun! -- so now we just do this: - * - * if (special at start) { - * process that special - - * - raw: send it to libIDL, and don't look inside for specials - * - comments: adjust point and start over - * - includes: push new input_data struct for included file, and - * start over - * } else { - * scan for next special - * send data up to that special to libIDL - * } - * - * If len is set to zero, it is a sentinel value indicating we a comment - * or include was found, and parsing should start over. - * - * XXX const string foo = "/\*" will just screw us horribly. - * Hm but. We could treat strings as we treat raw blocks, eh? - */ - - /* - * Order is important, so that you can have /\* comments and - * #includes within raw sections, and so that you can comment out - * #includes. - */ - rv = NextIsRaw(data, &start, (int *)&len); - if (rv == -1) return -1; - if (!rv) { - /* - * When NextIsComment succeeds, it returns a 0 len (requesting a - * restart) and adjusts data->point to pick up after the comment. - */ - rv = NextIsComment(data, &start, (int *)&len); - if (rv == -1) return -1; - if (!rv) { - /* - * NextIsInclude might push a new input_data struct; if so, it - * will return a 0 len, letting the callback pick up the new - * file the next time around. - */ - rv = NextIsInclude(callback_state, &start, (int *)&len); - if (rv == -1) return -1; - if (!rv) - FindSpecial(data, &start, (int *)&len); } } - - if (len == 0) { - /* - * len == 0 is a sentinel value that means we found a comment or - * include. If we found a comment, point has been adjusted to - * point past the comment. If we found an include, a new input_data - * has been pushed. In both cases, calling the input_callback again - * will pick up the new state. - */ - return input_callback(reason, cb_data, user_data); - } - - copy = MIN(len, (unsigned int) cb_data->fill.max_size); - memcpy(cb_data->fill.buffer, start, copy); - data->point = start + copy; - -#ifndef VBOX - if (tracefile) - fwrite(cb_data->fill.buffer, copy, 1, tracefile); -#endif - - return copy; - - case IDL_INPUT_REASON_ABORT: - case IDL_INPUT_REASON_FINISH: - while (data != NULL) { - input_data *next; - - next = data->next; - free(data->filename); - RTMemFree(data->buf); - free(data); - data = next; - } - callback_state->input_stack = NULL; - return 0; - - default: - g_error("unknown input reason %d!", reason); - return -1; - } -} - -static void -free_ghash_key(gpointer key, gpointer value, gpointer user_data) -{ - /* We're only storing TRUE in the value... */ - free(key); -} - -static void -free_gslist_data(gpointer data, gpointer user_data) -{ - free(data); -} - -/* Pick up unlink. */ -#include - -int -xpidl_process_idl(char *filename, IncludePathEntry *include_path, - char *file_basename, ModeData *mode) -{ - char *tmp, *outname, *real_outname = NULL; - IDL_tree top; - TreeState state; - int rv; - input_callback_state callback_state; - gboolean ok = TRUE; - backend *emitter; - - callback_state.input_stack = NULL; - callback_state.base_includes = NULL; - callback_state.include_path = include_path; - callback_state.already_included = g_hash_table_new(g_str_hash, g_str_equal); - - if (!callback_state.already_included) { - fprintf(stderr, "failed to create hashtable. out of memory?\n"); - return 0; } - state.basename = xpidl_strdup(filename); + return RTScriptLexCreateFromFile(phIdlLex, pszFilename, NULL /*phStrCacheId*/, + NULL /*phStrCacheStringLit*/, NULL /*phStrCacheComments*/, + &g_IdlLexCfg); +} - /* if basename has an .extension, truncate it. */ - tmp = strrchr(state.basename, '.'); - if (tmp) - *tmp = '\0'; - if (!file_basename) - outname = xpidl_strdup(state.basename); +static int xpidlParseError(PXPIDLPARSE pThis, PXPIDLINPUT pInput, PCRTSCRIPTLEXTOKEN pTok, int rc, const char *pszFmt, ...) +{ + RT_NOREF(pInput); + + va_list Args; + va_start(Args, pszFmt); + RT_NOREF(pTok); + rc = RTErrInfoSetV(&pThis->ErrInfo.Core, rc, pszFmt, Args); + va_end(Args); + return rc; +} + + +static int xpidlParseSkipComments(PXPIDLPARSE pThis, PXPIDLINPUT pInput, bool *pfRawBlock) +{ + for (;;) + { + PCRTSCRIPTLEXTOKEN pTok; + int rc = RTScriptLexQueryToken(pInput->hIdlLex, &pTok); + if (RT_FAILURE(rc)) + return xpidlParseError(pThis, pInput, pTok, rc, "Lexer: Failed to query string literal token with %Rrc", rc); + + if ( pTok->enmType != RTSCRIPTLEXTOKTYPE_COMMENT_SINGLE_LINE + && pTok->enmType != RTSCRIPTLEXTOKTYPE_COMMENT_MULTI_LINE) + return VINF_SUCCESS; + + /* Make sure we don't miss any %{C++ %} blocks. */ + if ( !strncmp(pTok->Type.Comment.pszComment, "%{C++", sizeof("%{C++") - 1) + || !strncmp(pTok->Type.Comment.pszComment, "%{ C++", sizeof("%{ C++") - 1)) + { + if (pfRawBlock) + *pfRawBlock = true; + return VINF_SUCCESS; + } + + RTScriptLexConsumeToken(pInput->hIdlLex); + } + + return VINF_SUCCESS; +} + + +static int xpidlLexerConsumeIfStringLit(PXPIDLPARSE pThis, PXPIDLINPUT pInput, const char **ppszStrLit) +{ + PCRTSCRIPTLEXTOKEN pTok; + int rc = RTScriptLexQueryToken(pInput->hIdlLex, &pTok); + if (RT_FAILURE(rc)) + return xpidlParseError(pThis, pInput, NULL /*pTok*/, rc, "Lexer: Failed to query string literal token with %Rrc", rc); + + if (pTok->enmType == RTSCRIPTLEXTOKTYPE_STRINGLIT) + { + *ppszStrLit = pTok->Type.StringLit.pszString; + RTScriptLexConsumeToken(pInput->hIdlLex); + return VINF_SUCCESS; + } + + return VINF_SUCCESS; +} + + +static int xpidlLexerConsumeIfKeyword(PXPIDLPARSE pThis, PXPIDLINPUT pInput, XPIDLKEYWORD enmKeyword, bool *pfConsumed) +{ + PCRTSCRIPTLEXTOKEN pTok; + int rc = RTScriptLexQueryToken(pInput->hIdlLex, &pTok); + if (RT_FAILURE(rc)) + return xpidlParseError(pThis, pInput, NULL, rc, "Lexer: Failed to query keyword token with %Rrc", rc); + + if ( pTok->enmType == RTSCRIPTLEXTOKTYPE_KEYWORD + && pTok->Type.Keyword.pKeyword->u64Val == (uint64_t)enmKeyword) + { + RTScriptLexConsumeToken(pInput->hIdlLex); + *pfConsumed = true; + return VINF_SUCCESS; + } + + *pfConsumed = false; + return VINF_SUCCESS; +} + + +static int xpidlLexerConsumeIfKeywordInList(PXPIDLPARSE pThis, PXPIDLINPUT pInput, + PCXPIDLKEYWORD paenmKeywords, PXPIDLKEYWORD penmKeyword) +{ + PCRTSCRIPTLEXTOKEN pTok; + int rc = RTScriptLexQueryToken(pInput->hIdlLex, &pTok); + if (RT_FAILURE(rc)) + return xpidlParseError(pThis, pInput, NULL, rc, "Lexer: Failed to query keyword token with %Rrc", rc); + + if (pTok->enmType == RTSCRIPTLEXTOKTYPE_KEYWORD) + { + unsigned i = 0; + do + { + if (pTok->Type.Keyword.pKeyword->u64Val == (uint64_t)paenmKeywords[i]) + { + RTScriptLexConsumeToken(pInput->hIdlLex); + *penmKeyword = paenmKeywords[i]; + return VINF_SUCCESS; + } + + i++; + } while (paenmKeywords[i] != kXpidlKeyword_Invalid); + } + + *penmKeyword = kXpidlKeyword_Invalid; + return VINF_SUCCESS; +} + + +static int xpidlLexerConsumeIfIdentifier(PXPIDLPARSE pThis, PXPIDLINPUT pInput, bool fAllowKeywords, const char **ppszIde) +{ + PCRTSCRIPTLEXTOKEN pTok; + int rc = RTScriptLexQueryToken(pInput->hIdlLex, &pTok); + if (RT_FAILURE(rc)) + return xpidlParseError(pThis, pInput, NULL, rc, "Lexer: Failed to query string literal token with %Rrc", rc); + + if (pTok->enmType == RTSCRIPTLEXTOKTYPE_IDENTIFIER) + { + *ppszIde = pTok->Type.Id.pszIde; + + /* + * HACK HACK HACK for UUIDs because they can start with digits but are not numbers. + * + * This must be done here before consuming the token because the lexer alwas peeks + * ahead and the format for UUIDs is 'uuid()' so activating this hack afterwards + * would make the lexer try to fill the next token with the wrong content (or most + * likely fail). + * + * This assumes that uuid will not be used standalone elsewhere in the attributes. + */ + if ( g_fParsingAttributes + && !strcmp(pTok->Type.Id.pszIde, "uuid")) + g_fRequiredUuid = true; + + RTScriptLexConsumeToken(pInput->hIdlLex); + return VINF_SUCCESS; + } + else if ( fAllowKeywords + && pTok->enmType == RTSCRIPTLEXTOKTYPE_KEYWORD) + { + *ppszIde = pTok->Type.Keyword.pKeyword->pszMatch; + RTScriptLexConsumeToken(pInput->hIdlLex); + return VINF_SUCCESS; + } + + return VINF_SUCCESS; +} + + +static int xpidlLexerConsumeIfPunctuator(PXPIDLPARSE pThis, PXPIDLINPUT pInput, + char chPunctuator, bool *pfConsumed) +{ + PCRTSCRIPTLEXTOKEN pTok; + int rc = RTScriptLexQueryToken(pInput->hIdlLex, &pTok); + if (RT_FAILURE(rc)) + return xpidlParseError(pThis, pInput, NULL, rc, "Lexer: Failed to query punctuator token with %Rrc", rc); + + if ( pTok->enmType == RTSCRIPTLEXTOKTYPE_PUNCTUATOR + && (char)pTok->Type.Keyword.pKeyword->u64Val == chPunctuator) + { + RTScriptLexConsumeToken(pInput->hIdlLex); + *pfConsumed = true; + return VINF_SUCCESS; + } + + *pfConsumed = false; + return VINF_SUCCESS; +} + + +static int xpidlLexerConsumeIfNatural(PXPIDLPARSE pThis, PXPIDLINPUT pInput, uint64_t *pu64, bool *pfConsumed) +{ + PCRTSCRIPTLEXTOKEN pTok; + int rc = RTScriptLexQueryToken(pInput->hIdlLex, &pTok); + if (RT_FAILURE(rc)) + return xpidlParseError(pThis, pInput, NULL, rc, "Lexer: Failed to query punctuator token with %Rrc", rc); + + if ( pTok->enmType == RTSCRIPTLEXTOKTYPE_NUMBER + && pTok->Type.Number.enmType == RTSCRIPTLEXTOKNUMTYPE_NATURAL) + { + *pfConsumed = true; + *pu64 = pTok->Type.Number.Type.u64; + RTScriptLexConsumeToken(pInput->hIdlLex); + return VINF_SUCCESS; + } + + *pfConsumed = false; + return VINF_SUCCESS; +} + +/* Some parser helper macros. */ +#define XPIDL_PARSE_STRING_LIT(a_pszStrLit) \ + const char *a_pszStrLit = NULL; \ + do { \ + int rc2 = xpidlLexerConsumeIfStringLit(pThis, pInput, &a_pszStrLit); \ + if (RT_FAILURE(rc2)) \ + return rc2; \ + if (!a_pszStrLit) \ + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, "Parser: Expected a string literal"); \ + } while(0) + + +#define XPIDL_PARSE_KEYWORD(a_enmKeyword, a_pszKeyword) \ + do { \ + bool fConsumed2 = false; \ + int rc2 = xpidlLexerConsumeIfKeyword(pThis, pInput, a_enmKeyword, &fConsumed2); \ + if (RT_FAILURE(rc2)) \ + return rc2; \ + if (!fConsumed2) \ + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, "Parser: Expected keyword '%s'", a_pszKeyword); \ + } while(0) + + +#define XPIDL_PARSE_OPTIONAL_KEYWORD(a_fConsumed, a_enmKeyword) \ + bool a_fConsumed = false; \ + do { \ + int rc2 = xpidlLexerConsumeIfKeyword(pThis, pInput, a_enmKeyword, &a_fConsumed); \ + if (RT_FAILURE(rc2)) \ + return rc2; \ + } while(0) + + +#define XPIDL_PARSE_OPTIONAL_KEYWORD_LIST(a_enmKeyword, a_aenmKeywordList, a_enmDefault) \ + XPIDLKEYWORD a_enmKeyword = kXpidlKeyword_Invalid; \ + do { \ + int rc2 = xpidlLexerConsumeIfKeywordInList(pThis, pInput, a_aenmKeywordList, &a_enmKeyword); \ + if (RT_FAILURE(rc2)) \ + return rc2; \ + if (a_enmKeyword == kXpidlKeyword_Invalid) \ + a_enmKeyword = a_enmDefault; \ + } while(0) + + +#define XPIDL_PARSE_KEYWORD_LIST(a_enmKeyword, a_aenmKeywordList) \ + XPIDLKEYWORD a_enmKeyword = kXpidlKeyword_Invalid; \ + do { \ + int rc2 = xpidlLexerConsumeIfKeywordInList(pThis, pInput, a_aenmKeywordList, &a_enmKeyword); \ + if (RT_FAILURE(rc2)) \ + return rc2; \ + if (a_enmKeyword == kXpidlKeyword_Invalid) \ + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, "Parser: Unexpected keyword found"); \ + } while(0) + + +#define XPIDL_PARSE_IDENTIFIER(a_pszIde) \ + const char *a_pszIde = NULL; \ + do { \ + int rc2 = xpidlLexerConsumeIfIdentifier(pThis, pInput, false /*fAllowKeywords*/, &a_pszIde); \ + if (RT_FAILURE(rc2)) \ + return rc2; \ + if (!a_pszIde) \ + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, "Parser: Expected an identifier"); \ + } while(0) + + +#define XPIDL_PARSE_IDENTIFIER_ALLOW_KEYWORDS(a_pszIde) \ + const char *a_pszIde = NULL; \ + do { \ + int rc2 = xpidlLexerConsumeIfIdentifier(pThis, pInput, true /*fAllowKeywords*/, &a_pszIde); \ + if (RT_FAILURE(rc2)) \ + return rc2; \ + if (!a_pszIde) \ + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, "Parser: Expected an identifier"); \ + } while(0) + + +#define XPIDL_PARSE_IDENTIFIER_EXT(a_pszIde) \ + do { \ + int rc2 = xpidlLexerConsumeIfIdentifier(pThis, pInput, false /*fAllowKeywords*/, &a_pszIde); \ + if (RT_FAILURE(rc2)) \ + return rc2; \ + if (!a_pszIde) \ + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, "Parser: Expected an identifier"); \ + } while(0) + + +#define XPIDL_PARSE_PUNCTUATOR(a_chPunctuator) \ + do { \ + bool fConsumed2 = false; \ + int rc2 = xpidlLexerConsumeIfPunctuator(pThis, pInput, a_chPunctuator, &fConsumed2); \ + if (RT_FAILURE(rc2)) \ + return rc2; \ + if (!fConsumed2) \ + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, "Parser: Expected punctuator '%c'", a_chPunctuator); \ + } while(0) + + +#define XPIDL_PARSE_OPTIONAL_PUNCTUATOR(a_fConsumed, a_chPunctuator) \ + do { \ + int rc2 = xpidlLexerConsumeIfPunctuator(pThis, pInput, a_chPunctuator, &a_fConsumed); \ + if (RT_FAILURE(rc2)) \ + return rc2; \ + } while(0) + + +#define XPIDL_PARSE_NATURAL(a_u64) \ + uint64_t a_u64 = 0; \ + do { \ + bool fConsumed2 = false; \ + int rc2 = xpidlLexerConsumeIfNatural(pThis, pInput, &a_u64, &fConsumed2); \ + if (RT_FAILURE(rc2)) \ + return rc2; \ + if (!fConsumed2) \ + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, "Parser: Expected a natural number"); \ + } while(0) + + +static PXPIDLINPUT xpidlInputCreate(const char *pszFilename, PRTLISTANCHOR pLstIncludePaths) +{ + RTSCRIPTLEX hIdlLex = NULL; + int rc = xpidlCreateLexerFromFilename(pszFilename, pLstIncludePaths, &hIdlLex); + if (RT_FAILURE(rc)) + return NULL; + + PXPIDLINPUT pInput = (PXPIDLINPUT)xpidl_malloc(sizeof (*pInput)); + if (!pInput) + { + RTScriptLexDestroy(hIdlLex); + return NULL; + } + + RTListInit(&pInput->LstIncludes); + pInput->hIdlLex = hIdlLex; + pInput->pszFilename = xpidl_strdup(pszFilename); + pInput->pszBasename = RTPathFilename(pInput->pszFilename); + return pInput; +} + + +static PXPIDLNODE xpidlNodeCreateWithAttrs(PXPIDLPARSE pThis, PXPIDLNODE pParent, PXPIDLINPUT pInput, XPIDLNDTYPE enmType, + PXPIDLATTR paAttrs, uint32_t cAttrs) +{ + PXPIDLNODE pNode = (PXPIDLNODE)RTMemAllocZ(RT_UOFFSETOF_DYN(XPIDLNODE, aAttrs[cAttrs])); + if (pNode) + { + pNode->pParent = pParent; + pNode->pInput = pInput; + pNode->enmType = enmType; + pNode->cAttrs = cAttrs; + switch (enmType) + { + case kXpidlNdType_Interface_Def: + RTListInit(&pNode->u.If.LstBody); + break; + case kXpidlNdType_Method: + RTListInit(&pNode->u.Method.LstParams); + break; + default: + break; + } + + if (cAttrs) + memcpy(&pNode->aAttrs[0], &paAttrs[0], cAttrs * sizeof(pThis->aAttrs[0])); + } else - outname = xpidl_strdup(file_basename); + xpidlParseError(pThis, pInput, NULL, VERR_NO_MEMORY, "Failed to allocate node of type %u\n", enmType); - /* so we don't include it again! */ - g_hash_table_insert(callback_state.already_included, - xpidl_strdup(filename), (void *)TRUE); + return pNode; +} - parsed_empty_file = FALSE; - rv = IDL_parse_filename_with_input(filename, input_callback, &callback_state, - msg_callback, &top, - &state.ns, - IDLF_IGNORE_FORWARDS | - IDLF_XPIDL, - enable_warnings ? IDL_WARNING1 : - IDL_ERROR); - if (parsed_empty_file) { - /* - * If we've detected (via hack in msg_callback) that libIDL returned - * failure because it found a file with no IDL, set the parse tree to - * null and proceed. Allowing this is useful to permit .idl files that - * collect #includes. - */ - top = NULL; - state.ns = NULL; - } else if (rv != IDL_SUCCESS) { - if (rv == -1) { - g_warning("Parse of %s failed: %s", filename, g_strerror(errno)); - } else { - g_warning("Parse of %s failed", filename); +static PXPIDLNODE xpidlNodeCreate(PXPIDLPARSE pThis, PXPIDLNODE pParent, PXPIDLINPUT pInput, XPIDLNDTYPE enmType) +{ + return xpidlNodeCreateWithAttrs(pThis, pParent, pInput, enmType, NULL /*paAttrs*/, 0 /*cAttrs*/); +} + + +static PCXPIDLNODE xpidlParseFindType(PXPIDLPARSE pThis, const char *pszName) +{ + PCXPIDLNODE pIfFwd = NULL; + PCXPIDLNODE pIt; + RTListForEach(&pThis->LstNodes, pIt, XPIDLNODE, NdLst) + { + switch (pIt->enmType) + { + case kXpidlNdType_Typedef: + if (!strcmp(pszName, pIt->u.Typedef.pszName)) + return pIt; + break; + case kXpidlNdType_Native: + if (!strcmp(pszName, pIt->u.Native.pszName)) + return pIt; + break; + case kXpidlNdType_Interface_Forward_Decl: + if (!strcmp(pszName, pIt->u.pszIfFwdName)) + pIfFwd = pIt; /* We will try finding the real definition before returning the forward declaration. */ + break; + case kXpidlNdType_Interface_Def: + if (!strcmp(pszName, pIt->u.If.pszIfName)) + return pIt; + break; + default: + break; } - free(outname); - return 0; } - state.basename = xpidl_strdup(filename); - tmp = strrchr(state.basename, '.'); - if (tmp) - *tmp = '\0'; + return pIfFwd; +} - /* so xpidl_header.c can use it to generate a list of #include directives */ - state.base_includes = callback_state.base_includes; - emitter = mode->factory(); - state.dispatch = emitter->dispatch_table; +static int xpidlParseAttributes(PXPIDLPARSE pThis, PXPIDLINPUT pInput, PXPIDLATTR paAttrs, uint32_t cAttrsMax, uint32_t *pcAttrs) +{ + g_fParsingAttributes = true; + uint32_t cAttrs = 0; + for (;;) + { + bool fConsumed = false; + const char *pszVal = NULL; - if (strcmp(outname, "-")) { - const char *fopen_mode; - char *out_basename; + XPIDL_PARSE_IDENTIFIER_ALLOW_KEYWORDS(pszAttr); /* For const for example. */ + XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, '('); + if (fConsumed) + { + XPIDL_PARSE_IDENTIFIER_EXT(pszVal); + g_fRequiredUuid = false; + XPIDL_PARSE_PUNCTUATOR(')'); + } - /* explicit_output_filename can't be true without a filename */ - if (explicit_output_filename) { - real_outname = g_strdup(outname); - } else { + if (cAttrs == cAttrsMax) + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, + "Too many attributes in attributes list, maximum is %u", cAttrsMax); - if (!file_basename) { - out_basename = xpidl_basename(outname); - } else { - out_basename = outname; + paAttrs[cAttrs].pszName = pszAttr; + paAttrs[cAttrs].pszVal = pszVal; + cAttrs++; + + /* No ',' means end of attribute list. */ + XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, ','); + if (!fConsumed) + break; + } + *pcAttrs = cAttrs; + g_fParsingAttributes = false; + + XPIDL_PARSE_PUNCTUATOR(']'); + return VINF_SUCCESS; +} + + +static int xpidlParseTypeSpec(PXPIDLPARSE pThis, PXPIDLINPUT pInput, PXPIDLNODE *ppNode) +{ + /* Need a keyword or an identifier. */ + static const XPIDLKEYWORD g_aenmTypeKeywordsStart[] = + { + kXpidlKeyword_Void, + kXpidlKeyword_Char, + kXpidlKeyword_Wide_Char, + kXpidlKeyword_Unsigned, + kXpidlKeyword_Long, + kXpidlKeyword_Short, + kXpidlKeyword_Boolean, + kXpidlKeyword_Octet, + kXpidlKeyword_String, + kXpidlKeyword_Wide_String, + kXpidlKeyword_Double, + kXpidlKeyword_Float, + kXpidlKeyword_Invalid + }; + + int rc = VINF_SUCCESS; + XPIDL_PARSE_OPTIONAL_KEYWORD_LIST(enmType, g_aenmTypeKeywordsStart, kXpidlKeyword_Invalid); + if (enmType != kXpidlKeyword_Invalid) + { + XPIDLTYPE enmBaseType = kXpidlType_Invalid; + + /* Unsigned, and long has more to follow. */ + switch (enmType) + { + case kXpidlKeyword_Void: + enmBaseType = kXpidlType_Void; + break; + case kXpidlKeyword_Char: + enmBaseType = kXpidlType_Char; + break; + case kXpidlKeyword_Wide_Char: + enmBaseType = kXpidlType_Wide_Char; + break; + case kXpidlKeyword_Unsigned: + { + /* + * Possibilities: + * unsigned short + * unsigned long + * unsigned long long + */ + static const XPIDLKEYWORD g_aenmUnsignedKeywords[] = + { + kXpidlKeyword_Long, + kXpidlKeyword_Short, + kXpidlKeyword_Invalid + }; + + XPIDL_PARSE_KEYWORD_LIST(enmUnsignedType, g_aenmUnsignedKeywords); + switch (enmUnsignedType) + { + case kXpidlKeyword_Long: + { + /* Another long following? */ + XPIDL_PARSE_OPTIONAL_KEYWORD(fConsumed, kXpidlKeyword_Long); + if (fConsumed) + enmBaseType = kXpidlType_Unsigned_Long_Long; + else + enmBaseType = kXpidlType_Unsigned_Long; + break; + } + case kXpidlKeyword_Short: + enmBaseType = kXpidlType_Unsigned_Short; + break; + default: + AssertReleaseFailed(); /* Impossible */ + } + break; + } + case kXpidlKeyword_Long: + { + /* Another long can follow. */ + XPIDL_PARSE_OPTIONAL_KEYWORD(fConsumed, kXpidlKeyword_Long); + if (fConsumed) + enmBaseType = kXpidlType_Long_Long; + else + enmBaseType = kXpidlType_Long; + break; + } + case kXpidlKeyword_Short: + enmBaseType = kXpidlType_Short; + break; + case kXpidlKeyword_Boolean: + enmBaseType = kXpidlType_Boolean; + break; + case kXpidlKeyword_Octet: + enmBaseType = kXpidlType_Octet; + break; + case kXpidlKeyword_String: + enmBaseType = kXpidlType_String; + break; + case kXpidlKeyword_Wide_String: + enmBaseType = kXpidlType_Wide_String; + break; + case kXpidlKeyword_Double: + enmBaseType = kXpidlType_Double; + break; + case kXpidlKeyword_Float: + enmBaseType = kXpidlType_Float; + break; + default: + AssertReleaseFailed(); + } + + PXPIDLNODE pNode = xpidlNodeCreate(pThis, NULL, pInput, kXpidlNdType_BaseType); + if (pNode) + { + pNode->u.enmBaseType = enmBaseType; + *ppNode = pNode; + } + else + rc = VERR_NO_MEMORY; + } + else + { + /* Identifier */ + XPIDL_PARSE_IDENTIFIER(pszName); + PCXPIDLNODE pNdTypeRef = xpidlParseFindType(pThis, pszName); + if (!pNdTypeRef) + return xpidlParseError(pThis, pInput, NULL, VERR_NOT_FOUND, "Unknown referenced type '%s'\n", pszName); + + PXPIDLNODE pNode = xpidlNodeCreate(pThis, NULL, pInput, kXpidlNdType_Identifier); + if (pNode) + { + /* Try resolving the referenced type. */ + pNode->pNdTypeRef = pNdTypeRef; + pNode->u.pszIde = pszName; + *ppNode = pNode; + } + else + rc = VERR_NO_MEMORY; + } + + return rc; +} + + +static int xpidlParseConst(PXPIDLPARSE pThis, PXPIDLINPUT pInput, PXPIDLNODE pNdIf) +{ + int rc; + PXPIDLNODE pNdConst = xpidlNodeCreate(pThis, pNdIf, pInput, kXpidlNdType_Const); + if (pNdConst) + { + RTListAppend(&pNdIf->u.If.LstBody, &pNdConst->NdLst); + + PXPIDLNODE pNdTypeSpec = NULL; + rc = xpidlParseTypeSpec(pThis, pInput, &pNdTypeSpec); + if (RT_FAILURE(rc)) + return rc; + pNdConst->u.Const.pNdTypeSpec = pNdTypeSpec; + + XPIDL_PARSE_IDENTIFIER(pszName); /* The parameter name is always required. */ + pNdConst->u.Const.pszName = pszName; + + XPIDL_PARSE_PUNCTUATOR('='); + XPIDL_PARSE_NATURAL(u64); + pNdConst->u.Const.u64Const = u64; + } + else + rc = VERR_NO_MEMORY; + + return rc; +} + + +static int xpidlParseAttribute(PXPIDLPARSE pThis, PXPIDLINPUT pInput, PXPIDLNODE pNdIf, bool fReadonly) +{ + int rc; + PXPIDLNODE pNdConst = xpidlNodeCreateWithAttrs(pThis, pNdIf, pInput, kXpidlNdType_Attribute, + &pThis->aAttrs[0], pThis->cAttrs); + if (pNdConst) + { + pThis->cAttrs = 0; + RTListAppend(&pNdIf->u.If.LstBody, &pNdConst->NdLst); + + PXPIDLNODE pNdTypeSpec = NULL; + rc = xpidlParseTypeSpec(pThis, pInput, &pNdTypeSpec); + if (RT_FAILURE(rc)) + return rc; + pNdConst->u.Attribute.pNdTypeSpec = pNdTypeSpec; + + XPIDL_PARSE_IDENTIFIER(pszName); /* The parameter name is always required. */ + pNdConst->u.Attribute.pszName = pszName; + pNdConst->u.Attribute.fReadonly = fReadonly; + } + else + rc = VERR_NO_MEMORY; + + return rc; +} + + +static int xpidlParseMethodParameters(PXPIDLPARSE pThis, PXPIDLINPUT pInput, PXPIDLNODE pNdMethod) +{ + for (;;) + { + /* Each parameter can have an attribute list. */ + bool fConsumed = false; + XPIDLATTR aAttrs[32]; + uint32_t cAttrs = 0; + + XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, '['); + if (fConsumed) + { + int rc = xpidlParseAttributes(pThis, pInput, &aAttrs[0], RT_ELEMENTS(aAttrs), &cAttrs); + if (RT_FAILURE(rc)) + return rc; + } + + /* Direction specifier. */ + static const XPIDLKEYWORD g_aenmDirectionKeywords[] = + { + kXpidlKeyword_In, + kXpidlKeyword_InOut, + kXpidlKeyword_Out, + kXpidlKeyword_Invalid + }; + XPIDL_PARSE_KEYWORD_LIST(enmDirection, g_aenmDirectionKeywords); + + PXPIDLNODE pNdParam = xpidlNodeCreateWithAttrs(pThis, pNdMethod, pInput, kXpidlNdType_Parameter, + &aAttrs[0], cAttrs); + if (pNdParam) + { + RTListAppend(&pNdMethod->u.Method.LstParams, &pNdParam->NdLst); + + PXPIDLNODE pNdTypeSpec = NULL; + int rc = xpidlParseTypeSpec(pThis, pInput, &pNdTypeSpec); + if (RT_FAILURE(rc)) + return rc; + pNdTypeSpec->pParent = pNdParam; + pNdParam->u.Param.pNdTypeSpec = pNdTypeSpec; + + XPIDL_PARSE_IDENTIFIER(pszName); /* The parameter name is always required. */ + pNdParam->u.Param.pszName = pszName; + switch (enmDirection) + { + case kXpidlKeyword_In: + pNdParam->u.Param.enmDir = kXpidlDirection_In; + break; + case kXpidlKeyword_InOut: + pNdParam->u.Param.enmDir = kXpidlDirection_InOut; + break; + case kXpidlKeyword_Out: + pNdParam->u.Param.enmDir = kXpidlDirection_Out; + break; + default: + AssertReleaseFailed(); /* Impossible */ + } + } + else + return VERR_NO_MEMORY; + + /* No ',' means end of attribute list. */ + XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, ','); + if (!fConsumed) + break; + } + + XPIDL_PARSE_PUNCTUATOR(')'); + return VINF_SUCCESS; +} + + +static int xpidlParseInterfaceBody(PXPIDLPARSE pThis, PXPIDLINPUT pInput, PXPIDLNODE pNdIf) +{ + for (;;) + { + bool fRawBlock = false; + int rc = xpidlParseSkipComments(pThis, pInput, &fRawBlock); + if (RT_FAILURE(rc)) + return rc; + + if (fRawBlock) + { + PCRTSCRIPTLEXTOKEN pTok; + rc = RTScriptLexQueryToken(pInput->hIdlLex, &pTok); + if (RT_FAILURE(rc)) + return xpidlParseError(pThis, pInput, NULL, rc, "Parser: Failed to query punctuator token with %Rrc", rc); + + size_t cchIntro = !strncmp(pTok->Type.Comment.pszComment, "%{C++", sizeof("%{C++") - 1) + ? 6 /* Assumes a newline after %{C++ */ + : 7; /* Assumes a newline after %{C++ */ + /* Create a new raw block node. */ + PXPIDLNODE pNode = xpidlNodeCreate(pThis, NULL, pInput, kXpidlNdType_RawBlock); + if (pNode) + { + pNode->u.RawBlock.pszRaw = pTok->Type.Comment.pszComment + cchIntro; + pNode->u.RawBlock.cchRaw = pTok->Type.Comment.cchComment - (cchIntro + 2 + 1); /* Start + end + zero terminator. */ + RTScriptLexConsumeToken(pInput->hIdlLex); + RTListAppend(&pNdIf->u.If.LstBody, &pNode->NdLst); + } + else + return xpidlParseError(pThis, pInput, pTok, VERR_NO_MEMORY, "Parser: Failed to allocate memory for raw block AST node"); + } + + /* A closing '}' means we reached the end of the interface body. */ + bool fConsumed = false; + XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, '}'); + if (fConsumed) + break; + + XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, '['); + if (fConsumed) + { + if (pThis->cAttrs) + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, + "Start of attribute list directly after an existing attribute list"); + + rc = xpidlParseAttributes(pThis, pInput, &pThis->aAttrs[0], RT_ELEMENTS(pThis->aAttrs), &pThis->cAttrs); + } + if (RT_FAILURE(rc)) + break; + + /* + * Select one of the following possibilities: + * readonly attribute ; + * attribute ; + * const = ; + * (...); + */ + static const XPIDLKEYWORD g_aenmBodyKeywords[] = + { + kXpidlKeyword_Readonly, + kXpidlKeyword_Attribute, + kXpidlKeyword_Const, + kXpidlKeyword_Invalid + }; + + XPIDL_PARSE_OPTIONAL_KEYWORD_LIST(enmStart, g_aenmBodyKeywords, kXpidlKeyword_Invalid); + if (enmStart != kXpidlKeyword_Invalid) + { + if (enmStart == kXpidlKeyword_Const) + rc = xpidlParseConst(pThis, pInput, pNdIf); + else if (enmStart == kXpidlKeyword_Readonly) + { + XPIDL_PARSE_KEYWORD(kXpidlKeyword_Attribute, "attribute"); + rc = xpidlParseAttribute(pThis, pInput, pNdIf, true /*fReadonly*/); + } + else + { + Assert(enmStart == kXpidlKeyword_Attribute); + rc = xpidlParseAttribute(pThis, pInput, pNdIf, false /*fReadonly*/); + } + } + else + { + /* We need to parse a type spec. */ + PXPIDLNODE pNdRetType = NULL; + + rc = xpidlParseTypeSpec(pThis, pInput, &pNdRetType); + if (RT_FAILURE(rc)) + return rc; + + PXPIDLNODE pNdMethod = xpidlNodeCreateWithAttrs(pThis, pNdIf, pInput, kXpidlNdType_Method, + &pThis->aAttrs[0], pThis->cAttrs); + if (pNdMethod) + { + pThis->cAttrs = 0; + RTListAppend(&pNdIf->u.If.LstBody, &pNdMethod->NdLst); + + pNdMethod->u.Method.pNdTypeSpecRet = pNdRetType; + XPIDL_PARSE_IDENTIFIER(pszName); /* The method name is always required. */ + pNdMethod->u.Method.pszName = pszName; + XPIDL_PARSE_PUNCTUATOR('('); + + XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, ')'); + if (!fConsumed) + { + /* Parse the parameter spec. */ + rc = xpidlParseMethodParameters(pThis, pInput, pNdMethod); + if (RT_FAILURE(rc)) + return rc; + } + } + else + return VERR_NO_MEMORY; + } + if (RT_FAILURE(rc)) + return rc; + + XPIDL_PARSE_PUNCTUATOR(';'); + } + + XPIDL_PARSE_PUNCTUATOR(';'); + return VINF_SUCCESS; +} + + +static int xpidlParseInterface(PXPIDLPARSE pThis, PXPIDLINPUT pInput, PXPIDLNODE pParent) +{ + /* + * We only support parsing a subset of what is actually possible: + * - Forward declarations + * - Actual interface definitions with at most a single parent inheriting from + */ + XPIDL_PARSE_IDENTIFIER(pszName); /* The interface name is always required. */ + bool fConsumed = false; + XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, ';'); + + int rc = VINF_SUCCESS; + if (!fConsumed) + { + const char *pszIfInherit = NULL; + XPIDL_PARSE_OPTIONAL_PUNCTUATOR(fConsumed, ':'); + if (fConsumed) + XPIDL_PARSE_IDENTIFIER_EXT(pszIfInherit); + XPIDL_PARSE_PUNCTUATOR('{'); + + PCXPIDLNODE pNdTypeRef = NULL; + if (pszIfInherit) + { + pNdTypeRef = xpidlParseFindType(pThis, pszIfInherit); + if (!pNdTypeRef) + return xpidlParseError(pThis, pInput, NULL, VERR_NOT_FOUND, "Unknown referenced type '%s'\n", pszName); + } + + /* Now for the fun part, parsing the body of the interface. */ + PXPIDLNODE pNode = xpidlNodeCreateWithAttrs(pThis, pParent, pInput, kXpidlNdType_Interface_Def, + &pThis->aAttrs[0], pThis->cAttrs); + if (pNode) + { + pThis->cAttrs = 0; + + pNode->pNdTypeRef = pNdTypeRef; + pNode->u.If.pszIfName = pszName; + pNode->u.If.pszIfInherit = pszIfInherit; + RTListAppend(&pThis->LstNodes, &pNode->NdLst); + + rc = xpidlParseInterfaceBody(pThis, pInput, pNode); + } + else + rc = VERR_NO_MEMORY; + + } + else + { + /* That was easy, just a forward declaration. */ + PXPIDLNODE pNode = xpidlNodeCreate(pThis, pParent, pInput, kXpidlNdType_Interface_Forward_Decl); + if (pNode) + { + pNode->u.pszIfFwdName = pszName; + RTListAppend(&pThis->LstNodes, &pNode->NdLst); + } + else + rc = VERR_NO_MEMORY; + } + + return rc; +} + + +static int xpidlParseKeyword(PXPIDLPARSE pThis, PXPIDLINPUT pInput, PXPIDLNODE pParent, PRTLISTANCHOR pLstIncludePaths, + PCRTSCRIPTLEXTOKMATCH pKeyword) +{ + RT_NOREF(pThis, pInput, pLstIncludePaths); + int rc = VINF_SUCCESS; + switch (pKeyword->u64Val) + { + case kXpidlKeyword_Include: + { + XPIDL_PARSE_STRING_LIT(pszFilename); + /* Check whether this was parsed already. */ + PCXPIDLINPUT pIt; + RTListForEach(&pThis->LstInputs, pIt, XPIDLINPUT, NdInput) + { + if (!strcmp(pIt->pszFilename, pszFilename)) + return VINF_SUCCESS; } - real_outname = g_strdup_printf("%s.%s", out_basename, mode->suffix); - if (out_basename != outname) - g_free(out_basename); + PXPIDLINPUT pInputNew = xpidlInputCreate(pszFilename, pLstIncludePaths); + if (!pInputNew) + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, "Failed opening include file '%s'", + pszFilename); + + RTListAppend(&pInput->LstIncludes, &pInputNew->NdInclude); + RTListAppend(&pThis->LstInputs, &pInputNew->NdInput); + rc = xpidlParseIdl(pThis, pInputNew, pLstIncludePaths); + break; } + case kXpidlKeyword_Typedef: + { + PXPIDLNODE pNdTypeSpec = NULL; + rc = xpidlParseTypeSpec(pThis, pInput, &pNdTypeSpec); + if (RT_FAILURE(rc)) + break; + XPIDL_PARSE_IDENTIFIER(pszName); + XPIDL_PARSE_PUNCTUATOR(';'); - /* Use binary write for typelib mode */ - fopen_mode = (strcmp(mode->mode, "typelib")) ? "w" : "wb"; - state.file = fopen(real_outname, fopen_mode); - if (!state.file) { - perror("error opening output file"); - free(outname); - return 0; + PXPIDLNODE pNode = xpidlNodeCreate(pThis, pParent, pInput, kXpidlNdType_Typedef); + if (pNode) + { + pNdTypeSpec->pParent = pNode; + + pNode->u.Typedef.pNodeTypeSpec = pNdTypeSpec; + pNode->u.Typedef.pszName = pszName; + RTListAppend(&pThis->LstNodes, &pNode->NdLst); + } + else + rc = VERR_NO_MEMORY; + break; } - } else { - state.file = stdout; + case kXpidlKeyword_Native: + { + XPIDL_PARSE_IDENTIFIER(pszName); + XPIDL_PARSE_PUNCTUATOR('('); + XPIDL_PARSE_IDENTIFIER_ALLOW_KEYWORDS(pszNative); /* char is a keyword but also allowed */ + XPIDL_PARSE_PUNCTUATOR(')'); + XPIDL_PARSE_PUNCTUATOR(';'); + + PXPIDLNODE pNode = xpidlNodeCreateWithAttrs(pThis, pParent, pInput, kXpidlNdType_Native, + &pThis->aAttrs[0], pThis->cAttrs); + if (pNode) + { + pThis->cAttrs = 0; + + pNode->u.Native.pszName = pszName; + pNode->u.Native.pszNative = pszNative; + RTListAppend(&pThis->LstNodes, &pNode->NdLst); + } + else + rc = VERR_NO_MEMORY; + break; + } + case kXpidlKeyword_Interface: + rc = xpidlParseInterface(pThis, pInput, pParent); + break; + default: + rc = xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, "Unexpected keyword '%s' found", + pKeyword->pszMatch); } - state.tree = top; -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - state.real_outname = real_outname; -#endif - - if (emitter->emit_prolog) - emitter->emit_prolog(&state); - if (state.tree) /* Only if we have a tree to process. */ - ok = xpidl_process_node(&state); - if (emitter->emit_epilog) - emitter->emit_epilog(&state); - - if (state.file != stdout) - fclose(state.file); - free(state.basename); - free(outname); - g_hash_table_foreach(callback_state.already_included, free_ghash_key, NULL); - g_hash_table_destroy(callback_state.already_included); - g_slist_foreach(callback_state.base_includes, free_gslist_data, NULL); - - if (state.ns) - IDL_ns_free(state.ns); - if (top) - IDL_tree_free(top); - - if (real_outname != NULL) { - /* - * Delete partial output file on failure. (Mac does this in the plugin - * driver code, if the compiler returns failure.) - */ - if (!ok) - unlink(real_outname); - - g_free(real_outname); - } - - return ok; + return rc; +} + + +static int xpidlParseIdl(PXPIDLPARSE pThis, PXPIDLINPUT pInput, PRTLISTANCHOR pLstIncludePaths) +{ + /* Parse IDL file. */ + int rc; + for (;;) + { + PCRTSCRIPTLEXTOKEN pTok; + rc = RTScriptLexQueryToken(pInput->hIdlLex, &pTok); + if (RT_FAILURE(rc)) + return xpidlParseError(pThis, pInput, NULL, rc, "Parser: Failed to query next token with %Rrc", rc); + + if (pTok->enmType == RTSCRIPTLEXTOKTYPE_EOS) + break; + + /* + * In this outer loop we can either get comments, keywords or [] for + * attributes of following nodes. + */ + switch (pTok->enmType) + { + case RTSCRIPTLEXTOKTYPE_COMMENT_SINGLE_LINE: + RTScriptLexConsumeToken(pInput->hIdlLex); /* These get ignored entirely. */ + break; + case RTSCRIPTLEXTOKTYPE_COMMENT_MULTI_LINE: + { + /* Could be a raw block, check that the string starts with %{C++. */ + if ( !strncmp(pTok->Type.Comment.pszComment, "%{C++", sizeof("%{C++") - 1) + || !strncmp(pTok->Type.Comment.pszComment, "%{ C++", sizeof("%{ C++") - 1)) + { + size_t cchIntro = !strncmp(pTok->Type.Comment.pszComment, "%{C++", sizeof("%{C++") - 1) + ? 6 /* Assumes a newline after %{C++ */ + : 7; /* Assumes a newline after %{C++ */ + /* Create a new raw block node. */ + PXPIDLNODE pNode = xpidlNodeCreate(pThis, NULL, pInput, kXpidlNdType_RawBlock); + if (pNode) + { + pNode->u.RawBlock.pszRaw = pTok->Type.Comment.pszComment + cchIntro; + pNode->u.RawBlock.cchRaw = pTok->Type.Comment.cchComment - (cchIntro + 2 + 1); /* Start + end + zero terminator. */ + RTListAppend(&pThis->LstNodes, &pNode->NdLst); + } + else + rc = VERR_NO_MEMORY; + } + /* else: Regular multi line comment, gets ignored. */ + RTScriptLexConsumeToken(pInput->hIdlLex); + break; + } + case RTSCRIPTLEXTOKTYPE_KEYWORD: + { + PCRTSCRIPTLEXTOKMATCH pKeyword = pTok->Type.Keyword.pKeyword; + RTScriptLexConsumeToken(pInput->hIdlLex); + rc = xpidlParseKeyword(pThis, pInput, NULL, pLstIncludePaths, pKeyword); /** @todo This allows too much */ + break; + } + case RTSCRIPTLEXTOKTYPE_PUNCTUATOR: + { + if (pTok->Type.Punctuator.pPunctuator->u64Val == '[') + { + RTScriptLexConsumeToken(pInput->hIdlLex); + + if (pThis->cAttrs) + return xpidlParseError(pThis, pInput, NULL, VERR_INVALID_PARAMETER, + "Start of attribute list directly after an existing attribute list"); + + rc = xpidlParseAttributes(pThis, pInput, &pThis->aAttrs[0], RT_ELEMENTS(pThis->aAttrs), &pThis->cAttrs); + } + else + rc = xpidlParseError(pThis, pInput, pTok, VERR_INVALID_PARAMETER, "Unexpected punctuator found, expected '[', got '%c'", + (char)pTok->Type.Punctuator.pPunctuator->u64Val); + break; + } + case RTSCRIPTLEXTOKTYPE_ERROR: + rc = xpidlParseError(pThis, pInput, pTok, VERR_INTERNAL_ERROR, "Internal lexer error: %s", pTok->Type.Error.pErr->pszMsg); + break; + default: + rc = xpidlParseError(pThis, pInput, pTok, VERR_INVALID_PARAMETER, "Unexpected keyword found, expected raw block, keyword or '['"); + break; + } + + if (RT_FAILURE(rc)) + break; + } + + return rc; +} + + +int xpidl_process_idl(char *filename, PRTLISTANCHOR pLstIncludePaths, + char *file_basename, ModeData *mode) +{ + XPIDLPARSE ParseState; + RTListInit(&ParseState.LstInputs); + RTListInit(&ParseState.LstNodes); + RTErrInfoInitStatic(&ParseState.ErrInfo); + ParseState.cAttrs = 0; + + PXPIDLINPUT pInput = xpidlInputCreate(filename, pLstIncludePaths); + if (!pInput) + return VERR_NO_MEMORY; + + RTListAppend(&ParseState.LstInputs, &pInput->NdInput); + int rc = xpidlParseIdl(&ParseState, pInput, pLstIncludePaths); + if (RT_SUCCESS(rc)) + { + char *tmp, *outname, *real_outname = NULL; + + pInput->pszBasename = xpidl_strdup(filename); + + /* if basename has an .extension, truncate it. */ + tmp = strrchr(pInput->pszBasename, '.'); + if (tmp) + *tmp = '\0'; + + if (!file_basename) + outname = xpidl_strdup(pInput->pszBasename); + else + outname = xpidl_strdup(file_basename); + + FILE *pFile = NULL; + if (strcmp(outname, "-")) + { + const char *fopen_mode; + char *out_basename; + + /* explicit_output_filename can't be true without a filename */ + if (explicit_output_filename) { + real_outname = xpidl_strdup(outname); + } else { + + if (!file_basename) { + out_basename = RTPathFilename(outname); + } else { + out_basename = outname; + } + + rc = RTStrAPrintf(&real_outname, "%s.%s", out_basename, mode->suffix); + if (RT_FAILURE(rc)) + return rc; + + if (out_basename != outname) + free(out_basename); + } + + /* Use binary write for typelib mode */ + fopen_mode = (strcmp(mode->mode, "typelib")) ? "w" : "wb"; + pFile = fopen(real_outname, fopen_mode); + if (!pFile) { + perror("error opening output file"); + free(outname); + return VERR_INVALID_PARAMETER; + } + } + else + pFile = stdout; + + rc = mode->dispatch(pFile, pInput, &ParseState, &ParseState.ErrInfo.Core); + + if (pFile != stdout) + fclose(pFile); + free(outname); + } + + if (RT_FAILURE(rc)) + RTMsgError(ParseState.ErrInfo.Core.pszMsg); + + return rc; } diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_java.c b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_java.c deleted file mode 100644 index 4f708027..00000000 --- a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_java.c +++ /dev/null @@ -1,1053 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Sun Microsystems, - * Inc. Portions created by Sun are - * Copyright (C) 1999 Sun Microsystems, Inc. All - * Rights Reserved. - * - * Contributor(s): - * Michael Allen (michael.allen@sun.com) - * Frank Mitchell (frank.mitchell@sun.com) - */ - -/* - * Generate Java interfaces from XPIDL. - */ - -#include "xpidl.h" -#include -#include - - -struct java_priv_data { - GHashTable *typedefTable; -}; - -#define TYPEDEFS(state) (((struct java_priv_data *)state->priv)->typedefTable) - -static gboolean -write_classname_iid_define(FILE *file, const char *className) -{ - const char *iidName; - if (className[0] == 'n' && className[1] == 's') { - /* backcompat naming styles */ - fputs("NS_", file); - iidName = className + 2; - } else { - iidName = className; - } - - while (*iidName) { - fputc(toupper(*iidName++), file); - } - - fputs("_IID", file); - return TRUE; -} - -static gboolean -java_prolog(TreeState *state) -{ -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - const char *basename; - const char *ext; -#endif - - state->priv = calloc(1, sizeof(struct java_priv_data)); - if (!state->priv) - return FALSE; - TYPEDEFS(state) = 0; - TYPEDEFS(state) = g_hash_table_new(g_str_hash, g_str_equal); - if (!TYPEDEFS(state)) { - /* XXX report error */ - free(state->priv); - return FALSE; - } - - /* - * First pass - */ - -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - basename = xpidl_basename(state->real_outname ? state->real_outname : state->basename); - ext = strrchr(basename, '.'); - if (!ext) - ext = strchr(basename, '\0'); - fprintf(state->file, - "/**\n" - " * NOTE: THIS IS A GENERATED FILE. PLEASE CONSULT THE ORIGINAL IDL FILE\n" - " * FOR THE FULL DOCUMENTATION AND LICENSE.\n" - " *\n" - " * @see \n" - " **/\n" - "\n" - "package org.mozilla.interfaces;\n\n" - "import java.math.BigInteger;\n\n" - "\n" - , ext - basename >= 19 ? 19 : (int)(ext - basename), basename); - g_free(basename); -#else - fputs("/*\n * ************* DO NOT EDIT THIS FILE ***********\n", - state->file); - - fprintf(state->file, - " *\n * This file was automatically generated from %s.idl.\n", - state->basename); - - fputs(" */\n\n", state->file); -#endif - - return TRUE; -} - -static gboolean -java_epilog(TreeState *state) -{ - /* points to other elements of the tree, so just destroy the table */ - g_hash_table_destroy(TYPEDEFS(state)); - free(state->priv); - state->priv = NULL; - -#ifndef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - /* - * Last pass - */ - - fprintf(state->file, "\n/*\n * end\n */\n"); -#endif - - return TRUE; -} - -static gboolean -forward_declaration(TreeState *state) -{ - /* - * Java doesn't need forward declarations unless the declared - * class resides in a different package. - */ -#if 0 - IDL_tree iface = state->tree; - const char *className = IDL_IDENT(IDL_FORWARD_DCL(iface).ident).str; - const char *pkgName = "org.mozilla.xpcom"; - if (!className) - return FALSE; - /* XXX: Get package name and compare */ - fprintf(state->file, "import %s.%s;\n", pkgName, className); -#endif - return TRUE; -} - - -static gboolean -interface_declaration(TreeState *state) -{ - IDL_tree interface = state->tree; - IDL_tree iterator = NULL; - char *interface_name = IDL_IDENT(IDL_INTERFACE(interface).ident).str; - const char *iid = NULL; - - if (!verify_interface_declaration(interface)) - return FALSE; -#ifndef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - /* - * Write out JavaDoc comment - */ - - fprintf(state->file, "\n/**\n * Interface %s\n", interface_name); -#endif - -#ifndef LIBIDL_MAJOR_VERSION - iid = IDL_tree_property_get(interface, "uuid"); -#else - iid = IDL_tree_property_get(IDL_INTERFACE(interface).ident, "uuid"); -#endif - -#ifndef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - if (iid != NULL) { - fprintf(state->file, " *\n * IID: 0x%s\n */\n\n", iid); - } else { - fputs(" */\n\n", state->file); - } -#endif - - /* - * Write "public interface " - */ - - fprintf(state->file, "public interface %s ", interface_name); - - /* - * Check for inheritence, and iterator over the inherited names, - * if any. - */ - - if ((iterator = IDL_INTERFACE(interface).inheritance_spec)) { - fputs("extends ", state->file); - - do { - - fprintf(state->file, "%s", - IDL_IDENT(IDL_LIST(iterator).data).str); - - if (IDL_LIST(iterator).next) { - fputs(", ", state->file); - } - } while ((iterator = IDL_LIST(iterator).next)); - - } - - fputs("\n{\n", state->file); - - if (iid) { - /* - * Write interface constants for IID - */ - -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - fputs(" public static final String ", state->file); -#else - fputs(" public static final String ", state->file); -#endif - - /* XXX s.b just "IID" ? */ - if (!write_classname_iid_define(state->file, interface_name)) { - return FALSE; - } - -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - fputs(" =\n \"{", state->file); - while (*iid) { - fputc(tolower(*iid++), state->file); - } - fputs("}\";\n", state->file); - -#else - fprintf(state->file, "_STRING =\n \"%s\";\n\n", iid); - - fputs(" public static final nsID ", state->file); - - /* XXX s.b just "IID" ? */ - if (!write_classname_iid_define(state->file, interface_name)) { - return FALSE; - } - - fprintf(state->file, " =\n new nsID(\"%s\");\n\n", iid); -#endif - } - - /* - * Advance the state of the tree, go on to process more - */ - - state->tree = IDL_INTERFACE(interface).body; - - if (state->tree && !xpidl_process_node(state)) { - return FALSE; - } - - - fputs("\n}\n", state->file); - - return TRUE; -} - -static gboolean -process_list(TreeState *state) -{ -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - /* To make the diffing simple, group the constants, methods and attributes. */ - IDL_tree list = state->tree; - IDL_tree iter; - for (iter = list; iter; iter = IDL_LIST(iter).next) { - if (IDL_NODE_TYPE(IDL_LIST(iter).data) == IDLN_CONST_DCL) { - state->tree = IDL_LIST(iter).data; - if (!xpidl_process_node(state)) - return FALSE; - } - } - for (iter = list; iter; iter = IDL_LIST(iter).next) { - if (IDL_NODE_TYPE(IDL_LIST(iter).data) == IDLN_ATTR_DCL) { - state->tree = IDL_LIST(iter).data; - if (!xpidl_process_node(state)) - return FALSE; - } - } - for (iter = list; iter; iter = IDL_LIST(iter).next) { - if (IDL_NODE_TYPE(IDL_LIST(iter).data) == IDLN_OP_DCL) { - state->tree = IDL_LIST(iter).data; - if (!xpidl_process_node(state)) - return FALSE; - } - } - for (iter = list; iter; iter = IDL_LIST(iter).next) { - if ( IDL_NODE_TYPE(IDL_LIST(iter).data) != IDLN_CONST_DCL - && IDL_NODE_TYPE(IDL_LIST(iter).data) != IDLN_OP_DCL - && IDL_NODE_TYPE(IDL_LIST(iter).data) != IDLN_ATTR_DCL ) { - state->tree = IDL_LIST(iter).data; - if (!xpidl_process_node(state)) - return FALSE; - } - } - -#else - IDL_tree iter; - for (iter = state->tree; iter; iter = IDL_LIST(iter).next) { - state->tree = IDL_LIST(iter).data; - if (!xpidl_process_node(state)) - return FALSE; - } -#endif - return TRUE; -} - -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES -static gboolean -interface_declaration_wrapper(TreeState *state) -{ - IDL_tree interface = state->tree; - char *interface_name = IDL_IDENT(IDL_INTERFACE(interface).ident).str; - FILE *org_file = state->file; - char *org_name = state->real_outname; - void *org_priv = state->priv; - gboolean rc; - - /* - * Skip non-scriptable interfaces. - */ - if ( !IDL_tree_property_get(IDL_INTERFACE(interface).ident, "scriptable") - && strcmp(interface_name, "nsIAppShell") ) - return TRUE; - - /* - * GROSS HACK: If the interface isn't the same as the file name, - * temporarily switch output file. - */ - if (state->real_outname) { - const char *basename = xpidl_basename(state->real_outname); - const char *ext = strrchr(basename, '.'); - if ( ext - && !strcmp(ext, ".java") - && ( strncmp(interface_name, basename, ext - basename) - || interface_name[ext - basename] != '.') ) { - size_t needed = strlen(state->real_outname) + strlen(interface_name) + strlen(".java") + 4; - char *tmp = malloc(needed); - if (basename != state->real_outname) - sprintf(tmp,"%.*s/%s.java", (int)(basename - state->real_outname - 1), state->real_outname, interface_name); - else - sprintf(tmp,"%s.java", interface_name); - state->file = fopen(tmp, "w"); - if (!state->file) { - perror("error opening output file"); - state->file = org_file; - free(tmp); - return FALSE; - } - state->real_outname = tmp; - java_prolog(state); - } - g_free(basename); - } - - rc = interface_declaration(state); - - if (state->file != org_file) { - java_epilog(state); - fclose(state->file); - free(state->real_outname); - state->file = org_file; - state->real_outname = org_name; - state->priv = org_priv; - } - return rc; -} -#endif /* VBOX_XPIDL_EMULATE_GENJIFACES */ - -static gboolean -xpcom_to_java_type (TreeState *state) -{ - if (!state->tree) { - fputs("Object", state->file); - return TRUE; - } - - switch(IDL_NODE_TYPE(state->tree)) { - - case IDLN_TYPE_INTEGER: { - - switch(IDL_TYPE_INTEGER(state->tree).f_type) { - - case IDL_INTEGER_TYPE_SHORT: -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - if (IDL_TYPE_INTEGER(state->tree).f_signed) - fputs("short", state->file); - else - fputs("int", state->file); -#else - fputs("short", state->file); -#endif - break; - - case IDL_INTEGER_TYPE_LONG: -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - if (IDL_TYPE_INTEGER(state->tree).f_signed) - fputs("int", state->file); - else - fputs("long", state->file); -#else - fputs("int", state->file); -#endif - break; - - case IDL_INTEGER_TYPE_LONGLONG: -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - if (IDL_TYPE_INTEGER(state->tree).f_signed) - fputs("long", state->file); - else - fputs("double", state->file); -#else - fputs("long", state->file); -#endif - break; - - default: - g_error(" Unknown integer type: %d\n", - IDL_TYPE_INTEGER(state->tree).f_type); - return FALSE; - - } - - break; - } - - case IDLN_TYPE_CHAR: - case IDLN_TYPE_WIDE_CHAR: - fputs("char", state->file); - break; - - case IDLN_TYPE_WIDE_STRING: - case IDLN_TYPE_STRING: - fputs("String", state->file); - break; - - case IDLN_TYPE_BOOLEAN: - fputs("boolean", state->file); - break; - - case IDLN_TYPE_OCTET: -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - fputs("short", state->file); -#else - fputs("byte", state->file); -#endif - break; - - case IDLN_TYPE_FLOAT: - switch(IDL_TYPE_FLOAT(state->tree).f_type) { - - case IDL_FLOAT_TYPE_FLOAT: - fputs("float", state->file); - break; - - case IDL_FLOAT_TYPE_DOUBLE: - fputs("double", state->file); - break; - - default: - g_error(" Unknown floating point typ: %d\n", - IDL_NODE_TYPE(state->tree)); - break; - } - break; - - - case IDLN_IDENT: - if (IDL_NODE_UP(state->tree) && - IDL_NODE_TYPE(IDL_NODE_UP(state->tree)) == IDLN_NATIVE) { - const char *user_type = IDL_NATIVE(IDL_NODE_UP(state->tree)).user_type; - if (strcmp(user_type, "void") == 0) { -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - fputs("nsISupports", state->file); -#else - fputs("Object", state->file); -#endif - } - else if (strcmp(user_type, "nsID") == 0 || - strcmp(user_type, "nsIID") == 0 || - strcmp(user_type, "nsCID") == 0) { - /* XXX: s.b test for "iid" attribute */ - /* XXX: special class for nsIDs */ -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - fputs("String", state->file); -#else - fputs("nsID", state->file); -#endif - } - else { - /* XXX: special class for opaque types */ -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - fputs("String", state->file); -#else - fputs("OpaqueValue", state->file); -#endif - } - } else { - const char *ident_str = IDL_IDENT(state->tree).str; - - /* XXX: big kludge; s.b. way to match to typedefs */ -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - if (strcmp(ident_str, "PRInt8") == 0) { - fputs("byte", state->file); - } - else if (strcmp(ident_str, "PRInt16") == 0 || - strcmp(ident_str, "PRUint8") == 0) { - fputs("short", state->file); - } - else if (strcmp(ident_str, "PRInt32") == 0 || - strcmp(ident_str, "PRUint16") == 0) { - fputs("int", state->file); - } - else if (strcmp(ident_str, "PRInt64") == 0 || - strcmp(ident_str, "PRUint32") == 0 || - strcmp(ident_str, "PRThreadPriority") == 0 || - strcmp(ident_str, "PRThreadScope") == 0 || - strcmp(ident_str, "PRThreadState") == 0) { - fputs("long", state->file); - } - else if (strcmp(ident_str, "PRUint64") == 0) { - fputs("double", state->file); - } -#else - if (strcmp(ident_str, "PRInt8") == 0 || - strcmp(ident_str, "PRUint8") == 0) { - fputs("byte", state->file); - } - else if (strcmp(ident_str, "PRInt16") == 0 || - strcmp(ident_str, "PRUint16") == 0) { - fputs("short", state->file); - } - else if (strcmp(ident_str, "PRInt32") == 0 || - strcmp(ident_str, "PRUint32") == 0) { - fputs("int", state->file); - } - else if (strcmp(ident_str, "PRInt64") == 0 || - strcmp(ident_str, "PRUint64") == 0) { - fputs("long", state->file); - } -#endif - else if (strcmp(ident_str, "PRBool") == 0) { - fputs("boolean", state->file); - } - else if (strcmp(ident_str, "nsrefcnt") == 0) { - fputs("int", state->file); - } -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - /* XXX: Use find_underlying_type instead? */ - else if ( strcmp(ident_str, "nsresult") == 0 - || strcmp(ident_str, "size_t") == 0) { - fputs("long", state->file); - } - else if ( strcmp(ident_str, "PRTime") == 0) { - fputs("double", state->file); - } - /* In Javaconnect, we handle weak references internally; no need for the - |nsIWeakReference| interface. So just return |nsISupports|. */ - else if (strcmp(ident_str, "nsIWeakReference") == 0) { - fputs("nsISupports", state->file); - } -#endif - else { - IDL_tree real_type = - g_hash_table_lookup(TYPEDEFS(state), ident_str); - - if (real_type) { - IDL_tree orig_tree = state->tree; - - state->tree = real_type; - xpcom_to_java_type(state); - - state->tree = orig_tree; - } - else { - fputs(ident_str, state->file); - } - } - } - - break; - - case IDLN_TYPE_ENUM: - case IDLN_TYPE_OBJECT: - default: - g_error(" Unknown type: %d\n", - IDL_TYPE_FLOAT(state->tree).f_type); - break; - } - - return TRUE; - -} - -static gboolean -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF -xpcom_to_java_param(TreeState *state, unsigned nparam) -#else -xpcom_to_java_param(TreeState *state) -#endif -{ - IDL_tree param = state->tree; - state->tree = IDL_PARAM_DCL(param).param_type_spec; - - /* - * Put in type of parameter - */ - - if (!xpcom_to_java_type(state)) { - return FALSE; - } - - /* - * If the parameter is out or inout, make it a Java array of the - * appropriate type - */ - -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - /* XXX: Causes nsILineInputStream::readLine(String[] arg1) where genjifaces drops the []. */ -#endif - if (IDL_PARAM_DCL(param).attr != IDL_PARAM_IN) { - fputs("[]", state->file); - } -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - /*XXX: nsIConsoleService::getMessageArray ends up with [][] arg1... */ - /*else*/ if (IDL_tree_property_get(IDL_PARAM_DCL(param).simple_declarator, "array")) { - fputs("[]", state->file); - } -#endif - - /* - * Put in name of parameter - */ - - fputc(' ', state->file); - -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - fprintf(state->file, "arg%u", nparam+1); -#else - fputs(IDL_IDENT(IDL_PARAM_DCL(param).simple_declarator).str, state->file); -#endif - - return TRUE; -} - -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES -static gboolean is_java_keyword(char ch0, const char *name) -{ - static const char * const kJavaKeywords[] = { - "abstract", "default", "if" , "private" , "this" , - "boolean" , "do" , "implements", "protected" , "throw" , - "break" , "double" , "import", "public" , "throws" , - "byte" , "else" , "instanceof", "return" , "transient", - "case" , "extends", "int" , "short" , "try" , - "catch" , "final" , "interface" , "static" , "void" , - "char" , "finally", "long" , "strictfp" , "volatile" , - "class" , "float" , "native" , "super" , "while" , - "const" , "for" , "new" , "switch" , - "continue", "goto" , "package" , "synchronized", - "assert" , /* added in Java 1.4 */ - "enum" , /* added in Java 5.0 */ - "clone" , /* clone is a member function of java.lang.Object */ - "finalize" /* finalize is a member function of java.lang.Object */ - }; - unsigned i; - for (i = 0; i < sizeof(kJavaKeywords) / sizeof(kJavaKeywords[0]); i++) { - if (kJavaKeywords[i][0] == ch0 && !strcmp(&kJavaKeywords[i][1], &name[1])) { - return TRUE; - } - } - return FALSE; -} -#endif - -static gboolean -type_declaration(TreeState *state) -{ - /* - * Unlike C, Java has no type declaration directive. - * Instead, we record the mapping, and look up the actual type - * when needed. - */ - IDL_tree type = IDL_TYPE_DCL(state->tree).type_spec; - IDL_tree dcls = IDL_TYPE_DCL(state->tree).dcls; - - /* XXX: check for illegal types */ - - g_hash_table_insert(TYPEDEFS(state), - IDL_IDENT(IDL_LIST(dcls).data).str, - type); - - return TRUE; -} - -static gboolean -method_declaration(TreeState *state) -{ - /* IDL_tree method_tree = state->tree; */ - struct _IDL_OP_DCL *method = &IDL_OP_DCL(state->tree); - gboolean method_notxpcom = - (IDL_tree_property_get(method->ident, "notxpcom") != NULL); - gboolean method_noscript = - (IDL_tree_property_get(method->ident, "noscript") != NULL); - IDL_tree iterator = NULL; - IDL_tree retval_param = NULL; - const char *method_name = IDL_IDENT(method->ident).str; -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - unsigned nparam = 0; -#endif - - if (!verify_method_declaration(state->tree)) - return FALSE; - -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - /* - * Skip most (todo) non-scriptable and not-xpcom methods. - */ - if (method_noscript || method_notxpcom) { - return TRUE; - } -#endif - - fputc('\n', state->file); -#ifndef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - xpidl_write_comment(state, 4); -#endif - - /* - * Write beginning of method declaration - */ -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - fputs(" ", state->file); -#else - fputs(" ", state->file); -#endif - if (!method_noscript) { - /* Nonscriptable methods become package-protected */ - fputs("public ", state->file); - } - - /* - * Write return type - * Unlike C++ headers, Java interfaces return the declared - * return value; an exception indicates XPCOM method failure. - */ - if (method_notxpcom || method->op_type_spec) { - state->tree = method->op_type_spec; - if (!xpcom_to_java_type(state)) { - return FALSE; - } - } else { - /* Check for retval attribute */ - for (iterator = method->parameter_dcls; iterator != NULL; - iterator = IDL_LIST(iterator).next) { - - IDL_tree original_tree = state->tree; - - state->tree = IDL_LIST(iterator).data; - - if (IDL_tree_property_get(IDL_PARAM_DCL(state->tree).simple_declarator, - "retval")) { - retval_param = iterator; - - state->tree = IDL_PARAM_DCL(state->tree).param_type_spec; - - /* - * Put in type of parameter - */ - - if (!xpcom_to_java_type(state)) { - return FALSE; - } -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - if (IDL_tree_property_get(IDL_PARAM_DCL(IDL_LIST(iterator).data).simple_declarator, "array")) { - fputs("[]", state->file); - } -#endif - } - - state->tree = original_tree; - } - - if (retval_param == NULL) { - fputs("void", state->file); - } - } - - /* - * Write method name - */ -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - if (is_java_keyword(tolower(method_name[0]), method_name)) { - fprintf(state->file, " %c%s_(", tolower(method_name[0]), method_name + 1); - } else { - fprintf(state->file, " %c%s(", tolower(method_name[0]), method_name + 1); - } -#else - fprintf(state->file, " %c%s(", tolower(method_name[0]), method_name + 1); -#endif - - /* - * Write parameters - */ - for (iterator = method->parameter_dcls; iterator != NULL; - iterator = IDL_LIST(iterator).next) { - - /* Skip "retval" */ - if (iterator == retval_param) { - continue; - } - - if (iterator != method->parameter_dcls) { - fputs(", ", state->file); - } - - state->tree = IDL_LIST(iterator).data; - -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - if (!xpcom_to_java_param(state, nparam++)) { -#else - if (!xpcom_to_java_param(state)) { -#endif - return FALSE; - } - } - - fputs(")", state->file); - - if (method->raises_expr) { - IDL_tree iter = method->raises_expr; - IDL_tree dataNode = IDL_LIST(iter).data; - - fputs(" throws ", state->file); - fputs(IDL_IDENT(dataNode).str, state->file); - iter = IDL_LIST(iter).next; - - while (iter) { - dataNode = IDL_LIST(iter).data; - fprintf(state->file, ", %s", IDL_IDENT(dataNode).str); - iter = IDL_LIST(iter).next; - } - } - - fputs(";\n", state->file); - - return TRUE; - -} - - -static gboolean -constant_declaration(TreeState *state) -{ - struct _IDL_CONST_DCL *declaration = &IDL_CONST_DCL(state->tree); - const char *name = IDL_IDENT(declaration->ident).str; - IDL_tree real_type; - - if (!verify_const_declaration(state->tree)) - return FALSE; - - /* Could be a typedef; try to map it to the real type. */ - real_type = find_underlying_type(declaration->const_type); - real_type = real_type ? real_type : declaration->const_type; - - fputc('\n', state->file); -#ifndef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - xpidl_write_comment(state, 4); -#endif - -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES -# ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - fputs(" public static final ", state->file); -# else - fputs(" public static final ", state->file); -# endif - if (IDL_TYPE_INTEGER(real_type).f_type == IDL_INTEGER_TYPE_LONG) { - if (IDL_TYPE_INTEGER(real_type).f_signed) - fprintf(state->file, "int %s = %" IDL_LL "d;\n", name, IDL_INTEGER(declaration->const_exp).value); - else - fprintf(state->file, "long %s = %" IDL_LL "uL;\n", name, IDL_INTEGER(declaration->const_exp).value); - } else { - if (IDL_TYPE_INTEGER(real_type).f_signed) - fprintf(state->file, "short %s = %" IDL_LL "d;\n", name, IDL_INTEGER(declaration->const_exp).value); - else - fprintf(state->file, "int %s = %" IDL_LL "u;\n", name, IDL_INTEGER(declaration->const_exp).value); - } -#else /* !VBOX_XPIDL_EMULATE_GENJIFACES */ - fprintf(state->file, " public static final %s %s = %d;\n", - (IDL_TYPE_INTEGER(real_type).f_type == IDL_INTEGER_TYPE_LONG - ? "long" : "short"), - name, (int) IDL_INTEGER(declaration->const_exp).value); -#endif /* !VBOX_XPIDL_EMULATE_GENJIFACES */ - - return TRUE; - -} - -#define ATTR_IDENT(tree) (IDL_IDENT(IDL_LIST(IDL_ATTR_DCL((tree)).simple_declarations).data)) -#define ATTR_PROPS(tree) (IDL_LIST(IDL_ATTR_DCL((tree)).simple_declarations).data) -#define ATTR_TYPE_DECL(tree) (IDL_ATTR_DCL((tree)).param_type_spec) - - -static gboolean -attribute_declaration(TreeState *state) -{ - gboolean read_only = IDL_ATTR_DCL(state->tree).f_readonly; - char *attribute_name = ATTR_IDENT(state->tree).str; - - gboolean method_noscript = - (IDL_tree_property_get(ATTR_PROPS(state->tree), "noscript") != NULL); - -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - /* - * Skip most non-scriptable attributes. - */ - if (method_noscript) { - return TRUE; - } -#endif - -#if 0 - /* - * Disabled here because I can't verify this check against possible - * users of the java xpidl backend. - */ - if (!verify_attribute_declaration(state->tree)) - return FALSE; -#endif - - /* Comment */ - fputc('\n', state->file); -#ifndef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - xpidl_write_comment(state, 4); -#endif - - state->tree = ATTR_TYPE_DECL(state->tree); - - /* - * Write access permission ("public" unless nonscriptable) - */ -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - fputs(" ", state->file); -#else - fputs(" ", state->file); -#endif - if (!method_noscript) { - fputs("public ", state->file); - } - - /* - * Write the proper Java return value for the get operation - */ - if (!xpcom_to_java_type(state)) { - return FALSE; - } - - /* - * Write the name of the accessor ("get") method. - */ - fprintf(state->file, " get%c%s();\n", - toupper(attribute_name[0]), attribute_name + 1); - - - if (!read_only) { - /* Nonscriptable methods become package-protected */ -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - fputs("\n ", state->file); -#else - fputs(" ", state->file); -#endif - if (!method_noscript) { - fputs("public ", state->file); - } - - /* - * Write attribute access method name and return type - */ - fprintf(state->file, "void set%c%s(", - toupper(attribute_name[0]), - attribute_name+1); - - /* - * Write the proper Java type for the set operation - */ - if (!xpcom_to_java_type(state)) { - return FALSE; - } - - /* - * Write the name of the formal parameter. - */ -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES_DIFF - fputs(" arg1);\n", state->file); -#else - fputs(" value);\n", state->file); -#endif - } - - return TRUE; -} - - -static gboolean -enum_declaration(TreeState *state) -{ - XPIDL_WARNING((state->tree, IDL_WARNING1, - "enums not supported, enum \'%s\' ignored", - IDL_IDENT(IDL_TYPE_ENUM(state->tree).ident).str)); - return TRUE; -} - -backend * -xpidl_java_dispatch(void) -{ - static backend result; - static nodeHandler table[IDLN_LAST]; - static gboolean initialized = FALSE; - - result.emit_prolog = java_prolog; - result.emit_epilog = java_epilog; - - if (!initialized) { -#ifdef VBOX_XPIDL_EMULATE_GENJIFACES - table[IDLN_INTERFACE] = interface_declaration_wrapper; -#else - table[IDLN_INTERFACE] = interface_declaration; -#endif - table[IDLN_LIST] = process_list; - - table[IDLN_OP_DCL] = method_declaration; - table[IDLN_ATTR_DCL] = attribute_declaration; - table[IDLN_CONST_DCL] = constant_declaration; - - table[IDLN_TYPE_DCL] = type_declaration; - table[IDLN_FORWARD_DCL] = forward_declaration; - - table[IDLN_TYPE_ENUM] = enum_declaration; - - initialized = TRUE; - } - - result.dispatch_table = table; - return &result; -} - diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_typelib.c b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_typelib.c index 4680938d..72e193f3 100644 --- a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_typelib.c +++ b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_typelib.c @@ -39,47 +39,52 @@ * Generate typelib files for use with InterfaceInfo. * http://www.mozilla.org/scriptable/typelib_file.html */ +#include +#include #include "xpidl.h" #include #include #include /* XXX XP? */ -struct priv_data { +typedef struct XPIDLTYPELIBSTATE { XPTHeader *header; uint16 ifaces; - GHashTable *interface_map; + RTLISTANCHOR LstInterfaces; XPTInterfaceDescriptor *current; XPTArena *arena; uint16 next_method; uint16 next_const; uint16 next_type; /* used for 'additional_types' for idl arrays */ -}; + PRTERRINFO pErrInfo; +} XPIDLTYPELIBSTATE; +typedef XPIDLTYPELIBSTATE *PXPIDLTYPELIBSTATE; -#define HEADER(state) (((struct priv_data *)state->priv)->header) -#define IFACES(state) (((struct priv_data *)state->priv)->ifaces) -#define IFACE_MAP(state) (((struct priv_data *)state->priv)->interface_map) -#define CURRENT(state) (((struct priv_data *)state->priv)->current) -#define ARENA(state) (((struct priv_data *)state->priv)->arena) -#define NEXT_METH(state) (((struct priv_data *)state->priv)->next_method) -#define NEXT_CONST(state) (((struct priv_data *)state->priv)->next_const) -#define NEXT_TYPE(state) (((struct priv_data *)state->priv)->next_type) +#define HEADER(state) (state->header) +#define IFACES(state) (state->ifaces) +#define IFACE_MAP(state) (state->LstInterfaces) +#define CURRENT(state) (state->current) +#define ARENA(state) (state->arena) +#define NEXT_METH(state) (state->next_method) +#define NEXT_CONST(state) (state->next_const) +#define NEXT_TYPE(state) (state->next_type) #ifdef DEBUG_shaver /* #define DEBUG_shaver_sort */ #endif typedef struct { + RTLISTNODE NdInterfaces; char *full_name; char *name; char *name_space; char *iid; - gboolean is_forward_dcl; + bool is_forward_dcl; } NewInterfaceHolder; static NewInterfaceHolder* -CreateNewInterfaceHolder(char *name, char *name_space, char *iid, - gboolean is_forward_dcl) +CreateNewInterfaceHolder(const char *name, char *name_space, char *iid, + bool is_forward_dcl) { NewInterfaceHolder *holder = calloc(1, sizeof(NewInterfaceHolder)); if (holder) { @@ -121,95 +126,152 @@ DeleteNewInterfaceHolder(NewInterfaceHolder *holder) } } + +static XPTInterfaceDirectoryEntry *FindInterfaceByName(XPTInterfaceDirectoryEntry *ides, uint16 num_interfaces, + const char *name, uint16_t *pu16Id) +{ + uint16_t i; + for (i = 0; i < num_interfaces; i++) { + if (!strcmp(ides[i].name, name)) + { + if (pu16Id) + *pu16Id = i + 1; + return &ides[i]; + } + } + return NULL; +} + + /* * If p is an ident for an interface, and we don't have an entry in the * interface map yet, add one. */ -static gboolean -add_interface_maybe(IDL_tree_func_data *tfd, gpointer user_data) +static bool add_interface_maybe(PXPIDLTYPELIBSTATE pThis, PCXPIDLNODE pNd) { - TreeState *state = user_data; - if (IDL_NODE_TYPE(tfd->tree) == IDLN_IDENT) { - IDL_tree_type node_type = IDL_NODE_TYPE(IDL_NODE_UP(tfd->tree)); - if (node_type == IDLN_INTERFACE || node_type == IDLN_FORWARD_DCL) { + if (pNd->enmType == kXpidlNdType_Identifier) + { + pNd = pNd->pNdTypeRef; + AssertPtr(pNd); + } - /* We only want to add a new entry if there is no entry by this - * name or if the previously found entry was just a forward - * declaration and the new entry is not. - */ + if ( pNd->enmType == kXpidlNdType_Interface_Forward_Decl + || pNd->enmType == kXpidlNdType_Interface_Def) + { - char *iface = IDL_IDENT(tfd->tree).str; - NewInterfaceHolder *old_holder = (NewInterfaceHolder *) - g_hash_table_lookup(IFACE_MAP(state), iface); - if (old_holder && old_holder->is_forward_dcl && - node_type != IDLN_FORWARD_DCL) + /* We only want to add a new entry if there is no entry by this + * name or if the previously found entry was just a forward + * declaration and the new entry is not. + */ + + const char *pszIfName = pNd->enmType == kXpidlNdType_Interface_Forward_Decl + ? pNd->u.pszIfFwdName + : pNd->u.If.pszIfName; + NewInterfaceHolder *old_holder = NULL; + + NewInterfaceHolder *pIt; + RTListForEach(&IFACE_MAP(pThis), pIt, NewInterfaceHolder, NdInterfaces) + { + if (!strcmp(pIt->name, pszIfName)) { - g_hash_table_remove(IFACE_MAP(state), iface); - DeleteNewInterfaceHolder(old_holder); - old_holder = NULL; + old_holder = pIt; + break; } - if (!old_holder) { - /* XXX should we parse here and store a struct nsID *? */ - char *iid = (char *)IDL_tree_property_get(tfd->tree, "uuid"); - char *name_space = (char *) - IDL_tree_property_get(tfd->tree, "namespace"); - NewInterfaceHolder *holder = - CreateNewInterfaceHolder(iface, name_space, iid, - (gboolean) node_type == IDLN_FORWARD_DCL); - if (!holder) - return FALSE; - g_hash_table_insert(IFACE_MAP(state), - holder->full_name, holder); - IFACES(state)++; + } + + if ( old_holder + && old_holder->is_forward_dcl + && pNd->enmType != kXpidlNdType_Interface_Forward_Decl) + { + RTListNodeRemove(&old_holder->NdInterfaces); + DeleteNewInterfaceHolder(old_holder); + IFACES(pThis)--; + old_holder = NULL; + } + + if (!old_holder) + { + /* XXX should we parse here and store a struct nsID *? */ + PCXPIDLATTR pAttr = xpidlNodeAttrFind(pNd, "uuid"); + char *iid = NULL; + if (pAttr) + { + if (pAttr->pszVal) + iid = (char *)pAttr->pszVal; + else + return false; /* uuid requires an argument. */ + } + + pAttr = xpidlNodeAttrFind(pNd, "namespace"); + char *name_space = NULL; + if (pAttr) + { + if (pAttr->pszVal) + name_space = (char *)pAttr->pszVal; + else + return false; /* uuid requires an argument. */ + } + + NewInterfaceHolder *holder = CreateNewInterfaceHolder(pszIfName, name_space, iid, pNd->enmType == kXpidlNdType_Interface_Forward_Decl); + if (!holder) + return false; + RTListAppend(&pThis->LstInterfaces, &holder->NdInterfaces); + + IFACES(pThis)++; #ifdef DEBUG_shaver_ifaces - fprintf(stderr, "adding interface #%d: %s/%s\n", IFACES(state), - iface, iid[0] ? iid : ""); + fprintf(stderr, "adding interface #%d: %s/%s\n", IFACES(pThis), + pszIfName, iid ? iid : ""); #endif - } } } - return TRUE; + return true; } /* Find all the interfaces referenced in the tree (uses add_interface_maybe) */ -static gboolean -find_interfaces(IDL_tree_func_data *tfd, gpointer user_data) +static bool find_interfaces(PXPIDLTYPELIBSTATE pThis, PCXPIDLINPUT pInput, PCRTLISTANCHOR pLstNodes) { - IDL_tree node = NULL; + PCXPIDLNODE pIt; + RTListForEach(pLstNodes, pIt, XPIDLNODE, NdLst) + { + switch (pIt->enmType) + { + case kXpidlNdType_Identifier: + { + if (pIt->u.Attribute.pNdTypeSpec) + add_interface_maybe(pThis, pIt->u.Attribute.pNdTypeSpec); + break; + } + case kXpidlNdType_Interface_Forward_Decl: + add_interface_maybe(pThis, pIt); + break; + case kXpidlNdType_Interface_Def: + if (pIt->pInput != pInput) /* Skip anything not top level. */ + continue; - switch (IDL_NODE_TYPE(tfd->tree)) { - case IDLN_ATTR_DCL: - node = IDL_ATTR_DCL(tfd->tree).param_type_spec; - break; - case IDLN_OP_DCL: - IDL_tree_walk_in_order(IDL_OP_DCL(tfd->tree).parameter_dcls, find_interfaces, - user_data); - node = IDL_OP_DCL(tfd->tree).op_type_spec; - break; - case IDLN_PARAM_DCL: - node = IDL_PARAM_DCL(tfd->tree).param_type_spec; - break; - case IDLN_INTERFACE: - node = IDL_INTERFACE(tfd->tree).inheritance_spec; - if (node) - xpidl_list_foreach(node, add_interface_maybe, user_data); - node = IDL_INTERFACE(tfd->tree).ident; - break; - case IDLN_FORWARD_DCL: - node = IDL_FORWARD_DCL(tfd->tree).ident; - break; - default: - node = NULL; + if (pIt->pNdTypeRef) + add_interface_maybe(pThis, pIt->pNdTypeRef); + add_interface_maybe(pThis, pIt); + if (!find_interfaces(pThis, pInput, &pIt->u.If.LstBody)) + return false; + break; + case kXpidlNdType_Attribute: + add_interface_maybe(pThis, pIt->u.Attribute.pNdTypeSpec); + break; + case kXpidlNdType_Method: + add_interface_maybe(pThis, pIt->u.Method.pNdTypeSpecRet); + if (!find_interfaces(pThis, pInput, &pIt->u.Method.LstParams)) + return false; + break; + case kXpidlNdType_Parameter: + add_interface_maybe(pThis, pIt->u.Param.pNdTypeSpec); + break; + default: + break; + } } - if (node && IDL_NODE_TYPE(node) == IDLN_IDENT) { - IDL_tree_func_data new_tfd; - new_tfd.tree = node; - add_interface_maybe(&new_tfd, user_data); - } - - return TRUE; + return true; } #ifdef DEBUG_shaver @@ -225,45 +287,44 @@ print_IID(struct nsID *iid, FILE *file) #endif /* fill the interface_directory IDE table from the interface_map */ -static gboolean -fill_ide_table(gpointer key, gpointer value, gpointer user_data) +static int fill_ide_table(PXPIDLTYPELIBSTATE pThis) { - TreeState *state = user_data; - NewInterfaceHolder *holder = (NewInterfaceHolder *) value; - struct nsID id; - XPTInterfaceDirectoryEntry *ide; + NewInterfaceHolder *pIt, *pItNext; + RTListForEachSafe(&pThis->LstInterfaces, pIt, pItNext, NewInterfaceHolder, NdInterfaces) + { + struct nsID id; + XPTInterfaceDirectoryEntry *ide; - XPT_ASSERT(holder); + XPT_ASSERT(pIt); #ifdef DEBUG_shaver_ifaces - fprintf(stderr, "filling %s\n", holder->full_name); + fprintf(stderr, "filling %s\n", pIt->full_name); #endif - if (holder->iid) { - if (strlen(holder->iid) != 36) { - IDL_tree_error(state->tree, "IID %s is the wrong length\n", - holder->iid); - return FALSE; - } - if (!xpidl_parse_iid(&id, holder->iid)) { - IDL_tree_error(state->tree, "cannot parse IID %s\n", holder->iid); - return FALSE; - } - } else { - memset(&id, 0, sizeof(id)); - } + if (pIt->iid) + { + if (strlen(pIt->iid) != 36) + return xpidlIdlError(pThis->pErrInfo, NULL /*pNd*/, VERR_INVALID_STATE, + "IID %s is the wrong length", pIt->iid); - ide = &(HEADER(state)->interface_directory[IFACES(state)]); - if (!XPT_FillInterfaceDirectoryEntry(ARENA(state), ide, &id, holder->name, - holder->name_space, NULL)) { - IDL_tree_error(state->tree, "INTERNAL: XPT_FillIDE failed for %s\n", - holder->full_name); - return FALSE; - } + if (!xpidl_parse_iid(&id, pIt->iid)) + return xpidlIdlError(pThis->pErrInfo, NULL /*pNd*/, VERR_INVALID_STATE, + "cannot parse IID %s\n", pIt->iid); + } + else + memset(&id, 0, sizeof(id)); - IFACES(state)++; - DeleteNewInterfaceHolder(holder); - return TRUE; + ide = &(HEADER(pThis)->interface_directory[IFACES(pThis)]); + if (!XPT_FillInterfaceDirectoryEntry(ARENA(pThis), ide, &id, pIt->name, + pIt->name_space, NULL)) + return xpidlIdlError(pThis->pErrInfo, NULL /*pNd*/, VERR_INVALID_STATE, + "INTERNAL: XPT_FillIDE failed for %s\n", pIt->full_name); + + IFACES(pThis)++; + RTListNodeRemove(&pIt->NdInterfaces); + DeleteNewInterfaceHolder(pIt); + } + return VINF_SUCCESS; } static int @@ -299,86 +360,62 @@ compare_IDEs(const void *ap, const void *bp) /* sort the IDE block as per the typelib spec: IID order, unresolved first */ static void -sort_ide_block(TreeState *state) +sort_ide_block(PXPIDLTYPELIBSTATE pThis) { XPTInterfaceDirectoryEntry *ide; - int i; /* boy, I sure hope qsort works correctly everywhere */ #ifdef DEBUG_shaver_sort fputs("before sort:\n", stderr); - for (i = 0; i < IFACES(state); i++) { + for (uint16_t i = 0; i < IFACES(pThis); i++) { fputs(" ", stderr); - print_IID(&HEADER(state)->interface_directory[i].iid, stderr); + print_IID(&HEADER(pThis)->interface_directory[i].iid, stderr); fputc('\n', stderr); } #endif - qsort(HEADER(state)->interface_directory, IFACES(state), + qsort(HEADER(pThis)->interface_directory, IFACES(pThis), sizeof(*ide), compare_IDEs); #ifdef DEBUG_shaver_sort fputs("after sort:\n", stderr); - for (i = 0; i < IFACES(state); i++) { + for (uint16_t i = 0; i < IFACES(pThis); i++) { fputs(" ", stderr); - print_IID(&HEADER(state)->interface_directory[i].iid, stderr); + print_IID(&HEADER(pThis)->interface_directory[i].iid, stderr); fputc('\n', stderr); } #endif - - for (i = 0; i < IFACES(state); i++) { - ide = HEADER(state)->interface_directory + i; - g_hash_table_insert(IFACE_MAP(state), ide->name, (void *)(i + 1)); - } - - return; } -static gboolean -typelib_list(TreeState *state) -{ - IDL_tree iter; - for (iter = state->tree; iter; iter = IDL_LIST(iter).next) { - state->tree = IDL_LIST(iter).data; - if (!xpidl_process_node(state)) - return FALSE; - } - return TRUE; -} -static gboolean -typelib_prolog(TreeState *state) +static int typelib_prolog(PXPIDLTYPELIBSTATE pThis, PCXPIDLINPUT pInput, PCXPIDLPARSE pParse) { - state->priv = calloc(1, sizeof(struct priv_data)); - if (!state->priv) - return FALSE; - IFACES(state) = 0; - IFACE_MAP(state) = g_hash_table_new(g_str_hash, g_str_equal); - if (!IFACE_MAP(state)) { - /* XXX report error */ - free(state->priv); - return FALSE; - } + IFACES(pThis) = 0; + RTListInit(&IFACE_MAP(pThis)); + /* find all interfaces, top-level and referenced by others */ - IDL_tree_walk_in_order(state->tree, find_interfaces, state); - ARENA(state) = XPT_NewArena(1024, sizeof(double), "main xpidl arena"); - HEADER(state) = XPT_NewHeader(ARENA(state), IFACES(state), + if (!find_interfaces(pThis, pInput, &pParse->LstNodes)) + return VERR_BUFFER_OVERFLOW; + + ARENA(pThis) = XPT_NewArena(1024, sizeof(double), "main xpidl arena"); + HEADER(pThis) = XPT_NewHeader(ARENA(pThis), IFACES(pThis), major_version, minor_version); /* fill IDEs from hash table */ - IFACES(state) = 0; - g_hash_table_foreach_remove(IFACE_MAP(state), fill_ide_table, state); + IFACES(pThis) = 0; + int rc = fill_ide_table(pThis); + if (RT_FAILURE(rc)) + return rc; /* if any are left then we must have failed in fill_ide_table */ - if (g_hash_table_size(IFACE_MAP(state))) - return FALSE; + if (!RTListIsEmpty(&IFACE_MAP(pThis))) + return VERR_BUFFER_OVERFLOW; /* sort the IDEs by IID order and store indices in the interface map */ - sort_ide_block(state); + sort_ide_block(pThis); - return TRUE; + return VINF_SUCCESS; } -static gboolean -typelib_epilog(TreeState *state) +static int typelib_epilog(PXPIDLTYPELIBSTATE pThis, FILE *pFile, PCXPIDLINPUT pInput) { XPTState *xstate = XPT_NewXDRState(XPT_ENCODE, NULL, 0); XPTCursor curs, *cursor = &curs; @@ -403,16 +440,16 @@ typelib_epilog(TreeState *state) /* Avoid dependence on nspr; no PR_smprintf and friends. */ /* How large should the annotation string be? */ - annotation_len = strlen(annotation_format) + strlen(state->basename) + + annotation_len = strlen(annotation_format) + strlen(pInput->pszBasename) + strlen(timestr); #ifdef VBOX /* note that '%s' is contained two times in annotation_format and both * format specifiers are replaced by a string. So in fact we reserve 4 * bytes minus one byte (for the terminating '\0') more than necessary. */ #endif - for (i = 0; i < HEADER(state)->num_interfaces; i++) { + for (i = 0; i < HEADER(pThis)->num_interfaces; i++) { XPTInterfaceDirectoryEntry *ide; - ide = &HEADER(state)->interface_directory[i]; + ide = &HEADER(pThis)->interface_directory[i]; if (ide->interface_descriptor) { annotation_len += strlen(ide->name) + 1; } @@ -420,669 +457,581 @@ typelib_epilog(TreeState *state) annotate_val = (char *) malloc(annotation_len); written_so_far = sprintf(annotate_val, annotation_format, - state->basename, timestr); + pInput->pszBasename, timestr); - for (i = 0; i < HEADER(state)->num_interfaces; i++) { + for (i = 0; i < HEADER(pThis)->num_interfaces; i++) { XPTInterfaceDirectoryEntry *ide; - ide = &HEADER(state)->interface_directory[i]; + ide = &HEADER(pThis)->interface_directory[i]; if (ide->interface_descriptor) { written_so_far += sprintf(annotate_val + written_so_far, " %s", ide->name); } } - HEADER(state)->annotations = - XPT_NewAnnotation(ARENA(state), + HEADER(pThis)->annotations = + XPT_NewAnnotation(ARENA(pThis), XPT_ANN_LAST | XPT_ANN_PRIVATE, - XPT_NewStringZ(ARENA(state), "xpidl 0.99.9"), - XPT_NewStringZ(ARENA(state), annotate_val)); + XPT_NewStringZ(ARENA(pThis), "xpidl 0.99.9"), + XPT_NewStringZ(ARENA(pThis), annotate_val)); free(annotate_val); } else { - HEADER(state)->annotations = - XPT_NewAnnotation(ARENA(state), XPT_ANN_LAST, NULL, NULL); + HEADER(pThis)->annotations = + XPT_NewAnnotation(ARENA(pThis), XPT_ANN_LAST, NULL, NULL); } - if (!HEADER(state)->annotations) { + if (!HEADER(pThis)->annotations) { /* XXX report out of memory error */ - return FALSE; + return false; } /* Write the typelib */ - header_sz = XPT_SizeOfHeaderBlock(HEADER(state)); + header_sz = XPT_SizeOfHeaderBlock(HEADER(pThis)); if (!xstate || !XPT_MakeCursor(xstate, XPT_HEADER, header_sz, cursor)) goto destroy_header; oldOffset = cursor->offset; - if (!XPT_DoHeader(ARENA(state), cursor, &HEADER(state))) + if (!XPT_DoHeader(ARENA(pThis), cursor, &HEADER(pThis))) goto destroy; newOffset = cursor->offset; XPT_GetXDRDataLength(xstate, XPT_HEADER, &len); - HEADER(state)->file_length = len; + HEADER(pThis)->file_length = len; XPT_GetXDRDataLength(xstate, XPT_DATA, &len); - HEADER(state)->file_length += len; + HEADER(pThis)->file_length += len; XPT_SeekTo(cursor, oldOffset); - if (!XPT_DoHeaderPrologue(ARENA(state), cursor, &HEADER(state), NULL)) + if (!XPT_DoHeaderPrologue(ARENA(pThis), cursor, &HEADER(pThis), NULL)) goto destroy; XPT_SeekTo(cursor, newOffset); XPT_GetXDRData(xstate, XPT_HEADER, &data, &len); - fwrite(data, len, 1, state->file); + fwrite(data, len, 1, pFile); XPT_GetXDRData(xstate, XPT_DATA, &data, &len); - fwrite(data, len, 1, state->file); + fwrite(data, len, 1, pFile); destroy: XPT_DestroyXDRState(xstate); destroy_header: - /* XXX XPT_DestroyHeader(HEADER(state)) */ + /* XXX XPT_DestroyHeader(HEADER(pThis)) */ - XPT_FreeHeader(ARENA(state), HEADER(state)); - XPT_DestroyArena(ARENA(state)); - - /* XXX should destroy priv_data here */ - - return TRUE; + XPT_FreeHeader(ARENA(pThis), HEADER(pThis)); + XPT_DestroyArena(ARENA(pThis)); + return VINF_SUCCESS; } -static XPTInterfaceDirectoryEntry * -FindInterfaceByName(XPTInterfaceDirectoryEntry *ides, uint16 num_interfaces, - const char *name) +static bool find_arg_with_name(PCXPIDLNODE pNd, const char *name, int16 *argnum) { - uint16 i; - for (i = 0; i < num_interfaces; i++) { - if (!strcmp(ides[i].name, name)) - return &ides[i]; - } - return NULL; -} - -static gboolean -typelib_interface(TreeState *state) -{ - IDL_tree iface = state->tree, iter; - char *name = IDL_IDENT(IDL_INTERFACE(iface).ident).str; - XPTInterfaceDirectoryEntry *ide; - XPTInterfaceDescriptor *id; - uint16 parent_id = 0; - PRUint8 interface_flags = 0; - - if (!verify_interface_declaration(iface)) - return FALSE; - - if (IDL_tree_property_get(IDL_INTERFACE(iface).ident, "scriptable")) - interface_flags |= XPT_ID_SCRIPTABLE; - - if (IDL_tree_property_get(IDL_INTERFACE(iface).ident, "function")) - interface_flags |= XPT_ID_FUNCTION; - - ide = FindInterfaceByName(HEADER(state)->interface_directory, - HEADER(state)->num_interfaces, name); - if (!ide) { - IDL_tree_error(iface, "ERROR: didn't find interface %s in " - "IDE block. Giving up.\n", name); - return FALSE; - } - - if ((iter = IDL_INTERFACE(iface).inheritance_spec)) { - char *parent; - if (IDL_LIST(iter).next) { - IDL_tree_error(iface, - "ERROR: more than one parent interface for %s\n", - name); - return FALSE; - } - parent = IDL_IDENT(IDL_LIST(iter).data).str; - parent_id = (uint16)(uint32)g_hash_table_lookup(IFACE_MAP(state), - parent); - if (!parent_id) { - IDL_tree_error(iface, - "ERROR: no index found for %s. Giving up.\n", - parent); - return FALSE; - } - } - - id = XPT_NewInterfaceDescriptor(ARENA(state), parent_id, 0, 0, - interface_flags); - if (!id) - return FALSE; - - CURRENT(state) = ide->interface_descriptor = id; -#ifdef DEBUG_shaver_ifaces - fprintf(stderr, "DBG: starting interface %s @ %p\n", name, id); -#endif - - NEXT_METH(state) = 0; - NEXT_CONST(state) = 0; - NEXT_TYPE(state) = 0; - - state->tree = IDL_INTERFACE(iface).body; - if (state->tree && !xpidl_process_node(state)) - return FALSE; -#ifdef DEBUG_shaver_ifaces - fprintf(stderr, "DBG: ending interface %s\n", name); -#endif - return TRUE; -} - -static gboolean -find_arg_with_name(TreeState *state, const char *name, int16 *argnum) -{ - int16 count; - IDL_tree params; - - XPT_ASSERT(state); XPT_ASSERT(name); XPT_ASSERT(argnum); - params = IDL_OP_DCL(IDL_NODE_UP(IDL_NODE_UP(state->tree))).parameter_dcls; - for (count = 0; - params != NULL && IDL_LIST(params).data != NULL; - params = IDL_LIST(params).next, count++) + Assert(pNd->enmType == kXpidlNdType_Parameter); + pNd = pNd->pParent; + Assert(pNd->enmType == kXpidlNdType_Method); + + uint16_t idxArgNum = 0; + PCXPIDLNODE pIt; + RTListForEach(&pNd->u.Method.LstParams, pIt, XPIDLNODE, NdLst) { - const char *cur_name = IDL_IDENT( - IDL_PARAM_DCL(IDL_LIST(params).data).simple_declarator).str; - if (!strcmp(cur_name, name)) { + Assert(pIt->enmType == kXpidlNdType_Parameter); + if (!strcmp(pIt->u.Param.pszName, name)) + { /* XXX ought to verify that this is the right type here */ /* XXX for iid_is this must be an iid */ /* XXX for size_is and length_is this must be a uint32 */ - *argnum = count; - return TRUE; + *argnum = idxArgNum; + return true; } + idxArgNum++; } - return FALSE; + return false; } + /* return value is for success or failure */ -static gboolean -get_size_and_length(TreeState *state, IDL_tree type, - int16 *size_is_argnum, int16 *length_is_argnum, - gboolean *has_size_is, gboolean *has_length_is) +static int get_size_and_length(PXPIDLTYPELIBSTATE pThis, PCXPIDLNODE pNdType, + int16 *size_is_argnum, int16 *length_is_argnum, + bool *has_size_is, bool *has_length_is) { - *has_size_is = FALSE; - *has_length_is = FALSE; - - if (IDL_NODE_TYPE(state->tree) == IDLN_PARAM_DCL) { - IDL_tree sd = IDL_PARAM_DCL(state->tree).simple_declarator; - const char *size_is; - const char *length_is; + *has_size_is = false; + *has_length_is = false; + if (pNdType->enmType == kXpidlNdType_Parameter) + { /* only if size_is is found does any of this matter */ - size_is = IDL_tree_property_get(sd, "size_is"); - if (!size_is) - return TRUE; + PCXPIDLATTR pAttr = xpidlNodeAttrFind(pNdType, "size_is"); + if (!pAttr) + return true; + if (!pAttr->pszVal) /* Attribute needs a value. */ + return false; - if (!find_arg_with_name(state, size_is, size_is_argnum)) { - IDL_tree_error(state->tree, "can't find matching argument for " - "[size_is(%s)]\n", size_is); - return FALSE; - } - *has_size_is = TRUE; + if (!find_arg_with_name(pNdType, pAttr->pszVal, size_is_argnum)) + return xpidlIdlError(pThis->pErrInfo, NULL /*pNd*/, VERR_INVALID_STATE, + "can't find matching argument for [size_is(%s)]", pAttr->pszVal); + *has_size_is = true; /* length_is is optional */ - length_is = IDL_tree_property_get(sd, "length_is"); - if (length_is) { - *has_length_is = TRUE; - if (!find_arg_with_name(state, length_is, length_is_argnum)) { - IDL_tree_error(state->tree, "can't find matching argument for " - "[length_is(%s)]\n", length_is); - return FALSE; - } - } + pAttr = xpidlNodeAttrFind(pNdType, "length_is"); + if (!pAttr) + return true; + if (!pAttr->pszVal) /* Attribute needs a value. */ + return false; + + if (!find_arg_with_name(pNdType, pAttr->pszVal, length_is_argnum)) + return xpidlIdlError(pThis->pErrInfo, NULL /*pNd*/, VERR_INVALID_STATE, + "can't find matching argument for [length_is(%s)]\n", pAttr->pszVal); + *has_length_is = true; } - return TRUE; + + return VINF_SUCCESS; } -static gboolean -fill_td_from_type(TreeState *state, XPTTypeDescriptor *td, IDL_tree type) + +static int fill_td_from_type(PXPIDLTYPELIBSTATE pThis, XPTTypeDescriptor *td, PCXPIDLNODE pNdType) { - IDL_tree up; int16 size_is_argnum; int16 length_is_argnum; - gboolean has_size_is; - gboolean has_length_is; - gboolean is_array = FALSE; + bool has_size_is; + bool has_length_is; + bool is_array = false; - if (type) { + if ( pNdType->enmType == kXpidlNdType_BaseType + && pNdType->u.enmBaseType == kXpidlType_Void) + td->prefix.flags = TD_VOID; + else + { + PCXPIDLNODE pNdParam = NULL; + if ( pNdType->pParent + && pNdType->pParent->enmType == kXpidlNdType_Parameter) + pNdParam = pNdType->pParent; - /* deal with array */ + if ( pNdParam + && xpidlNodeAttrFind(pNdParam, "array")) + { + is_array = true; - if (IDL_NODE_TYPE(state->tree) == IDLN_PARAM_DCL) { - IDL_tree sd = IDL_PARAM_DCL(state->tree).simple_declarator; - if (IDL_tree_property_get(sd, "array")) { - - is_array = TRUE; - - /* size_is is required! */ - if (!get_size_and_length(state, type, + /* size_is is required! */ + int rc = get_size_and_length(pThis, pNdParam, &size_is_argnum, &length_is_argnum, - &has_size_is, &has_length_is)) { - /* error was reported by helper function */ - return FALSE; - } + &has_size_is, &has_length_is); + if (RT_FAILURE(rc)) + return rc; /* error was reported by helper function */ - if (!has_size_is) { - IDL_tree_error(state->tree, "[array] requires [size_is()]\n"); - return FALSE; - } + if (!has_size_is) + return xpidlIdlError(pThis->pErrInfo, NULL /*pNd*/, VERR_NOT_FOUND, + "[array] requires [size_is()]\n"); - td->prefix.flags = TD_ARRAY | XPT_TDP_POINTER; - td->argnum = size_is_argnum; + td->prefix.flags = TD_ARRAY | XPT_TDP_POINTER; + td->argnum = size_is_argnum; - if (has_length_is) - td->argnum2 = length_is_argnum; - else - td->argnum2 = size_is_argnum; + if (has_length_is) + td->argnum2 = length_is_argnum; + else + td->argnum2 = size_is_argnum; - /* - * XXX - NOTE - this will be broken for multidimensional - * arrays because of the realloc XPT_InterfaceDescriptorAddTypes - * uses. The underlying 'td' can change as we recurse in to get - * additional dimensions. Luckily, we don't yet support more - * than on dimension in the arrays - */ - /* setup the additional_type */ - if (!XPT_InterfaceDescriptorAddTypes(ARENA(state), - CURRENT(state), 1)) { - g_error("out of memory\n"); - return FALSE; - } - td->type.additional_type = NEXT_TYPE(state); - td = &CURRENT(state)->additional_types[NEXT_TYPE(state)]; - NEXT_TYPE(state)++ ; - } + /* + * XXX - NOTE - this will be broken for multidimensional + * arrays because of the realloc XPT_InterfaceDescriptorAddTypes + * uses. The underlying 'td' can change as we recurse in to get + * additional dimensions. Luckily, we don't yet support more + * than on dimension in the arrays + */ + /* setup the additional_type */ + if (!XPT_InterfaceDescriptorAddTypes(ARENA(pThis), CURRENT(pThis), 1)) + return xpidlIdlError(pThis->pErrInfo, pNdType, VERR_NO_MEMORY, + "Failed to add types to interface descriptor\n"); + + td->type.additional_type = NEXT_TYPE(pThis); + td = &CURRENT(pThis)->additional_types[NEXT_TYPE(pThis)]; + NEXT_TYPE(pThis)++ ; } handle_typedef: - switch (IDL_NODE_TYPE(type)) { - case IDLN_TYPE_INTEGER: { - gboolean sign = IDL_TYPE_INTEGER(type).f_signed; - switch(IDL_TYPE_INTEGER(type).f_type) { - case IDL_INTEGER_TYPE_SHORT: - td->prefix.flags = sign ? TD_INT16 : TD_UINT16; - break; - case IDL_INTEGER_TYPE_LONG: - td->prefix.flags = sign ? TD_INT32 : TD_UINT32; - break; - case IDL_INTEGER_TYPE_LONGLONG: - td->prefix.flags = sign ? TD_INT64 : TD_UINT64; - break; - } - break; - } - case IDLN_TYPE_CHAR: - td->prefix.flags = TD_CHAR; - break; - case IDLN_TYPE_WIDE_CHAR: - td->prefix.flags = TD_WCHAR; - break; - case IDLN_TYPE_STRING: - if (is_array) { - td->prefix.flags = TD_PSTRING | XPT_TDP_POINTER; - } else { - if (!get_size_and_length(state, type, - &size_is_argnum, &length_is_argnum, - &has_size_is, &has_length_is)) { - /* error was reported by helper function */ - return FALSE; - } - if (has_size_is) { - td->prefix.flags = TD_PSTRING_SIZE_IS | XPT_TDP_POINTER; - td->argnum = size_is_argnum; - if (has_length_is) - td->argnum2 = length_is_argnum; + if (pNdType->enmType == kXpidlNdType_BaseType) + { + switch (pNdType->u.enmBaseType) + { + case kXpidlType_Boolean: + td->prefix.flags = TD_BOOL; + break; + case kXpidlType_Octet: + td->prefix.flags = TD_UINT8; + break; + case kXpidlType_Char: + td->prefix.flags = TD_CHAR; + break; + case kXpidlType_Wide_Char: + td->prefix.flags = TD_WCHAR; + break; + case kXpidlType_Short: + td->prefix.flags = TD_INT16; + break; + case kXpidlType_Long: + td->prefix.flags = TD_INT32; + break; + case kXpidlType_Long_Long: + td->prefix.flags = TD_INT64; + break; + case kXpidlType_Unsigned_Short: + td->prefix.flags = TD_UINT16; + break; + case kXpidlType_Unsigned_Long: + td->prefix.flags = TD_UINT32; + break; + case kXpidlType_Unsigned_Long_Long: + td->prefix.flags = TD_UINT64; + break; + case kXpidlType_String: + if (is_array) + td->prefix.flags = TD_PSTRING | XPT_TDP_POINTER; else - td->argnum2 = size_is_argnum; - } else { - td->prefix.flags = TD_PSTRING | XPT_TDP_POINTER; - } - } - break; - case IDLN_TYPE_WIDE_STRING: - if (is_array) { - td->prefix.flags = TD_PWSTRING | XPT_TDP_POINTER; - } else { - if (!get_size_and_length(state, type, - &size_is_argnum, &length_is_argnum, - &has_size_is, &has_length_is)) { - /* error was reported by helper function */ - return FALSE; - } - if (has_size_is) { - td->prefix.flags = TD_PWSTRING_SIZE_IS | XPT_TDP_POINTER; - td->argnum = size_is_argnum; - if (has_length_is) - td->argnum2 = length_is_argnum; + { + int rc = get_size_and_length(pThis, pNdType, + &size_is_argnum, &length_is_argnum, + &has_size_is, &has_length_is); + if (RT_FAILURE(rc)) + return rc; /* error was reported by helper function */ + + if (has_size_is) + { + td->prefix.flags = TD_PSTRING_SIZE_IS | XPT_TDP_POINTER; + td->argnum = size_is_argnum; + if (has_length_is) + td->argnum2 = length_is_argnum; + else + td->argnum2 = size_is_argnum; + } + else + td->prefix.flags = TD_PSTRING | XPT_TDP_POINTER; + } + break; + case kXpidlType_Wide_String: + if (is_array) + td->prefix.flags = TD_PWSTRING | XPT_TDP_POINTER; else - td->argnum2 = size_is_argnum; - } else { - td->prefix.flags = TD_PWSTRING | XPT_TDP_POINTER; - } + { + int rc = get_size_and_length(pThis, pNdType, + &size_is_argnum, &length_is_argnum, + &has_size_is, &has_length_is); + if (RT_FAILURE(rc)) + return rc; /* error was reported by helper function */ + + if (has_size_is) + { + td->prefix.flags = TD_PWSTRING_SIZE_IS | XPT_TDP_POINTER; + td->argnum = size_is_argnum; + if (has_length_is) + td->argnum2 = length_is_argnum; + else + td->argnum2 = size_is_argnum; + } + else + td->prefix.flags = TD_PWSTRING | XPT_TDP_POINTER; + } + break; + case kXpidlType_Double: + td->prefix.flags = TD_DOUBLE; + break; + case kXpidlType_Float: + td->prefix.flags = TD_FLOAT; + break; + default: + AssertReleaseFailed(); } - break; - case IDLN_TYPE_BOOLEAN: - td->prefix.flags = TD_BOOL; - break; - case IDLN_TYPE_OCTET: - td->prefix.flags = TD_UINT8; - break; - case IDLN_TYPE_FLOAT: - switch (IDL_TYPE_FLOAT (type).f_type) { - case IDL_FLOAT_TYPE_FLOAT: - td->prefix.flags = TD_FLOAT; - break; - case IDL_FLOAT_TYPE_DOUBLE: - td->prefix.flags = TD_DOUBLE; - break; - /* XXX 'long double' just ignored, or what? */ - default: break; - } - break; - case IDLN_IDENT: - if (!(up = IDL_NODE_UP(type))) { - IDL_tree_error(state->tree, - "ERROR: orphan ident %s in param list\n", - IDL_IDENT(type).str); - return FALSE; - } - switch (IDL_NODE_TYPE(up)) { - /* This whole section is abominably ugly */ - case IDLN_FORWARD_DCL: - case IDLN_INTERFACE: { - XPTInterfaceDirectoryEntry *ide, *ides; - uint16 num_ifaces; - char *className; - const char *iid_is; + } + else if (pNdType->enmType == kXpidlNdType_Identifier) + { + if (!pNdType->pNdTypeRef) + return xpidlIdlError(pThis->pErrInfo, pNdType, VERR_NOT_FOUND, + "ERROR: orphan ident %s in param list\n", pNdType->u.pszIde); + + /* This whole section is abominably ugly */ + PCXPIDLNODE pNdTypeRef = pNdType->pNdTypeRef; + switch (pNdTypeRef->enmType) + { + case kXpidlNdType_Interface_Forward_Decl: + case kXpidlNdType_Interface_Def: + { + XPTInterfaceDirectoryEntry *ide, *ides; + uint16 num_ifaces; + const char *className; + const char *iid_is; handle_iid_is: - ides = HEADER(state)->interface_directory; - num_ifaces = HEADER(state)->num_interfaces; - /* might get here via the goto, so re-check type */ - if (IDL_NODE_TYPE(up) == IDLN_INTERFACE) - className = IDL_IDENT(IDL_INTERFACE(up).ident).str; - else if (IDL_NODE_TYPE(up) == IDLN_FORWARD_DCL) - className = IDL_IDENT(IDL_FORWARD_DCL(up).ident).str; - else - className = IDL_IDENT(IDL_NATIVE(up).ident).str; - iid_is = NULL; + className = NULL; + ides = HEADER(pThis)->interface_directory; + num_ifaces = HEADER(pThis)->num_interfaces; + /* might get here via the goto, so re-check type */ + if (pNdTypeRef->enmType == kXpidlNdType_Interface_Def) + className = pNdTypeRef->u.If.pszIfName; + else if (pNdTypeRef->enmType == kXpidlNdType_Interface_Forward_Decl) + className = pNdTypeRef->u.pszIfFwdName; + else + Assert( pNdParam + && xpidlNodeAttrFind(pNdParam, "iid_is")); //className = IDL_IDENT(IDL_NATIVE(up).ident).str; + iid_is = NULL; - if (IDL_NODE_TYPE(state->tree) == IDLN_PARAM_DCL) { - iid_is = - IDL_tree_property_get(IDL_PARAM_DCL(state->tree).simple_declarator, - "iid_is"); - } - if (iid_is) { - int16 argnum; - if (!find_arg_with_name(state, iid_is, &argnum)) { - IDL_tree_error(state->tree, - "can't find matching argument for " - "[iid_is(%s)]\n", iid_is); - return FALSE; + if (pNdParam) + { + PCXPIDLATTR pAttr = xpidlNodeAttrFind(pNdParam, "iid_is"); + if (pAttr) + { + if (!pAttr->pszVal) /* iid_is requires a value */ + return false; + iid_is = pAttr->pszVal; + } } - td->prefix.flags = TD_INTERFACE_IS_TYPE | XPT_TDP_POINTER; - td->argnum = argnum; - } else { - td->prefix.flags = TD_INTERFACE_TYPE | XPT_TDP_POINTER; - ide = FindInterfaceByName(ides, num_ifaces, className); - if (!ide || ide < ides || ide > ides + num_ifaces) { - IDL_tree_error(state->tree, - "unknown iface %s in param\n", - className); - return FALSE; - } - td->type.iface = ide - ides + 1; + + if (iid_is) { + int16 argnum; + if (!find_arg_with_name(pNdParam, iid_is, &argnum)) + return xpidlIdlError(pThis->pErrInfo, pNdParam, VERR_NOT_FOUND, + "can't find matching argument for [iid_is(%s)]", iid_is); + + td->prefix.flags = TD_INTERFACE_IS_TYPE | XPT_TDP_POINTER; + td->argnum = argnum; + } else { + td->prefix.flags = TD_INTERFACE_TYPE | XPT_TDP_POINTER; + ide = FindInterfaceByName(ides, num_ifaces, className, NULL); + if (!ide || ide < ides || ide > ides + num_ifaces) + return xpidlIdlError(pThis->pErrInfo, pNdParam, VERR_NOT_FOUND, + "unknown iface %s in param\n", className); + + td->type.iface = ide - ides + 1; #ifdef DEBUG_shaver_index - fprintf(stderr, "DBG: index %d for %s\n", - td->type.iface, className); + fprintf(stderr, "DBG: index %d for %s\n", + td->type.iface, className); #endif + } + break; } - break; - } - case IDLN_NATIVE: - { + case kXpidlNdType_Native: + { + /* jband - adding goto for iid_is when type is native */ + if ( pNdParam + && xpidlNodeAttrFind(pNdParam, "iid_is")) + goto handle_iid_is; - /* jband - adding goto for iid_is when type is native */ - if (IDL_NODE_TYPE(state->tree) == IDLN_PARAM_DCL && - IDL_tree_property_get(IDL_PARAM_DCL(state->tree).simple_declarator, - "iid_is")) - goto handle_iid_is; - - if (IDL_tree_property_get(type, "nsid")) { - td->prefix.flags = TD_PNSIID; - if (IDL_tree_property_get(type, "ref")) - td->prefix.flags |= XPT_TDP_POINTER | XPT_TDP_REFERENCE; - else if (IDL_tree_property_get(type,"ptr")) - td->prefix.flags |= XPT_TDP_POINTER; - } else if (IDL_tree_property_get(type, "domstring")) { - td->prefix.flags = TD_DOMSTRING | XPT_TDP_POINTER; - if (IDL_tree_property_get(type, "ref")) - td->prefix.flags |= XPT_TDP_REFERENCE; - } else if (IDL_tree_property_get(type, "astring")) { - td->prefix.flags = TD_ASTRING | XPT_TDP_POINTER; - if (IDL_tree_property_get(type, "ref")) - td->prefix.flags |= XPT_TDP_REFERENCE; - } else if (IDL_tree_property_get(type, "utf8string")) { - td->prefix.flags = TD_UTF8STRING | XPT_TDP_POINTER; - if (IDL_tree_property_get(type, "ref")) - td->prefix.flags |= XPT_TDP_REFERENCE; - } else if (IDL_tree_property_get(type, "cstring")) { - td->prefix.flags = TD_CSTRING | XPT_TDP_POINTER; - if (IDL_tree_property_get(type, "ref")) - td->prefix.flags |= XPT_TDP_REFERENCE; - } else { - td->prefix.flags = TD_VOID | XPT_TDP_POINTER; - } - break; + if (xpidlNodeAttrFind(pNdTypeRef, "nsid")) { + td->prefix.flags = TD_PNSIID; + if (xpidlNodeAttrFind(pNdTypeRef, "ref")) + td->prefix.flags |= XPT_TDP_POINTER | XPT_TDP_REFERENCE; + else if (xpidlNodeAttrFind(pNdTypeRef,"ptr")) + td->prefix.flags |= XPT_TDP_POINTER; + } else if (xpidlNodeAttrFind(pNdTypeRef, "domstring")) { + td->prefix.flags = TD_DOMSTRING | XPT_TDP_POINTER; + if (xpidlNodeAttrFind(pNdTypeRef, "ref")) + td->prefix.flags |= XPT_TDP_REFERENCE; + } else if (xpidlNodeAttrFind(pNdTypeRef, "astring")) { + td->prefix.flags = TD_ASTRING | XPT_TDP_POINTER; + if (xpidlNodeAttrFind(pNdTypeRef, "ref")) + td->prefix.flags |= XPT_TDP_REFERENCE; + } else if (xpidlNodeAttrFind(pNdTypeRef, "utf8string")) { + td->prefix.flags = TD_UTF8STRING | XPT_TDP_POINTER; + if (xpidlNodeAttrFind(pNdTypeRef, "ref")) + td->prefix.flags |= XPT_TDP_REFERENCE; + } else if (xpidlNodeAttrFind(pNdTypeRef, "cstring")) { + td->prefix.flags = TD_CSTRING | XPT_TDP_POINTER; + if (xpidlNodeAttrFind(pNdTypeRef, "ref")) + td->prefix.flags |= XPT_TDP_REFERENCE; + } else { + td->prefix.flags = TD_VOID | XPT_TDP_POINTER; + } + break; } - default: - if (IDL_NODE_TYPE(IDL_NODE_UP(up)) == IDLN_TYPE_DCL) { + case kXpidlNdType_Typedef: + { /* restart with the underlying type */ - IDL_tree new_type; - new_type = IDL_TYPE_DCL(IDL_NODE_UP(up)).type_spec; + #ifdef DEBUG_shaver_misc - fprintf(stderr, "following %s typedef to %s\n", - IDL_IDENT(type).str, IDL_NODE_TYPE_NAME(new_type)); + fprintf(stderr, "following %s typedef to %u\n", + pNdType->u.Typedef.pszName, pNdType->u.Typedef.pNodeTypeSpec); #endif /* * Do a nice messy goto rather than recursion so that * we can avoid screwing up the *array* information. */ -/* return fill_td_from_type(state, td, new_type); */ - if (new_type) { - type = new_type; + if (pNdTypeRef->u.Typedef.pNodeTypeSpec) + { + pNdType = pNdTypeRef->u.Typedef.pNodeTypeSpec; goto handle_typedef; - } else { + } + else + { /* do what we would do in recursion if !type */ td->prefix.flags = TD_VOID; - return TRUE; + return VINF_SUCCESS; } } - IDL_tree_error(state->tree, - "can't handle %s ident in param list\n", -#ifdef DEBUG_shaver - /* XXX is this safe to use on Win now? */ - IDL_NODE_TYPE_NAME(IDL_NODE_UP(type)) -#else - "that type of" -#endif - ); -#ifdef DEBUG_shaver - XPT_ASSERT(0); -#endif - return FALSE; + default: + xpidlIdlError(pThis->pErrInfo, pNdType, VERR_INTERNAL_ERROR, + "can't handle %s ident in param list\n", + pNdType->u.pszIde); + AssertFailedReturn(VERR_INTERNAL_ERROR); } - break; - default: - IDL_tree_error(state->tree, "can't handle %s in param list\n", -#ifdef DEBUG_shaver - /* XXX is this safe to use on Win now? */ - IDL_NODE_TYPE_NAME(IDL_NODE_UP(type)) -#else - "that type" -#endif - ); - return FALSE; } - } else { - td->prefix.flags = TD_VOID; + else + AssertFailedReturn(VERR_INTERNAL_ERROR); } - return TRUE; + return VINF_SUCCESS; } -static gboolean -fill_pd_from_type(TreeState *state, XPTParamDescriptor *pd, uint8 flags, - IDL_tree type) + +static int fill_pd_from_type(PXPIDLTYPELIBSTATE pThis, XPTParamDescriptor *pd, uint8 flags, PCXPIDLNODE pNd) { pd->flags = flags; - return fill_td_from_type(state, &pd->type, type); + return fill_td_from_type(pThis, &pd->type, pNd); } -static gboolean -fill_pd_from_param(TreeState *state, XPTParamDescriptor *pd, IDL_tree tree) +static int fill_pd_from_param(PXPIDLTYPELIBSTATE pThis, XPTParamDescriptor *pd, PCXPIDLNODE pNd) { uint8 flags = 0; - gboolean is_dipper_type = DIPPER_TYPE(IDL_PARAM_DCL(tree).param_type_spec); + bool is_dipper_type = DIPPER_TYPE(pNd->u.Param.pNdTypeSpec); - switch (IDL_PARAM_DCL(tree).attr) { - case IDL_PARAM_IN: - flags = XPT_PD_IN; - break; - case IDL_PARAM_OUT: - flags = XPT_PD_OUT; - break; - case IDL_PARAM_INOUT: - flags = XPT_PD_IN | XPT_PD_OUT; - break; + switch (pNd->u.Param.enmDir) + { + case kXpidlDirection_In: + flags = XPT_PD_IN; + break; + case kXpidlDirection_Out: + flags = XPT_PD_OUT; + break; + case kXpidlDirection_InOut: + flags = XPT_PD_IN | XPT_PD_OUT; + break; + default: + AssertReleaseFailed(); } - if (IDL_tree_property_get(IDL_PARAM_DCL(tree).simple_declarator, - "retval")) { - if (flags != XPT_PD_OUT) { - IDL_tree_error(tree, "can't have [retval] with in%s param " - "(only out)\n", - flags & XPT_PD_OUT ? "out" : ""); - return FALSE; - } + if (xpidlNodeAttrFind(pNd, "retval")) + { + if (flags != XPT_PD_OUT) + return xpidlIdlError(pThis->pErrInfo, NULL /*pNd*/, VERR_INVALID_STATE, + "can't have [retval] with in%s param (only out)", + flags & XPT_PD_OUT ? "out" : ""); + flags |= XPT_PD_RETVAL; } - if (is_dipper_type && (flags & XPT_PD_OUT)) { + if (is_dipper_type && (flags & XPT_PD_OUT)) + { flags &= ~XPT_PD_OUT; flags |= XPT_PD_IN | XPT_PD_DIPPER; } - if (IDL_tree_property_get(IDL_PARAM_DCL(tree).simple_declarator, - "shared")) { - if (flags & XPT_PD_IN) { - IDL_tree_error(tree, "can't have [shared] with in%s param " - "(only out)\n", - flags & XPT_PD_OUT ? "out" : ""); - return FALSE; - } + if (xpidlNodeAttrFind(pNd, "shared")) + { + if (flags & XPT_PD_IN) + return xpidlIdlError(pThis->pErrInfo, NULL /*pNd*/, VERR_INVALID_STATE, + "can't have [shared] with in%s param (only out)", + flags & XPT_PD_OUT ? "out" : ""); + flags |= XPT_PD_SHARED; } - /* stick param where we can see it later */ - state->tree = tree; - return fill_pd_from_type(state, pd, flags, - IDL_PARAM_DCL(tree).param_type_spec); + return fill_pd_from_type(pThis, pd, flags, pNd->u.Param.pNdTypeSpec); } -/* XXXshaver common with xpidl_header.c */ -#define ATTR_IDENT(tree) (IDL_IDENT(IDL_LIST(IDL_ATTR_DCL(tree).simple_declarations).data)) -#define ATTR_TYPE_DECL(tree) (IDL_ATTR_DCL(tree).param_type_spec) -#define ATTR_TYPE(tree) (IDL_NODE_TYPE(ATTR_TYPE_DECL(tree))) -static gboolean -fill_pd_as_nsresult(XPTParamDescriptor *pd) +static int fill_pd_as_nsresult(XPTParamDescriptor *pd) { pd->type.prefix.flags = TD_UINT32; /* TD_NSRESULT */ - return TRUE; + return VINF_SUCCESS; } -static gboolean -typelib_attr_accessor(TreeState *state, XPTMethodDescriptor *meth, - gboolean getter, gboolean hidden) +static int typelib_attr_accessor(PXPIDLTYPELIBSTATE pThis, PCXPIDLNODE pNd, + XPTMethodDescriptor *meth, bool getter, bool hidden) { uint8 methflags = 0; uint8 pdflags = 0; methflags |= getter ? XPT_MD_GETTER : XPT_MD_SETTER; methflags |= hidden ? XPT_MD_HIDDEN : 0; - if (!XPT_FillMethodDescriptor(ARENA(state), meth, methflags, - ATTR_IDENT(state->tree).str, 1)) - return FALSE; + if (!XPT_FillMethodDescriptor(ARENA(pThis), meth, methflags, + (char *)pNd->u.Attribute.pszName, 1)) + return xpidlIdlError(pThis->pErrInfo, pNd, VERR_NO_MEMORY, + "Failed to fill method descriptor for attribute '%s'", + pNd->u.Attribute.pszName); - if (getter) { - if (DIPPER_TYPE(ATTR_TYPE_DECL(state->tree))) { + if (getter) + { + if (DIPPER_TYPE(pNd->u.Attribute.pNdTypeSpec)) pdflags |= (XPT_PD_RETVAL | XPT_PD_IN | XPT_PD_DIPPER); - } else { + else pdflags |= (XPT_PD_RETVAL | XPT_PD_OUT); - } - } else { - pdflags |= XPT_PD_IN; + } + else + pdflags |= XPT_PD_IN; - if (!fill_pd_from_type(state, meth->params, pdflags, - ATTR_TYPE_DECL(state->tree))) - return FALSE; + int rc = fill_pd_from_type(pThis, meth->params, pdflags, pNd->u.Attribute.pNdTypeSpec); + if (RT_FAILURE(rc)) + return rc; /* error info already set. */ fill_pd_as_nsresult(meth->result); - NEXT_METH(state)++; - return TRUE; + NEXT_METH(pThis)++; + return VINF_SUCCESS; } -static gboolean -typelib_attr_dcl(TreeState *state) -{ - XPTInterfaceDescriptor *id = CURRENT(state); - XPTMethodDescriptor *meth; - gboolean read_only = IDL_ATTR_DCL(state->tree).f_readonly; - /* XXX this only handles the first ident; elsewhere too... */ - IDL_tree ident = - IDL_LIST(IDL_ATTR_DCL(state->tree).simple_declarations).data; +static int xpidlTypelibProcessAttr(PXPIDLTYPELIBSTATE pThis, PCXPIDLNODE pNd) +{ + XPTInterfaceDescriptor *id = CURRENT(pThis); + XPTMethodDescriptor *meth; /* If it's marked [noscript], mark it as hidden in the typelib. */ - gboolean hidden = (IDL_tree_property_get(ident, "noscript") != NULL); + bool hidden = (xpidlNodeAttrFind(pNd, "noscript") != NULL); - if (!verify_attribute_declaration(state->tree)) - return FALSE; + int rc = verify_attribute_declaration(pNd, pThis->pErrInfo); + if (RT_FAILURE(rc)) + return rc; - if (!XPT_InterfaceDescriptorAddMethods(ARENA(state), id, - (PRUint16) (read_only ? 1 : 2))) - return FALSE; + if (!XPT_InterfaceDescriptorAddMethods(ARENA(pThis), id, + (PRUint16) (pNd->u.Attribute.fReadonly ? 1 : 2))) + return VERR_NO_MEMORY; - meth = &id->method_descriptors[NEXT_METH(state)]; + meth = &id->method_descriptors[NEXT_METH(pThis)]; - return typelib_attr_accessor(state, meth, TRUE, hidden) && - (read_only || typelib_attr_accessor(state, meth + 1, FALSE, hidden)); + rc = typelib_attr_accessor(pThis, pNd, meth, true, hidden); + if (RT_FAILURE(rc)) + return rc; + + if (!pNd->u.Attribute.fReadonly) + { + rc = typelib_attr_accessor(pThis, pNd, meth + 1, false, hidden); + if (RT_FAILURE(rc)) + return rc; + } + + return VINF_SUCCESS; } -static gboolean -typelib_op_dcl(TreeState *state) + +static int xpidlTypelibProcessMethod(PXPIDLTYPELIBSTATE pThis, PCXPIDLNODE pNd) { - XPTInterfaceDescriptor *id = CURRENT(state); + XPTInterfaceDescriptor *id = CURRENT(pThis); XPTMethodDescriptor *meth; - struct _IDL_OP_DCL *op = &IDL_OP_DCL(state->tree); - IDL_tree iter; uint16 num_args = 0; uint8 op_flags = 0; - gboolean op_notxpcom = (IDL_tree_property_get(op->ident, "notxpcom") - != NULL); - gboolean op_noscript = (IDL_tree_property_get(op->ident, "noscript") - != NULL); + bool op_notxpcom = (xpidlNodeAttrFind(pNd, "notxpcom") != NULL); + bool op_noscript = (xpidlNodeAttrFind(pNd, "noscript") != NULL); - if (!verify_method_declaration(state->tree)) - return FALSE; + int rc = verify_method_declaration(pNd, pThis->pErrInfo); + if (RT_FAILURE(rc)) + return rc; - if (!XPT_InterfaceDescriptorAddMethods(ARENA(state), id, 1)) - return FALSE; + if (!XPT_InterfaceDescriptorAddMethods(ARENA(pThis), id, 1)) + return VERR_NO_MEMORY; - meth = &id->method_descriptors[NEXT_METH(state)]; + meth = &id->method_descriptors[NEXT_METH(pThis)]; - for (iter = op->parameter_dcls; iter; iter = IDL_LIST(iter).next) - num_args++; /* count params */ - if (op->op_type_spec && !op_notxpcom) + /* count params */ + PCXPIDLNODE pIt; + RTListForEach(&pNd->u.Method.LstParams, pIt, XPIDLNODE, NdLst) + { + num_args++; + } + if ( !op_notxpcom + && pNd->u.Method.pNdTypeSpecRet + && ( pNd->u.Method.pNdTypeSpecRet->enmType != kXpidlNdType_BaseType + || pNd->u.Method.pNdTypeSpecRet->u.enmBaseType != kXpidlType_Void)) num_args++; /* fake param for _retval */ if (op_noscript) @@ -1094,131 +1043,219 @@ typelib_op_dcl(TreeState *state) #ifdef DEBUG_shaver_method fprintf(stdout, "DBG: adding method %s (nargs %d)\n", - IDL_IDENT(op->ident).str, num_args); + pNd->u.Method.pszName, num_args); #endif - if (!XPT_FillMethodDescriptor(ARENA(state), meth, op_flags, - IDL_IDENT(op->ident).str, + if (!XPT_FillMethodDescriptor(ARENA(pThis), meth, op_flags, + (char *)pNd->u.Method.pszName, (uint8) num_args)) - return FALSE; + return VERR_INVALID_PARAMETER; - for (num_args = 0, iter = op->parameter_dcls; iter; - iter = IDL_LIST(iter).next, num_args++) { - XPTParamDescriptor *pd = &meth->params[num_args]; - if (!fill_pd_from_param(state, pd, IDL_LIST(iter).data)) - return FALSE; + num_args = 0; + RTListForEach(&pNd->u.Method.LstParams, pIt, XPIDLNODE, NdLst) + { + XPTParamDescriptor *pd = &meth->params[num_args++]; + rc = fill_pd_from_param(pThis, pd, pIt); + if (RT_FAILURE(rc)) + return rc; } - /* stick retval param where we can see it later */ - state->tree = op->op_type_spec; - /* XXX unless [notxpcom] */ - if (!op_notxpcom) { - if (op->op_type_spec) { - uint8 pdflags = DIPPER_TYPE(op->op_type_spec) ? + if (!op_notxpcom) + { + if ( pNd->u.Method.pNdTypeSpecRet + && ( pNd->u.Method.pNdTypeSpecRet->enmType != kXpidlNdType_BaseType + || pNd->u.Method.pNdTypeSpecRet->u.enmBaseType != kXpidlType_Void)) + { + uint8 pdflags = DIPPER_TYPE(pNd) ? (XPT_PD_RETVAL | XPT_PD_IN | XPT_PD_DIPPER) : (XPT_PD_RETVAL | XPT_PD_OUT); - if (!fill_pd_from_type(state, &meth->params[num_args], - pdflags, op->op_type_spec)) - return FALSE; + rc = fill_pd_from_type(pThis, &meth->params[num_args], pdflags, pNd->u.Method.pNdTypeSpecRet); + if (RT_FAILURE(rc)) + return rc; } - if (!fill_pd_as_nsresult(meth->result)) - return FALSE; - } else { -#ifdef DEBUG_shaver_notxpcom - fprintf(stderr, "%s is notxpcom\n", IDL_IDENT(op->ident).str); -#endif - if (!fill_pd_from_type(state, meth->result, XPT_PD_RETVAL, - op->op_type_spec)) - return FALSE; + rc = fill_pd_as_nsresult(meth->result); + if (RT_FAILURE(rc)) + return rc; } - NEXT_METH(state)++; - return TRUE; + else + { +#ifdef DEBUG_shaver_notxpcom + fprintf(stderr, "%s is notxpcom\n", pNd->u.Method.pszName); +#endif + rc = fill_pd_from_type(pThis, meth->result, XPT_PD_RETVAL, + pNd->u.Method.pNdTypeSpecRet); + if (RT_FAILURE(rc)) + return rc; + } + NEXT_METH(pThis)++; + return VINF_SUCCESS; } -static gboolean -typelib_const_dcl(TreeState *state) + +static int xpidlTypelibProcessConst(PXPIDLTYPELIBSTATE pThis, PCXPIDLNODE pNd) { - struct _IDL_CONST_DCL *dcl = &IDL_CONST_DCL(state->tree); - gboolean is_long; - gboolean sign; - IDL_tree real_type; + bool is_long; XPTInterfaceDescriptor *id; XPTConstDescriptor *cd; - IDL_longlong_t value; - if (!verify_const_declaration(state->tree)) - return FALSE; + int rc = verify_const_declaration(pNd, pThis->pErrInfo); + if (RT_FAILURE(rc)) + return rc; /* Could be a typedef; try to map it to the real type. */ - real_type = find_underlying_type(dcl->const_type); - real_type = real_type ? real_type : dcl->const_type; - is_long = (IDL_TYPE_INTEGER(real_type).f_type == IDL_INTEGER_TYPE_LONG); + PCXPIDLNODE pNdRealType = find_underlying_type(pNd->u.Const.pNdTypeSpec); + Assert(pNdRealType->enmType == kXpidlNdType_BaseType); + pNdRealType = pNdRealType ? pNdRealType : pNd->u.Const.pNdTypeSpec; + Assert( pNdRealType->u.enmBaseType == kXpidlType_Long + || pNdRealType->u.enmBaseType == kXpidlType_Short + || pNdRealType->u.enmBaseType == kXpidlType_Unsigned_Long + || pNdRealType->u.enmBaseType == kXpidlType_Unsigned_Short); + is_long = pNdRealType->u.enmBaseType == kXpidlType_Long + || pNdRealType->u.enmBaseType == kXpidlType_Unsigned_Long; - id = CURRENT(state); - if (!XPT_InterfaceDescriptorAddConsts(ARENA(state), id, 1)) - return FALSE; - cd = &id->const_descriptors[NEXT_CONST(state)]; + id = CURRENT(pThis); + if (!XPT_InterfaceDescriptorAddConsts(ARENA(pThis), id, 1)) + return VERR_NO_MEMORY; + cd = &id->const_descriptors[NEXT_CONST(pThis)]; - cd->name = IDL_IDENT(dcl->ident).str; + cd->name = (char *)pNd->u.Const.pszName; #ifdef DEBUG_shaver_const fprintf(stderr, "DBG: adding const %s\n", cd->name); #endif - if (!fill_td_from_type(state, &cd->type, dcl->const_type)) - return FALSE; + rc = fill_td_from_type(pThis, &cd->type, pNd->u.Const.pNdTypeSpec); + if (RT_FAILURE(rc)) + return rc; - value = IDL_INTEGER(dcl->const_exp).value; - sign = IDL_TYPE_INTEGER(dcl->const_type).f_signed; - if (is_long) { - if (sign) - cd->value.i32 = value; - else - cd->value.ui32 = value; - } else { - if (sign) - cd->value.i16 = value; - else - cd->value.ui16 = value; - } - NEXT_CONST(state)++; - return TRUE; + if (is_long) + cd->value.ui32 = (uint32_t)pNd->u.Const.u64Const; + else + cd->value.ui16 = (uint16_t)pNd->u.Const.u64Const; + + NEXT_CONST(pThis)++; + return VINF_SUCCESS; } -static gboolean -typelib_enum(TreeState *state) + +static int xpidlTypelibProcessIf(PXPIDLTYPELIBSTATE pThis, PCXPIDLNODE pNd) { - XPIDL_WARNING((state->tree, IDL_WARNING1, - "enums not supported, enum \'%s\' ignored", - IDL_IDENT(IDL_TYPE_ENUM(state->tree).ident).str)); - return TRUE; -} + char *name = (char *)pNd->u.If.pszIfName; + XPTInterfaceDirectoryEntry *ide; + XPTInterfaceDescriptor *id; + uint16_t parent_id = 0; + PRUint8 interface_flags = 0; -backend * -xpidl_typelib_dispatch(void) -{ - static backend result; - static nodeHandler table[IDLN_LAST]; - static gboolean initialized = FALSE; + int rc = verify_interface_declaration(pNd, pThis->pErrInfo); + if (RT_FAILURE(rc)) + return rc; - result.emit_prolog = typelib_prolog; - result.emit_epilog = typelib_epilog; + if (xpidlNodeAttrFind(pNd, "scriptable")) + interface_flags |= XPT_ID_SCRIPTABLE; - if (!initialized) { - /* Initialize non-NULL elements */ - table[IDLN_LIST] = typelib_list; - table[IDLN_ATTR_DCL] = typelib_attr_dcl; - table[IDLN_OP_DCL] = typelib_op_dcl; - table[IDLN_INTERFACE] = typelib_interface; - table[IDLN_CONST_DCL] = typelib_const_dcl; - table[IDLN_TYPE_ENUM] = typelib_enum; - table[IDLN_NATIVE] = check_native; - initialized = TRUE; + if (xpidlNodeAttrFind(pNd, "function")) + interface_flags |= XPT_ID_FUNCTION; + + ide = FindInterfaceByName(HEADER(pThis)->interface_directory, + HEADER(pThis)->num_interfaces, name, + NULL); + if (!ide) + return xpidlIdlError(pThis->pErrInfo, NULL /*pNd*/, VERR_NOT_FOUND, + "ERROR: didn't find interface %s in IDE block. Giving up.\n", + name); + + if (pNd->u.If.pszIfInherit) + { + if (!FindInterfaceByName(HEADER(pThis)->interface_directory, + HEADER(pThis)->num_interfaces, pNd->u.If.pszIfInherit, + &parent_id)) + return xpidlIdlError(pThis->pErrInfo, NULL /*pNd*/, VERR_NOT_FOUND, + "ERROR: no index found for %s. Giving up.\n", + pNd->u.If.pszIfInherit); } - result.dispatch_table = table; - return &result; + id = XPT_NewInterfaceDescriptor(ARENA(pThis), parent_id, 0, 0, + interface_flags); + if (!id) + return VERR_NO_MEMORY; + + CURRENT(pThis) = ide->interface_descriptor = id; +#ifdef DEBUG_shaver_ifaces + fprintf(stderr, "DBG: starting interface %s @ %p\n", name, id); +#endif + + NEXT_METH(pThis) = 0; + NEXT_CONST(pThis) = 0; + NEXT_TYPE(pThis) = 0; + + /* Walk the children and process. */ + PCXPIDLNODE pIt; + RTListForEach(&pNd->u.If.LstBody, pIt, XPIDLNODE, NdLst) + { + switch (pIt->enmType) + { + case kXpidlNdType_Attribute: + rc = xpidlTypelibProcessAttr(pThis, pIt); + break; + case kXpidlNdType_Method: + rc = xpidlTypelibProcessMethod(pThis, pIt); + break; + case kXpidlNdType_Const: + rc = xpidlTypelibProcessConst(pThis, pIt); + break; + case kXpidlNdType_RawBlock: + break; + default: + AssertReleaseFailed(); + break; + } + if (RT_FAILURE(rc)) + return rc; + } + +#ifdef DEBUG_shaver_ifaces + fprintf(stderr, "DBG: ending interface %s\n", name); +#endif + return VINF_SUCCESS; } +DECL_HIDDEN_CALLBACK(int) xpidl_typelib_dispatch(FILE *pFile, PCXPIDLINPUT pInput, PCXPIDLPARSE pParse, PRTERRINFO pErrInfo) +{ + XPIDLTYPELIBSTATE This; RT_ZERO(This); + This.pErrInfo = pErrInfo; + int rc = typelib_prolog(&This, pInput, pParse); + if (RT_SUCCESS(rc)) + { + PCXPIDLNODE pIt; + RTListForEach(&pParse->LstNodes, pIt, XPIDLNODE, NdLst) + { + if (pIt->pInput != pInput) + continue; + switch (pIt->enmType) + { + case kXpidlNdType_Native: + rc = check_native(pIt, pErrInfo); + break; + case kXpidlNdType_Interface_Def: + rc = xpidlTypelibProcessIf(&This, pIt); + break; + case kXpidlNdType_Interface_Forward_Decl: /* Ignored */ + case kXpidlNdType_Typedef: + case kXpidlNdType_RawBlock: + break; + default: + AssertReleaseFailed(); + break; + } + if (RT_FAILURE(rc)) + break; + } + + if (RT_SUCCESS(rc)) + rc = typelib_epilog(&This, pFile, pInput); + } + + return rc; +} diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_util.c b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_util.c index 575ef0af..95dd7ade 100644 --- a/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_util.c +++ b/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_util.c @@ -38,6 +38,8 @@ /* * Utility functions called by various backends. */ +#include +#include #include "xpidl.h" @@ -57,37 +59,21 @@ xpidl_malloc(size_t nbytes) char * xpidl_strdup(const char *s) { -#if defined(XP_MAC) || defined(XP_SOLARIS) /* bird: dunno why this is required, but whatever*/ - size_t len = strlen(s); - char *ns = malloc(len + 1); - if (ns) - memcpy(ns, s, len + 1); -#else - char *ns = strdup(s); -#endif - if (!ns) { + char *ns = RTStrDup(s); + if (!ns) + { fputs(OOM, stderr); exit(1); } return ns; } -void -xpidl_write_comment(TreeState *state, int indent) -{ - fprintf(state->file, "%*s/* ", indent, ""); - IDL_tree_to_IDL(state->tree, state->ns, state->file, - IDLF_OUTPUT_NO_NEWLINES | - IDLF_OUTPUT_NO_QUALIFY_IDENTS | - IDLF_OUTPUT_PROPERTIES); - fputs(" */\n", state->file); -} /* * Print an iid to into a supplied buffer; the buffer should be at least * UUID_LENGTH bytes. */ -gboolean +bool xpidl_sprint_iid(nsID *id, char iidbuf[]) { int printed; @@ -115,7 +101,7 @@ static const char nsIDFmt2[] = * Parse a uuid string into an nsID struct. We cannot link against libxpcom, * so we re-implement nsID::Parse here. */ -gboolean +bool xpidl_parse_iid(nsID *id, const char *str) { PRInt32 count = 0; @@ -125,7 +111,7 @@ xpidl_parse_iid(nsID *id, const char *str) XPT_ASSERT(str != NULL); if (strlen(str) != 36) { - return FALSE; + return false; } #ifdef DEBUG_shaver_iid @@ -133,9 +119,9 @@ xpidl_parse_iid(nsID *id, const char *str) #endif count = sscanf(str, nsIDFmt2, - &n0, &n1, &n2, - &n3[0],&n3[1],&n3[2],&n3[3], - &n3[4],&n3[5],&n3[6],&n3[7]); + (uint32_t *)&n0, (uint32_t *)&n1, (uint32_t *)&n2, + (uint32_t *)&n3[0],(uint32_t *)&n3[1],(uint32_t *)&n3[2],(uint32_t *)&n3[3], + (uint32_t *)&n3[4],(uint32_t *)&n3[5],(uint32_t *)&n3[6],(uint32_t *)&n3[7]); id->m0 = (PRInt32) n0; id->m1 = (PRInt16) n1; @@ -151,244 +137,132 @@ xpidl_parse_iid(nsID *id, const char *str) fputs("\n", stderr); } #endif - return (gboolean)(count == 11); + return (count == 11); } -gboolean -verify_const_declaration(IDL_tree const_tree) { - struct _IDL_CONST_DCL *dcl = &IDL_CONST_DCL(const_tree); - const char *name = IDL_IDENT(dcl->ident).str; - IDL_tree real_type; - - /* const -> list -> interface */ - if (!IDL_NODE_UP(IDL_NODE_UP(const_tree)) || - IDL_NODE_TYPE(IDL_NODE_UP(IDL_NODE_UP(const_tree))) - != IDLN_INTERFACE) { - IDL_tree_error(const_tree, - "const declaration \'%s\' outside interface", - name); - return FALSE; - } +DECLHIDDEN(int) verify_const_declaration(PCXPIDLNODE pNd, PRTERRINFO pErrInfo) +{ + /* const must be inside an interface definition. */ + if ( !pNd->pParent + || pNd->pParent->enmType != kXpidlNdType_Interface_Def) + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "const declaration \'%s\' outside interface", + pNd->u.Const.pszName); /* Could be a typedef; try to map it to the real type. */ - real_type = find_underlying_type(dcl->const_type); - real_type = real_type ? real_type : dcl->const_type; - if (IDL_NODE_TYPE(real_type) == IDLN_TYPE_INTEGER && - (IDL_TYPE_INTEGER(real_type).f_type == IDL_INTEGER_TYPE_SHORT || - IDL_TYPE_INTEGER(real_type).f_type == IDL_INTEGER_TYPE_LONG)) - { - if (!IDL_TYPE_INTEGER(real_type).f_signed && - IDL_INTEGER(dcl->const_exp).value < 0) - { -#ifndef G_HAVE_GINT64 - /* - * For platforms without longlong support turned on we can get - * confused by the high bit of the long value and think that it - * represents a negative value in an unsigned declaration. - * In that case we don't know if it is the programmer who is - * confused or the compiler. So we issue a warning instead of - * an error. - */ - if (IDL_TYPE_INTEGER(real_type).f_type == IDL_INTEGER_TYPE_LONG) - { - XPIDL_WARNING((const_tree, IDL_WARNING1, - "unsigned const declaration \'%s\' " - "initialized with (possibly) negative constant", - name)); - return TRUE; - } -#endif - IDL_tree_error(const_tree, - "unsigned const declaration \'%s\' initialized with " - "negative constant", - name); - return FALSE; - } - } else { - IDL_tree_error(const_tree, - "const declaration \'%s\' must be of type short or long", - name); - return FALSE; - } + PCXPIDLNODE pNdType = find_underlying_type(pNd->u.Const.pNdTypeSpec); + pNdType = pNdType ? pNdType : pNd->u.Const.pNdTypeSpec; + if ( pNdType->enmType != kXpidlNdType_BaseType + || ( pNdType->u.enmBaseType != kXpidlType_Short + && pNdType->u.enmBaseType != kXpidlType_Long + && pNdType->u.enmBaseType != kXpidlType_Unsigned_Short + && pNdType->u.enmBaseType != kXpidlType_Unsigned_Long)) + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "const declaration \'%s\' must be of type short or long", + pNd->u.Const.pszName); - return TRUE; + return VINF_SUCCESS; } - -/* - * This method consolidates error checking needed when coercing the XPIDL compiler - * via the -t flag to generate output for a specific version of XPConnect. - */ -static gboolean -verify_type_fits_version(IDL_tree in_tree, IDL_tree error_tree) +DECLHIDDEN(int) verify_attribute_declaration(PCXPIDLNODE pNd, PRTERRINFO pErrInfo) { - if (major_version == 1 && minor_version == 1) - { - /* XPIDL Version 1.1 checks */ + Assert(pNd->enmType == kXpidlNdType_Attribute); - /* utf8string, cstring, and astring types are not supported */ - if (IDL_tree_property_get(in_tree, "utf8string") != NULL || - IDL_tree_property_get(in_tree, "cstring") != NULL || - IDL_tree_property_get(in_tree, "astring") != NULL) - { - IDL_tree_error(error_tree, - "Cannot use [utf8string], [cstring] and [astring] " - "types when generating version 1.1 typelibs\n"); - return FALSE; - } - } - return TRUE; -} - -gboolean -verify_attribute_declaration(IDL_tree attr_tree) -{ - IDL_tree iface; - IDL_tree ident; - IDL_tree attr_type; - gboolean scriptable_interface; - - /* We don't support attributes named IID, conflicts with static GetIID + /* + * We don't support attributes named IID, conflicts with static GetIID * member. The conflict is due to certain compilers (VC++) choosing a * different vtable order, placing GetIID at the beginning regardless * of it's placement */ - if (strcmp( - IDL_IDENT( - IDL_LIST(IDL_ATTR_DCL(attr_tree).simple_declarations).data).str, - "IID") == 0) { - IDL_tree_error(attr_tree, - "Attributes named IID not supported, causes vtable " - "ordering problems"); - return FALSE; - } + if (!strcmp(pNd->u.Attribute.pszName, "IID")) + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "Attributes named IID not supported, causes vtable ordering problems"); + /* * Verify that we've been called on an interface, and decide if the * interface was marked [scriptable]. */ - if (IDL_NODE_UP(attr_tree) && IDL_NODE_UP(IDL_NODE_UP(attr_tree)) && - IDL_NODE_TYPE(iface = IDL_NODE_UP(IDL_NODE_UP(attr_tree))) - == IDLN_INTERFACE) - { - scriptable_interface = - (IDL_tree_property_get(IDL_INTERFACE(iface).ident, "scriptable") - != NULL); - } else { - IDL_tree_error(attr_tree, - "verify_attribute_declaration called on a non-interface?"); - return FALSE; - } - - /* - * Grab the first of the list of idents and hope that it'll - * say scriptable or no. - */ - ident = IDL_LIST(IDL_ATTR_DCL(attr_tree).simple_declarations).data; + bool fScriptable; + if ( pNd->pParent + && pNd->pParent->enmType == kXpidlNdType_Interface_Def) + fScriptable = (xpidlNodeAttrFind(pNd->pParent, "scriptable") != NULL); + else + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "verify_attribute_declaration called on a non-interface?"); /* * If the interface isn't scriptable, or the attribute is marked noscript, * there's no need to check. */ - if (!scriptable_interface || - IDL_tree_property_get(ident, "noscript") != NULL) - return TRUE; + if (!fScriptable || !xpidlNodeAttrFind(pNd, "scriptable")) + return VINF_SUCCESS; /* * If it should be scriptable, check that the type is non-native. nsid, * domstring, utf8string, cstring, astring are exempted. */ - attr_type = IDL_ATTR_DCL(attr_tree).param_type_spec; - - if (attr_type != NULL) + PCXPIDLNODE pNdType = find_underlying_type(pNd->u.Attribute.pNdTypeSpec); + pNdType = pNdType ? pNdType : pNd->u.Attribute.pNdTypeSpec; + if (pNdType) { - if (UP_IS_NATIVE(attr_type) && - IDL_tree_property_get(attr_type, "nsid") == NULL && - IDL_tree_property_get(attr_type, "domstring") == NULL && - IDL_tree_property_get(attr_type, "utf8string") == NULL && - IDL_tree_property_get(attr_type, "cstring") == NULL && - IDL_tree_property_get(attr_type, "astring") == NULL) - { - IDL_tree_error(attr_tree, - "attributes in [scriptable] interfaces that are " - "non-scriptable because they refer to native " - "types must be marked [noscript]\n"); - return FALSE; - } + if (pNdType->enmType == kXpidlNdType_Native && + xpidlNodeAttrFind(pNdType, "nsid") == NULL && + xpidlNodeAttrFind(pNdType, "domstring") == NULL && + xpidlNodeAttrFind(pNdType, "utf8string") == NULL && + xpidlNodeAttrFind(pNdType, "cstring") == NULL && + xpidlNodeAttrFind(pNdType, "astring") == NULL) + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "attributes in [scriptable] interfaces that are " + "non-scriptable because they refer to native " + "types must be marked [noscript]"); + /* * We currently don't support properties of type nsid that aren't * pointers or references, unless they are marked [notxpcom} and * must be read-only */ - - if ((IDL_tree_property_get(ident, "notxpcom") == NULL || !(IDL_ATTR_DCL(attr_tree).f_readonly)) && - IDL_tree_property_get(attr_type,"nsid") != NULL && - IDL_tree_property_get(attr_type,"ptr") == NULL && - IDL_tree_property_get(attr_type,"ref") == NULL) - { - IDL_tree_error(attr_tree, - "Feature not currently supported: " - "attributes with a type of nsid must be marked " - "either [ptr] or [ref], or " - "else must be marked [notxpcom] " - "and must be read-only\n"); - return FALSE; - } - - /* - * Run additional error checks on the attribute type if targetting an - * older version of XPConnect. - */ - - if (!verify_type_fits_version(attr_type, attr_tree)) - return FALSE; + if ( ( xpidlNodeAttrFind(pNd, "notxpcom") == NULL + || pNd->u.Attribute.fReadonly) + && xpidlNodeAttrFind(pNdType,"nsid") != NULL + && xpidlNodeAttrFind(pNdType,"ptr") == NULL + && xpidlNodeAttrFind(pNdType,"ref") == NULL) + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "Feature not currently supported: " + "attributes with a type of nsid must be marked either [ptr] or [ref], or " + "else must be marked [notxpcom] and must be read-only\n"); } - if (IDL_LIST(IDL_ATTR_DCL(attr_tree).simple_declarations).next != NULL) - { - IDL_tree_error(attr_tree, - "multiple attributes in a single declaration is not supported\n"); - return FALSE; - } - return TRUE; + return VINF_SUCCESS; } + /* * Find the underlying type of an identifier typedef. - * - * All the needed tree-walking seems pretty shaky; isn't there something in - * libIDL to automate this? */ -IDL_tree /* IDL_TYPE_DCL */ -find_underlying_type(IDL_tree typedef_ident) +DECLHIDDEN(PCXPIDLNODE) find_underlying_type(PCXPIDLNODE pNd) { - IDL_tree up; - - if (typedef_ident == NULL || IDL_NODE_TYPE(typedef_ident) != IDLN_IDENT) + if (pNd->enmType == kXpidlNdType_BaseType) + return pNd; + if (pNd == NULL || pNd->enmType != kXpidlNdType_Identifier) return NULL; - up = IDL_NODE_UP(typedef_ident); - if (up == NULL || IDL_NODE_TYPE(up) != IDLN_LIST) - return NULL; - up = IDL_NODE_UP(up); - if (up == NULL || IDL_NODE_TYPE(up) != IDLN_TYPE_DCL) - return NULL; - - return IDL_TYPE_DCL(up).type_spec; + AssertPtr(pNd->pNdTypeRef); + pNd = pNd->pNdTypeRef; + if (pNd->enmType == kXpidlNdType_Typedef) + pNd = pNd->u.Typedef.pNodeTypeSpec; + return pNd; } -static IDL_tree /* IDL_PARAM_DCL */ -find_named_parameter(IDL_tree method_tree, const char *param_name) + +static PCXPIDLNODE find_named_parameter(PCXPIDLNODE pNdMethod, const char *param_name) { - IDL_tree iter; - for (iter = IDL_OP_DCL(method_tree).parameter_dcls; iter; - iter = IDL_LIST(iter).next) + PCXPIDLNODE pIt; + RTListForEach(&pNdMethod->u.Method.LstParams, pIt, XPIDLNODE, NdLst) { - IDL_tree param = IDL_LIST(iter).data; - IDL_tree simple_decl = IDL_PARAM_DCL(param).simple_declarator; - const char *current_name = IDL_IDENT(simple_decl).str; - if (strcmp(current_name, param_name) == 0) - return param; + Assert(pIt->enmType == kXpidlNdType_Parameter); + if (!strcmp(pIt->u.Param.pszName, param_name)) + return pIt; } return NULL; } @@ -403,12 +277,9 @@ typedef enum ParamAttrType { * Check that parameters referred to by attributes such as size_is exist and * refer to parameters of the appropriate type. */ -static gboolean -check_param_attribute(IDL_tree method_tree, IDL_tree param, - ParamAttrType whattocheck) +static int check_param_attribute(PCXPIDLNODE pNdMethod, PCXPIDLNODE pNdParam, + ParamAttrType whattocheck, PRTERRINFO pErrInfo) { - const char *referred_name = NULL; - IDL_tree simple_decl = IDL_PARAM_DCL(param).simple_declarator; const char *attr_name; const char *needed_type; @@ -422,115 +293,90 @@ check_param_attribute(IDL_tree method_tree, IDL_tree param, attr_name = "size_is"; needed_type = "unsigned long (or PRUint32)"; } else { - XPT_ASSERT("asked to check an unknown attribute type!"); - return TRUE; + AssertMsgFailed(("asked to check an unknown attribute type!")); + return VINF_SUCCESS; } - referred_name = IDL_tree_property_get(simple_decl, attr_name); - if (referred_name != NULL) { - IDL_tree referred_param = find_named_parameter(method_tree, + PCXPIDLATTR pAttr = xpidlNodeAttrFind(pNdParam, attr_name); + if (pAttr != NULL) + { + const char *referred_name = pAttr->pszVal; + + PCXPIDLNODE pNdParamRef = find_named_parameter(pNdMethod, referred_name); - IDL_tree referred_param_type; - if (referred_param == NULL) { - IDL_tree_error(method_tree, - "attribute [%s(%s)] refers to missing " - "parameter \"%s\"", - attr_name, referred_name, referred_name); - return FALSE; - } - if (referred_param == param) { - IDL_tree_error(method_tree, - "attribute [%s(%s)] refers to it's own parameter", - attr_name, referred_name); - return FALSE; - } + if (!pNdParamRef) + return xpidlIdlError(pErrInfo, pNdParam, VERR_INVALID_STATE, + "attribute [%s(%s)] refers to missing parameter \"%s\"", + attr_name, referred_name, referred_name); + + if (pNdParamRef == pNdParam) + return xpidlIdlError(pErrInfo, pNdParam, VERR_INVALID_STATE, + "attribute [%s(%s)] refers to it's own parameter", + attr_name, referred_name); - referred_param_type = IDL_PARAM_DCL(referred_param).param_type_spec; - if (whattocheck == IID_IS) { + PCXPIDLNODE pNdTypeSpec = find_underlying_type(pNdParamRef->u.Param.pNdTypeSpec); + pNdTypeSpec = pNdTypeSpec ? pNdTypeSpec : pNdParamRef->u.Param.pNdTypeSpec; + if (whattocheck == IID_IS) + { /* require IID type */ - if (IDL_tree_property_get(referred_param_type, "nsid") == NULL) { - IDL_tree_error(method_tree, + if (!xpidlNodeAttrFind(pNdTypeSpec, "nsid")) + return xpidlIdlError(pErrInfo, pNdParamRef, VERR_INVALID_STATE, "target \"%s\" of [%s(%s)] attribute " "must be of %s type", referred_name, attr_name, referred_name, needed_type); - return FALSE; - } - } else if (whattocheck == LENGTH_IS || whattocheck == SIZE_IS) { - /* require PRUint32 type */ - IDL_tree real_type; + } + else if (whattocheck == LENGTH_IS || whattocheck == SIZE_IS) + { + PCXPIDLNODE pNdType = find_underlying_type(pNdTypeSpec); + pNdType = pNdType ? pNdType : pNdTypeSpec; - /* Could be a typedef; try to map it to the real type. */ - real_type = find_underlying_type(referred_param_type); - real_type = real_type ? real_type : referred_param_type; - - if (IDL_NODE_TYPE(real_type) != IDLN_TYPE_INTEGER || - IDL_TYPE_INTEGER(real_type).f_signed != FALSE || - IDL_TYPE_INTEGER(real_type).f_type != IDL_INTEGER_TYPE_LONG) - { - IDL_tree_error(method_tree, - "target \"%s\" of [%s(%s)] attribute " - "must be of %s type", - referred_name, attr_name, referred_name, - needed_type); - - return FALSE; - } + if ( pNdType->enmType != kXpidlNdType_BaseType + || pNdType->u.enmBaseType != kXpidlType_Unsigned_Long) + return xpidlIdlError(pErrInfo, pNdParamRef, VERR_INVALID_STATE, + "target \"%s\" of [%s(%s)] attribute " + "must be of %s type", + referred_name, attr_name, referred_name, + needed_type); } } - return TRUE; + return VINF_SUCCESS; } /* * Common method verification code, called by *op_dcl in the various backends. */ -gboolean -verify_method_declaration(IDL_tree method_tree) +DECLHIDDEN(int) verify_method_declaration(PCXPIDLNODE pNd, PRTERRINFO pErrInfo) { - struct _IDL_OP_DCL *op = &IDL_OP_DCL(method_tree); - IDL_tree iface; - IDL_tree iter; - gboolean notxpcom; - gboolean scriptable_interface; - gboolean scriptable_method; - gboolean seen_retval = FALSE; - const char *method_name = IDL_IDENT(IDL_OP_DCL(method_tree).ident).str; + Assert(pNd->enmType == kXpidlNdType_Method); + bool notxpcom; + bool scriptable_interface; + bool scriptable_method; + bool seen_retval = false; - /* We don't support attributes named IID, conflicts with static GetIID + /* + * We don't support attributes named IID, conflicts with static GetIID * member. The conflict is due to certain compilers (VC++) choosing a * different vtable order, placing GetIID at the beginning regardless * of it's placement */ - if (strcmp(method_name, "GetIID") == 0) { - IDL_tree_error(method_tree, - "Methods named GetIID not supported, causes vtable " - "ordering problems"); - return FALSE; - } - if (op->f_varargs) { - /* We don't currently support varargs. */ - IDL_tree_error(method_tree, "varargs are not currently supported"); - return FALSE; - } + if (!strcmp(pNd->u.Method.pszName, "GetIID")) + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "Methods named GetIID not supported, causes vtable " + "ordering problems"); /* * Verify that we've been called on an interface, and decide if the * interface was marked [scriptable]. */ - if (IDL_NODE_UP(method_tree) && IDL_NODE_UP(IDL_NODE_UP(method_tree)) && - IDL_NODE_TYPE(iface = IDL_NODE_UP(IDL_NODE_UP(method_tree))) - == IDLN_INTERFACE) - { - scriptable_interface = - (IDL_tree_property_get(IDL_INTERFACE(iface).ident, "scriptable") - != NULL); - } else { - IDL_tree_error(method_tree, - "verify_method_declaration called on a non-interface?"); - return FALSE; - } + if ( pNd->pParent + && pNd->pParent->enmType == kXpidlNdType_Interface_Def) + scriptable_interface = (xpidlNodeAttrFind(pNd->pParent, "scriptable") != NULL); + else + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "verify_method_declaration called on a non-interface?"); /* * Require that any method in an interface marked as [scriptable], that @@ -540,84 +386,78 @@ verify_method_declaration(IDL_tree method_tree) * Also check that iid_is points to nsid, and length_is, size_is points * to unsigned long. */ - notxpcom = IDL_tree_property_get(op->ident, "notxpcom") != NULL; + notxpcom = xpidlNodeAttrFind(pNd, "notxpcom") != NULL; - scriptable_method = scriptable_interface && - !notxpcom && - IDL_tree_property_get(op->ident, "noscript") == NULL; + scriptable_method = scriptable_interface + && !notxpcom + && xpidlNodeAttrFind(pNd, "noscript") == NULL; /* Loop through the parameters and check. */ - for (iter = op->parameter_dcls; iter; iter = IDL_LIST(iter).next) { - IDL_tree param = IDL_LIST(iter).data; - IDL_tree param_type = - IDL_PARAM_DCL(param).param_type_spec; - IDL_tree simple_decl = - IDL_PARAM_DCL(param).simple_declarator; - const char *param_name = IDL_IDENT(simple_decl).str; + PCXPIDLNODE pIt; + RTListForEach(&pNd->u.Method.LstParams, pIt, XPIDLNODE, NdLst) + { + int rc; + + PCXPIDLNODE pNdTypeSpec = find_underlying_type(pIt->u.Param.pNdTypeSpec); + pNdTypeSpec = pNdTypeSpec ? pNdTypeSpec : pIt->u.Param.pNdTypeSpec; /* * Reject this method if it should be scriptable and some parameter is * native that isn't marked with either nsid, domstring, utf8string, * cstring, astring or iid_is. */ - if (scriptable_method && - UP_IS_NATIVE(param_type) && - IDL_tree_property_get(param_type, "nsid") == NULL && - IDL_tree_property_get(simple_decl, "iid_is") == NULL && - IDL_tree_property_get(param_type, "domstring") == NULL && - IDL_tree_property_get(param_type, "utf8string") == NULL && - IDL_tree_property_get(param_type, "cstring") == NULL && - IDL_tree_property_get(param_type, "astring") == NULL) - { - IDL_tree_error(method_tree, + if ( scriptable_method + && pNdTypeSpec->enmType == kXpidlNdType_Native + && xpidlNodeAttrFind(pNdTypeSpec, "nsid") == NULL + && xpidlNodeAttrFind(pIt, "iid_is") == NULL + && xpidlNodeAttrFind(pNdTypeSpec, "domstring") == NULL + && xpidlNodeAttrFind(pNdTypeSpec, "utf8string") == NULL + && xpidlNodeAttrFind(pNdTypeSpec, "cstring") == NULL + && xpidlNodeAttrFind(pNdTypeSpec, "astring") == NULL) + return xpidlIdlError(pErrInfo, pIt, VERR_INVALID_STATE, "methods in [scriptable] interfaces that are " "non-scriptable because they refer to native " "types (parameter \"%s\") must be marked " - "[noscript]", param_name); - return FALSE; - } + "[noscript]", pIt->u.Param.pszName); /* * nsid's parameters that aren't ptr's or ref's are not currently * supported in xpcom or non-xpcom (marked with [notxpcom]) methods * as input parameters */ - if (!(notxpcom && IDL_PARAM_DCL(param).attr != IDL_PARAM_IN) && - IDL_tree_property_get(param_type, "nsid") != NULL && - IDL_tree_property_get(param_type, "ptr") == NULL && - IDL_tree_property_get(param_type, "ref") == NULL) - { - IDL_tree_error(method_tree, - "Feature currently not supported: " - "parameter \"%s\" is of type nsid and " - "must be marked either [ptr] or [ref] " - "or method \"%s\" must be marked [notxpcom] " - "and must not be an input parameter", - param_name, - method_name); - return FALSE; - } + if ( !( notxpcom + && pIt->u.Param.enmDir != kXpidlDirection_In) + && xpidlNodeAttrFind(pNdTypeSpec, "nsid") != NULL + && xpidlNodeAttrFind(pNdTypeSpec, "ptr") == NULL + && xpidlNodeAttrFind(pNdTypeSpec, "ref") == NULL) + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "Feature currently not supported: " + "parameter \"%s\" is of type nsid and " + "must be marked either [ptr] or [ref] " + "or method \"%s\" must be marked [notxpcom] " + "and must not be an input parameter", + pIt->u.Param.pszName, pNd->u.Method.pszName); + /* * Sanity checks on return values. */ - if (IDL_tree_property_get(simple_decl, "retval") != NULL) { - if (IDL_LIST(iter).next != NULL) { - IDL_tree_error(method_tree, - "only the last parameter can be marked [retval]"); - return FALSE; - } - if (op->op_type_spec) { - IDL_tree_error(method_tree, - "can't have [retval] with non-void return type"); - return FALSE; - } + if (xpidlNodeAttrFind(pIt, "retval") != NULL) + { + if (!RTListNodeIsLast(&pNd->u.Method.LstParams, &pIt->NdLst)) + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "only the last parameter can be marked [retval]"); + + if ( pNd->u.Method.pNdTypeSpecRet->enmType != kXpidlNdType_BaseType + || pNd->u.Method.pNdTypeSpecRet->u.enmBaseType != kXpidlType_Void) + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "can't have [retval] with non-void return type"); + /* In case XPConnect relaxes the retval-is-last restriction. */ - if (seen_retval) { - IDL_tree_error(method_tree, - "can't have more than one [retval] parameter"); - return FALSE; - } - seen_retval = TRUE; + if (seen_retval) + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "can't have more than one [retval] parameter"); + + seen_retval = true; } /* @@ -625,224 +465,167 @@ verify_method_declaration(IDL_tree method_tree) * or native (but not nsid, domstring, utf8string, cstring or astring) * and can't be used with [array]. */ - if (IDL_tree_property_get(simple_decl, "shared") != NULL) { - IDL_tree real_type; - real_type = find_underlying_type(param_type); - real_type = real_type ? real_type : param_type; + if (xpidlNodeAttrFind(pIt, "shared") != NULL) + { + if (xpidlNodeAttrFind(pIt, "array") != NULL) + return xpidlIdlError(pErrInfo, pIt, VERR_INVALID_STATE, + "[shared] parameter \"%s\" cannot be of array type", + pIt->u.Param.pszName); - if (IDL_tree_property_get(simple_decl, "array") != NULL) { - IDL_tree_error(method_tree, - "[shared] parameter \"%s\" cannot " - "be of array type", param_name); - return FALSE; - } - - if (!(IDL_NODE_TYPE(real_type) == IDLN_TYPE_STRING || - IDL_NODE_TYPE(real_type) == IDLN_TYPE_WIDE_STRING || - (UP_IS_NATIVE(real_type) && - !IDL_tree_property_get(real_type, "nsid") && - !IDL_tree_property_get(real_type, "domstring") && - !IDL_tree_property_get(real_type, "utf8string") && - !IDL_tree_property_get(real_type, "cstring") && - !IDL_tree_property_get(real_type, "astring")))) - { - IDL_tree_error(method_tree, - "[shared] parameter \"%s\" must be of type " - "string, wstring or native", param_name); - return FALSE; - } + if ( !( pNdTypeSpec->enmType == kXpidlNdType_BaseType + && ( pNdTypeSpec->u.enmBaseType == kXpidlType_String + || pNdTypeSpec->u.enmBaseType == kXpidlType_Wide_String)) + && !( pNdTypeSpec->enmType == kXpidlNdType_Native + && ( !xpidlNodeAttrFind(pNdTypeSpec, "nsid") + && !xpidlNodeAttrFind(pNdTypeSpec, "domstring") + && !xpidlNodeAttrFind(pNdTypeSpec, "utf8string") + && !xpidlNodeAttrFind(pNdTypeSpec, "cstring") + && !xpidlNodeAttrFind(pNdTypeSpec, "astring")))) + return xpidlIdlError(pErrInfo, pIt, VERR_INVALID_STATE, + "[shared] parameter \"%s\" must be of type " + "string, wstring or native", pIt->u.Param.pszName); } /* * inout is not allowed with "domstring", "UTF8String", "CString" * and "AString" types */ - if (IDL_PARAM_DCL(param).attr == IDL_PARAM_INOUT && - UP_IS_NATIVE(param_type) && - (IDL_tree_property_get(param_type, "domstring") != NULL || - IDL_tree_property_get(param_type, "utf8string") != NULL || - IDL_tree_property_get(param_type, "cstring") != NULL || - IDL_tree_property_get(param_type, "astring") != NULL )) { - IDL_tree_error(method_tree, - "[domstring], [utf8string], [cstring], [astring] " - "types cannot be used as inout parameters"); - return FALSE; - } - + if ( pIt->u.Param.enmDir == kXpidlDirection_InOut + && pNdTypeSpec->enmType == kXpidlNdType_Native + && ( xpidlNodeAttrFind(pNdTypeSpec, "domstring") != NULL + || xpidlNodeAttrFind(pNdTypeSpec, "utf8string") != NULL + || xpidlNodeAttrFind(pNdTypeSpec, "cstring") != NULL + || xpidlNodeAttrFind(pNdTypeSpec, "astring") != NULL)) + return xpidlIdlError(pErrInfo, pIt, VERR_INVALID_STATE, + "[domstring], [utf8string], [cstring], [astring] " + "types cannot be used as inout parameters"); /* * arrays of domstring, utf8string, cstring, astring types not allowed */ - if (IDL_tree_property_get(simple_decl, "array") != NULL && - UP_IS_NATIVE(param_type) && - (IDL_tree_property_get(param_type, "domstring") != NULL || - IDL_tree_property_get(param_type, "utf8string") != NULL || - IDL_tree_property_get(param_type, "cstring") != NULL || - IDL_tree_property_get(param_type, "astring") != NULL)) { - IDL_tree_error(method_tree, + if ( xpidlNodeAttrFind(pIt, "array") + && pNdTypeSpec->enmType == kXpidlNdType_Native + && ( xpidlNodeAttrFind(pNdTypeSpec, "domstring") != NULL + || xpidlNodeAttrFind(pNdTypeSpec, "utf8string") != NULL + || xpidlNodeAttrFind(pNdTypeSpec, "cstring") != NULL + || xpidlNodeAttrFind(pNdTypeSpec, "astring") != NULL)) + return xpidlIdlError(pErrInfo, pIt, VERR_INVALID_STATE, "[domstring], [utf8string], [cstring], [astring] " "types cannot be used in array parameters"); - return FALSE; - } - if (!check_param_attribute(method_tree, param, IID_IS) || - !check_param_attribute(method_tree, param, LENGTH_IS) || - !check_param_attribute(method_tree, param, SIZE_IS)) - return FALSE; - - /* - * Run additional error checks on the parameter type if targetting an - * older version of XPConnect. - */ - - if (!verify_type_fits_version(param_type, method_tree)) - return FALSE; - + rc = check_param_attribute(pNd, pIt, IID_IS, pErrInfo); + if (RT_FAILURE(rc)) + return rc; + rc = check_param_attribute(pNd, pIt, LENGTH_IS, pErrInfo); + if (RT_FAILURE(rc)) + return rc; + rc = check_param_attribute(pNd, pIt, SIZE_IS, pErrInfo); + if (RT_FAILURE(rc)) + return rc; } - + + PCXPIDLNODE pNdTypeSpec = find_underlying_type(pNd->u.Method.pNdTypeSpecRet); + pNdTypeSpec = pNdTypeSpec ? pNdTypeSpec : pIt->u.Method.pNdTypeSpecRet; + /* XXX q: can return type be nsid? */ /* Native return type? */ - if (scriptable_method && - op->op_type_spec != NULL && UP_IS_NATIVE(op->op_type_spec) && - IDL_tree_property_get(op->op_type_spec, "nsid") == NULL && - IDL_tree_property_get(op->op_type_spec, "domstring") == NULL && - IDL_tree_property_get(op->op_type_spec, "utf8string") == NULL && - IDL_tree_property_get(op->op_type_spec, "cstring") == NULL && - IDL_tree_property_get(op->op_type_spec, "astring") == NULL) - { - IDL_tree_error(method_tree, - "methods in [scriptable] interfaces that are " - "non-scriptable because they return native " - "types must be marked [noscript]"); - return FALSE; - } - + if ( scriptable_method + && pNdTypeSpec->enmType == kXpidlNdType_Native + && xpidlNodeAttrFind(pNdTypeSpec, "nsid") == NULL + && xpidlNodeAttrFind(pNdTypeSpec, "domstring") == NULL + && xpidlNodeAttrFind(pNdTypeSpec, "utf8string") == NULL + && xpidlNodeAttrFind(pNdTypeSpec, "cstring") == NULL + && xpidlNodeAttrFind(pNdTypeSpec, "astring") == NULL) + return xpidlIdlError(pErrInfo, pIt, VERR_INVALID_STATE, + "methods in [scriptable] interfaces that are " + "non-scriptable because they return native " + "types must be marked [noscript]"); /* * nsid's parameters that aren't ptr's or ref's are not currently * supported in xpcom */ - if (!notxpcom && - op->op_type_spec != NULL && - IDL_tree_property_get(op->op_type_spec, "nsid") != NULL && - IDL_tree_property_get(op->op_type_spec, "ptr") == NULL && - IDL_tree_property_get(op->op_type_spec, "ref") == NULL) - { - IDL_tree_error(method_tree, - "Feature currently not supported: " - "return value is of type nsid and " - "must be marked either [ptr] or [ref], " - "or else method \"%s\" must be marked [notxpcom] ", - method_name); - return FALSE; - } + if ( !notxpcom + && pNdTypeSpec->enmType == kXpidlNdType_Native + && xpidlNodeAttrFind(pNdTypeSpec, "nsid") != NULL + && xpidlNodeAttrFind(pNdTypeSpec, "ptr") == NULL + && xpidlNodeAttrFind(pNdTypeSpec, "ref") == NULL) + return xpidlIdlError(pErrInfo, pIt, VERR_INVALID_STATE, + "Feature currently not supported: " + "return value is of type nsid and " + "must be marked either [ptr] or [ref], " + "or else method \"%s\" must be marked [notxpcom] ", + pNd->u.Method.pszName); - /* - * Run additional error checks on the return type if targetting an - * older version of XPConnect. - */ - - if (op->op_type_spec != NULL && - !verify_type_fits_version(op->op_type_spec, method_tree)) - { - return FALSE; - } - - return TRUE; + return VINF_SUCCESS; } + /* * Verify that a native declaration has an associated C++ expression, i.e. that * it's of the form native () */ -gboolean -check_native(TreeState *state) +DECLHIDDEN(int) check_native(PCXPIDLNODE pNd, PRTERRINFO pErrInfo) { - char *native_name; + Assert(pNd->enmType == kXpidlNdType_Native); + /* require that native declarations give a native type */ - if (IDL_NATIVE(state->tree).user_type) - return TRUE; - native_name = IDL_IDENT(IDL_NATIVE(state->tree).ident).str; - IDL_tree_error(state->tree, - "``native %s;'' needs C++ type: ``native %s();''", - native_name, native_name); - return FALSE; + if (pNd->u.Native.pszNative) + return VINF_SUCCESS; + + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "``native %s;'' needs C++ type: ``native %s();''", + pNd->u.Native.pszName, pNd->u.Native.pszName); } -/* - * Print a GSList as char strings to a file. - */ -void -printlist(FILE *outfile, GSList *slist) -{ - guint i; - guint len = g_slist_length(slist); - - for(i = 0; i < len; i++) { - fprintf(outfile, - "%s\n", (char *)g_slist_nth_data(slist, i)); - } -} - -void -xpidl_list_foreach(IDL_tree p, IDL_tree_func foreach, gpointer user_data) -{ - IDL_tree_func_data tfd; - - while (p) { - struct _IDL_LIST *list = &IDL_LIST(p); - tfd.tree = list->data; - if (!foreach(&tfd, user_data)) - return; - p = list->next; - } -} /* * Verify that the interface declaration is correct */ -gboolean -verify_interface_declaration(IDL_tree interface_tree) +DECLHIDDEN(int) verify_interface_declaration(PCXPIDLNODE pNd, PRTERRINFO pErrInfo) { - IDL_tree iter; /* * If we have the scriptable attribute then make sure all of our direct * parents have it as well. * NOTE: We don't recurse since all interfaces will fall through here */ - if (IDL_tree_property_get(IDL_INTERFACE(interface_tree).ident, - "scriptable")) { - for (iter = IDL_INTERFACE(interface_tree).inheritance_spec; iter; - iter = IDL_LIST(iter).next) { - if (IDL_tree_property_get( - IDL_INTERFACE(iter).ident, "scriptable") == 0) { - XPIDL_WARNING((interface_tree,IDL_WARNING1, - "%s is scriptable but inherits from the non-scriptable interface %s\n", - IDL_IDENT(IDL_INTERFACE(interface_tree).ident).str, - IDL_IDENT(IDL_INTERFACE(iter).ident).str)); - } + if (xpidlNodeAttrFind(pNd, "scriptable")) + { + Assert(pNd->enmType == kXpidlNdType_Interface_Def); + while (pNd->pNdTypeRef) + { + if (!xpidlNodeAttrFind(pNd->pNdTypeRef, "scriptable")) + return xpidlIdlError(pErrInfo, pNd, VERR_INVALID_STATE, + "%s is scriptable but inherits from the non-scriptable interface %s", + pNd->u.If.pszIfName, pNd->u.If.pszIfInherit); + + pNd = pNd->pNdTypeRef; } } - return TRUE; + return VINF_SUCCESS; } -/* - * Return a pointer to the start of the base filename of path - */ -char * -xpidl_basename(const char * path) + +DECLHIDDEN(PCXPIDLATTR) xpidlNodeAttrFind(PCXPIDLNODE pNd, const char *pszAttr) { - char * result = g_path_get_basename(path); - /* - *If this is windows then we'll handle either / or \ as a separator - * g_basename only handles \ for windows - */ -#if defined(XP_WIN32) -# error adapt regarding g_basename() vs. g_path_get_basename()! - const char * slash = strrchr(path, '/'); - /* If we found a slash and its after the current default OS separator */ - if (slash != NULL && (slash > result)) - result = slash + 1; -#endif - return result; + uint32_t i; + for (i = 0; i < pNd->cAttrs; i++) + { + if (!strcmp(pNd->aAttrs[i].pszName, pszAttr)) + return &pNd->aAttrs[i]; + } + + return NULL; +} + + +DECLHIDDEN(int) xpidlIdlError(PRTERRINFO pErrInfo, PCXPIDLNODE pNd, int rc, const char *pszFmt, ...) +{ + RT_NOREF(pNd); + + va_list Args; + va_start(Args, pszFmt); + rc = RTErrInfoSetV(pErrInfo, rc, pszFmt, Args); + va_end(Args); + return rc; } diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpt/public/xpt_xdr.h b/src/libs/xpcom18a4/xpcom/typelib/xpt/public/xpt_xdr.h index 89d1c3f6..678f7cc3 100644 --- a/src/libs/xpcom18a4/xpcom/typelib/xpt/public/xpt_xdr.h +++ b/src/libs/xpcom18a4/xpcom/typelib/xpt/public/xpt_xdr.h @@ -216,7 +216,7 @@ XPT_GetAddrForOffset(XPTCursor *cursor, PRUint32 offset); XPTMode mode = cursor->state->mode; \ if (!(mode == XPT_ENCODE || XPT_Do32(cursor, &new_curs.offset)) || \ !CheckForRepeat(cursor, (void **)addrp, pool, \ - mode == XPT_ENCODE ? size : 0u, &new_curs, \ + mode == XPT_ENCODE ? size : 0, &new_curs, \ &already) || \ !(mode == XPT_DECODE || XPT_Do32(cursor, &new_curs.offset))) \ return PR_FALSE; \ diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_arena.c b/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_arena.c index 0dccbce8..6070bd68 100644 --- a/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_arena.c +++ b/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_arena.c @@ -94,10 +94,10 @@ static void xpt_DebugPrintArenaStats(XPTArena *arena); #define LOG_MALLOC(_a, _req, _used) ((void)0) #define LOG_REAL_MALLOC(_a, _size) ((void)0) -#define LOG_FREE(_a) ((void)0) +#define LOG_FREE(_a) RT_NOREF(_a) #define LOG_DONE_LOADING(_a) ((void)0) -#define PRINT_STATS(_a) ((void)0) +#define PRINT_STATS(_a) RT_NOREF(_a) #endif /* XPT_ARENA_LOGGING */ @@ -289,12 +289,15 @@ XPT_NotifyDoneLoading(XPTArena *arena) if (arena) { LOG_DONE_LOADING(arena); } +#else + RT_NOREF(arena); #endif } XPT_PUBLIC_API(void) XPT_ArenaFree(XPTArena *arena, void *block) { + RT_NOREF(block); LOG_FREE(arena); } diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_struct.c b/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_struct.c index 406b22d7..d0cc3d89 100644 --- a/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_struct.c +++ b/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_struct.c @@ -414,6 +414,8 @@ XPT_NewInterfaceDescriptor(XPTArena *arena, XPT_PUBLIC_API(void) XPT_FreeInterfaceDescriptor(XPTArena *arena, XPTInterfaceDescriptor* id) { + RT_NOREF(arena); + if (id) { XPTMethodDescriptor *md, *mdend; XPTConstDescriptor *cd, *cdend; @@ -797,6 +799,8 @@ XPT_PUBLIC_API(PRBool) XPT_FillParamDescriptor(XPTArena *arena, XPTParamDescriptor *pd, PRUint8 flags, XPTTypeDescriptor *type) { + RT_NOREF(arena); + pd->flags = flags & XPT_PD_FLAGMASK; XPT_COPY_TYPE(pd->type, *type); return PR_TRUE; @@ -816,6 +820,7 @@ DoParamDescriptor(XPTArena *arena, XPTCursor *cursor, XPTParamDescriptor *pd, PRBool DoTypeDescriptorPrefix(XPTArena *arena, XPTCursor *cursor, XPTTypeDescriptorPrefix *tdp) { + RT_NOREF(arena); return XPT_Do8(cursor, &tdp->flags); } diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpt/tools/xpt_dump.c b/src/libs/xpcom18a4/xpcom/typelib/xpt/tools/xpt_dump.c index ef97c184..3b368341 100644 --- a/src/libs/xpcom18a4/xpcom/typelib/xpt/tools/xpt_dump.c +++ b/src/libs/xpcom18a4/xpcom/typelib/xpt/tools/xpt_dump.c @@ -828,8 +828,6 @@ XPT_DumpConstDescriptor(XPTHeader *header, XPTConstDescriptor *cd, int new_indent = indent + BASE_INDENT; char *const_type; /* char *out; */ - PRUint32 uintout; - PRInt32 intout; if (verbose_mode) { fprintf(stdout, "%*sName: %s\n", indent, " ", cd->name); @@ -858,8 +856,7 @@ XPT_DumpConstDescriptor(XPTHeader *header, XPTConstDescriptor *cd, /* out = PR_smprintf("%lld", cd->value.i64); */ /* fputs(out, stdout); */ /* PR_smprintf_free(out); */ - LL_L2I(intout, cd->value.i64); - fprintf(stdout, "%d", intout); + fprintf(stdout, "%ld", cd->value.i64); break; case TD_INT32: fprintf(stdout, "%d", cd->value.i32); @@ -875,8 +872,7 @@ XPT_DumpConstDescriptor(XPTHeader *header, XPTConstDescriptor *cd, /* fputs(out, stdout); */ /* PR_smprintf_free(out); */ /* XXX punt for now to remove NSPR linkage. */ - LL_L2UI(uintout, cd->value.ui64); - fprintf(stdout, "%u", uintout); + fprintf(stdout, "%lu", cd->value.ui64); break; case TD_UINT32: fprintf(stdout, "%u", cd->value.ui32); diff --git a/src/libs/xpcom18a4/xpcom/typelib/xpt/tools/xpt_link.c b/src/libs/xpcom18a4/xpcom/typelib/xpt/tools/xpt_link.c index 2c5f24e6..19ed6319 100644 --- a/src/libs/xpcom18a4/xpcom/typelib/xpt/tools/xpt_link.c +++ b/src/libs/xpcom18a4/xpcom/typelib/xpt/tools/xpt_link.c @@ -59,7 +59,9 @@ typedef struct fixElement fixElement; static int compare_IDEs_by_IID(const void *ap, const void *bp); static int compare_IDE_with_zero(const void *ap); static int compare_IDEs_by_name(const void *ap, const void *bp); +#if 0 /* unused */ static int compare_IDEs_by_name_space(const void *ap, const void *bp); +#endif static int compare_strings(const void *ap, const void *bp); static int compare_pointers(const void *ap, const void *bp); static int compare_fixElements_by_IID(const void *ap, const void *bp); @@ -497,7 +499,7 @@ main(int argc, char **argv) /* Fix parent_interface first. */ - if (id->parent_interface && id->parent_interface != 0) { + if (id->parent_interface) { id->parent_interface = get_new_index(fix_array, totalNumberOfInterfaces, fix_array[i].file_num, id->parent_interface); @@ -688,6 +690,7 @@ compare_IDEs_by_name(const void *ap, return answer; } +#if 0 /* unused */ static int compare_IDEs_by_name_space(const void *ap, const void *bp) @@ -696,6 +699,7 @@ compare_IDEs_by_name_space(const void *ap, return compare_strings(ide1->name_space, ide2->name_space); } +#endif static int compare_strings(const void *ap, const void *bp)