python_code
stringlengths
0
679k
repo_name
stringlengths
9
41
file_path
stringlengths
6
149
# Copyright 2016 The Brotli Authors. All rights reserved. # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT import unittest from . import _test_utils import brotli class TestCompress(_test_utils.TestCase): VARIANTS = {'quality': (1, 6, 9, 11), 'lgwi...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/C/BrotliCompress/brotli/python/tests/compress_test.py
# Copyright 2016 The Brotli Authors. All rights reserved. # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT import subprocess import unittest from . import _test_utils import brotli BRO_ARGS = _test_utils.BRO_ARGS TEST_ENV = _test_utils.TEST_ENV def _ge...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/C/BrotliCompress/brotli/python/tests/bro_test.py
# Copyright 2016 The Brotli Authors. All rights reserved. # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT import unittest from . import _test_utils import brotli def _get_original_name(test_data): return test_data.split('.compressed')[0] class Te...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/C/BrotliCompress/brotli/python/tests/decompress_test.py
# Copyright 2016 The Brotli Authors. All rights reserved. # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT import functools import unittest from . import _test_utils import brotli def _get_original_name(test_data): return test_data.split('.compresse...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/C/BrotliCompress/brotli/python/tests/decompressor_test.py
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/C/BrotliCompress/brotli/python/tests/__init__.py
from __future__ import print_function import filecmp import glob import itertools import os import sys import sysconfig import tempfile import unittest project_dir = os.path.abspath(os.path.join(__file__, '..', '..', '..')) test_dir = os.getenv("BROTLI_TESTS_PATH") BRO_ARGS = [os.getenv("BROTLI_WRAPPER")] # Fallback...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/C/BrotliCompress/brotli/python/tests/_test_utils.py
# Copyright 2016 The Brotli Authors. All rights reserved. # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT import functools import unittest from . import _test_utils import brotli # Do not inherit from TestCase here to ensure that test methods # are not...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/C/BrotliCompress/brotli/python/tests/compressor_test.py
# @file NmakeSubdirs.py # This script support parallel build for nmake in windows environment. # It supports Python2.x and Python3.x both. # # Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # # # Import Modules # from __future__ import print_function...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Source/C/Makefiles/NmakeSubdirs.py
## @file # Unit tests for AutoGen.UniClassObject # # Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # import os import unittest import codecs import TestTools from Common.Misc import PathClass import AutoGen.UniClassObject as...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Tests/CheckUnicodeSourceFiles.py
## @file # Unit tests for checking syntax of Python source code # # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # import os import unittest import py_compile import TestTools class Tests(TestTools.BaseToolsTest): ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Tests/CheckPythonSyntax.py
from __future__ import print_function ## @file # Utility functions and classes for BaseTools unit tests # # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # import base64 import os import os.path import random import shuti...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Tests/TestTools.py
## @file # Test whether PYTHON_COMMAND is available # # Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # if __name__ == '__main__': print('TRUE')
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Tests/PythonTest.py
## @file # Unit tests for TianoCompress utility # # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # from __future__ import print_function import os import random import sys import unittest import TestTools class Tests(TestTool...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Tests/TianoCompress.py
## @file # Routines for generating Pcd Database # # Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent import unittest from Common.Misc import RemoveCComments from Workspace.BuildClassObject import ArrayIndex class TestRe(unittest.TestCase): def test_cco...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Tests/TestRegularExpression.py
## @file # Unit tests for Python based BaseTools # # Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # import os import sys import unittest def TheTestSuite(): suites = [] import CheckPythonSyntax suites.appen...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Tests/PythonToolsTests.py
## @file # Unit tests for C based BaseTools # # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # import os import sys import unittest import TianoCompress modules = ( TianoCompress, ) def TheTestSuite(): suites = l...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Tests/CToolsTests.py
## @file # Unit tests for BaseTools utilities # # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # import os import sys import unittest import TestTools def GetCTestSuite(): import CToolsTests return CToolsTests.TheTest...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Tests/RunTests.py
## # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import logging import json try: from edk2toolext.environment.plugintypes.uefi_build_plugin import IUefiBuildPlugin class BuildToolsReportGenerator(IUefiBuildPlugin): def do_report(self, thebuilder): ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Plugin/BuildToolsReport/BuildToolsReportGenerator.py
# @file LinuxGcc5ToolChain.py # Plugin to configures paths for GCC5 ARM/AARCH64 Toolchain ## # This plugin works in conjuncture with the tools_def # # Copyright (c) Microsoft Corporation # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> # Copyright (c) 2022, Loongson Technology C...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py
# @file WindowsVsToolChain.py # Plugin to configures paths for the VS2017 and VS2019 tool chain ## # This plugin works in conjuncture with the tools_def # # Copyright (c) Microsoft Corporation # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import logging from edk2toolext.environment.plugintypes.uefi_build_...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
## @file WinRcPath.py # Plugin to find Windows SDK Resource Compiler rc.exe ## # This plugin works in conjuncture with the tools_def to support rc.exe # # Copyright (c) Microsoft Corporation # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os from edk2toolext.environment.plugintypes.uefi_build_plugin import IUe...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Plugin/WindowsResourceCompiler/WinRcPath.py
# @file HostBasedUnitTestRunner.py # Plugin to located any host-based unit tests in the output directory and execute them. ## # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent # ## import os import logging import glob import stat import xml.etree.ElementTree from edk2toolext.environm...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
## @file # Detect unreferenced PCD and GUID/Protocols/PPIs. # # Copyright (c) 2019, Intel Corporation. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ''' DetectNotUsedItem ''' import re import os import sys import argparse # # Globals for help information # __prog__ = 'DetectNotUsedItem' __ve...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/DetectNotUsedItem.py
#!/usr/bin/python3 ''' Copyright (c) Apple Inc. 2021 SPDX-License-Identifier: BSD-2-Clause-Patent Class that abstracts PE/COFF debug info parsing via a Python file like object. You can port this code into an arbitrary debugger by invoking the classes and passing in a file like object that abstracts the debugger readin...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/efi_debugging.py
## @file # Retrieves the people to request review from on submission of a commit. # # Copyright (c) 2019, Linaro Ltd. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from __future__ import print_function from collections import defaultdict from collections import OrderedDict import argpa...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/GetMaintainer.py
#!/usr/bin/python3 ''' Copyright (c) Apple Inc. 2021 SPDX-License-Identifier: BSD-2-Clause-Patent Example usage: OvmfPkg/build.sh qemu -gdb tcp::9000 lldb -o "gdb-remote localhost:9000" -o "command script import efi_lldb.py" ''' import optparse import shlex import subprocess import uuid import sys import os from path...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/efi_lldb.py
# @file ConvertMasmToNasm.py # This script assists with conversion of MASM assembly syntax to NASM # # Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from __future__ import print_function # # Import Modules # import argparse import io import...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/ConvertMasmToNasm.py
## @file # Check a patch for various format issues # # Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from __future__ import print_function VersionNumber = '0.1' __copyright__ = "Copyright (c) 2015, Intel Corporation All rights reserved." import...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/ConvertUni.py
## @file # Get current UTC date and time information and output as ascii code. # # Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # VersionNumber = '0.1' import sys import datetime import argparse def Main(): PARSER = argparse.ArgumentParser( ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/GetUtcDateTime.py
## # Generate symbal for memory profile info. # # This tool depends on DIA2Dump.exe (VS) or nm (gcc) to parse debug entry. # # Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## from __future__ import print_function import os import re import sys ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/MemoryProfileSymbolGen.py
## @file # Set up the git configuration for contributing to TianoCore projects # # Copyright (c) 2019, Linaro Ltd. All rights reserved.<BR> # Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from __future__ import print_function import argparse impo...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/SetupGit.py
## @file # Run a makefile as part of a PREBUILD or POSTBUILD action. # # Copyright (c) 2017, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ''' RunMakefile.py ''' import os import sys import argparse import subprocess # # Globals for help information # __prog__ = ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/RunMakefile.py
# @file FormatDosFiles.py # This script format the source files to follow dos style. # It supports Python2.x and Python3.x both. # # Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # # # Import Modules # from __future__ import print_function import arg...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/FormatDosFiles.py
## @file # Update build revisions of the tools when performing a developer build # # This script will modife the C/Include/Common/BuildVersion.h file and the two # Python scripts, Python/Common/BuildVersion.py and Python/UPT/BuildVersion.py. # If SVN is available, the tool will obtain the current checked out version of...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/UpdateBuildVersions.py
## @file # Check a patch for various format issues # # Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR> # Copyright (C) 2020, Red Hat, Inc.<BR> # Copyright (c) 2020, ARM Ltd. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from __future__ import print_function Ve...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PatchCheck.py
## @file # Convert a binary file to a VOID* PCD value or DSC file VOID* PCD statement. # # Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ''' BinToPcd ''' from __future__ import print_function import sys import argparse import re import xdrlib ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/BinToPcd.py
#!/usr/bin/python ## @file # Firmware Configuration Editor (FCE) from https://firmware.intel.com/develop # can parse BIOS image and generate Firmware Configuration file. # This script bases on Firmware Configuration file, and generate the structure # PCD setting in DEC/DSC/INF files. # # Copyright (c) 2018, Intel Corpo...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/ConvertFceToStructurePcd.py
## # Generate symbal for SMI handler profile info. # # This tool depends on DIA2Dump.exe (VS) or nm (gcc) to parse debug entry. # # Copyright (c) 2017, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## from __future__ import print_function import os import re import sys fr...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/SmiHandlerProfileSymbolGen.py
#!/usr/bin/python3 ''' Copyright 2021 (c) Apple Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent EFI gdb commands based on efi_debugging classes. Example usage: OvmfPkg/build.sh qemu -gdb tcp::9000 gdb -ex "target remote localhost:9000" -ex "source efi_gdb.py" (gdb) help efi Commands for debugg...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/efi_gdb.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent #
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/__init__.py
## @file # This module provide command line entry for generating package document! # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from __future__ import print_function import os, sys, logging, traceback, subprocess from optparse import Opti...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent #
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/__init__.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent #
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/__init__.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from __future__ import print_function import array import uuid import re import os import logging import core.pe as pe def GetLogger(): return logging.getLogger('EFI Binary File')...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/efibinary.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent #
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/__init__.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # def GetEdkLogger(): import logging return logging.getLogger('edk') class EdkException(Exception): def __init__(self, message, fName=None, fNo=None): self._message ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/message.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # import core.editor class INIDoc(core.editor.EditorDocument): def __init__(self): core.editor.EditorDocument.__init__(self) self._iniobj = None class INIView(core...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/inidocview.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from __future__ import print_function from __future__ import absolute_import import os from .message import * class BaseDoxygeItem: def __init__(self, name, tag=''): self...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/doxygen.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from __future__ import absolute_import from .message import * import re import os section_re = re.compile(r'^\[([\w., "]+)\]') class BaseINIFile(object): _objs = {} def __new...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/ini.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent #
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/__init__.py
## @file # # This file produce action class to generate doxygen document for edk2 codebase. # The action classes are shared by GUI and command line tools. # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent from plugins.EdkPlugins.basemodel import...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen_spec.py
## @file # # This file produce action class to generate doxygen document for edk2 codebase. # The action classes are shared by GUI and command line tools. # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent """This file produce action class to gen...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent #
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/__init__.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from plugins.EdkPlugins.basemodel import ini import re, os from plugins.EdkPlugins.basemodel.message import * class DECFile(ini.BaseINIFile): def GetSectionInstance(self, parent,...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/dec.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from plugins.EdkPlugins.basemodel import ini import re, os from plugins.EdkPlugins.basemodel.message import * class DSCFile(ini.BaseINIFile): def GetSectionInstance(self, parent, ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/dsc.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # from plugins.EdkPlugins.basemodel import ini import re, os from plugins.EdkPlugins.basemodel.message import * class INFFile(ini.BaseINIFile): _libobjs = {} def GetSectionInst...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/inf.py
## @file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent from plugins.EdkPlugins.basemodel import ini from plugins.EdkPlugins.edk2.model import dsc from plugins.EdkPlugins.edk2.model import inf from plugins.EdkPlugins.edk2.model import dec imp...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/baseobject.py
# @file # Script to Build OVMF UEFI firmware # # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) from PlatformBuildLib import SettingsManager from PlatformBuildLib import PlatformBuilder # #####...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/OvmfPkg/PlatformCI/BhyveBuild.py
# @file # Script to Build OVMF UEFI firmware # # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) from PlatformBuildLib import SettingsManager from PlatformBuildLib import PlatformBuilder # #####...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/OvmfPkg/PlatformCI/IntelTdxBuild.py
# @file # Script to Build OVMF UEFI firmware # # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) from PlatformBuildLib import SettingsManager from PlatformBuildLib import PlatformBuilder # #####...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/OvmfPkg/PlatformCI/CloudHvBuild.py
# @file # Script to Build OVMF UEFI firmware # # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) from PlatformBuildLib import SettingsManager from PlatformBuildLib import PlatformBuilder # #####...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/OvmfPkg/PlatformCI/MicrovmBuild.py
# @file # Script to Build OVMF UEFI firmware # # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import sys import subprocess sys.path.append(os.path.dirname(os.path.abspath(__file__))) from PlatformBuildLib import SettingsManager from PlatformBuildLib import PlatformBu...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/OvmfPkg/PlatformCI/AmdSevBuild.py
# @file # Script to Build OVMF UEFI firmware # # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import logging import io from edk2toolext.environment import shell_environment from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables.edk2_pl...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/OvmfPkg/PlatformCI/PlatformBuildLib.py
# @file # Script to Build OVMF UEFI firmware # # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) from PlatformBuildLib import SettingsManager from PlatformBuildLib import PlatformBuilder # #####...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/OvmfPkg/PlatformCI/XenBuild.py
# @file # Script to Build OVMF UEFI firmware # # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) from PlatformBuildLib import SettingsManager from PlatformBuildLib import PlatformBuilder # #####...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/OvmfPkg/PlatformCI/PlatformBuild.py
## @file # Automate the process of building the various reset vector types # # Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # import os import subprocess import sys PAGE_TABLE_2M = 'PageTable2M' PAGE_TABLE_1G = 'PageTable1G' FILE_FORMAT ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/UefiCpuPkg/ResetVector/Vtf0/Build.py
## @file # Apply fixup to VTF binary image for FFS Raw section # # Copyright (c) 2008 - 2021, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # import sys filename = sys.argv[1] d = open(sys.argv[1], 'rb').read() c = ((len(d) + 4 + 7) & ~7) - 4 if c > len(d): c -= ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py
# # Copyright (c) 2011-2013, ARM Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # import os import firmware_volume import build_report import system_table # Reload external classes reload(firmware_volume) reload(build_report) reload(system_table) def readMem32(executionContext, add...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py
# # Copyright (c) 2021, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # from arm_ds.debugger_v1 import DebugException import subprocess, os, edk2_debugger, re def get_module_name(line): path = line.rsplit(' ')[1] return os.path.splitext(os.path.basename(path))[0] def g...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/ArmPlatformPkg/Scripts/Ds5/console_loader.py
# # Copyright (c) 2011-2021, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # from arm_ds.debugger_v1 import Debugger from arm_ds.debugger_v1 import DebugException from console_loader import load_symbol_from_console import re, sys, getopt import edk2_debugger # Reload external...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py
#!/usr/bin/python # # Copyright (c) 2014, ARM Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # import getopt import operator import os import pickle import sys from sys import argv from cStringIO import StringIO modules = {} functions = {} functions_addr = {} def usage(): print...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/ArmPlatformPkg/Scripts/Ds5/profile.py
# # Copyright (c) 2011-2013, ARM Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # from arm_ds.debugger_v1 import DebugException import struct import string import edk2_debugger class EfiFileSection(object): EFI_SECTION_PE32 = 0x10 EFI_SECTION_PIC ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/ArmPlatformPkg/Scripts/Ds5/firmware_volume.py
# # Copyright (c) 2011-2012, ARM Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # import re class BuildReport: PCDs = {} def parse_platform_summary(self, file): pass def parse_pcd_report(self, report_file): pcd_reg = re.compile(" (\*P|\*F|\*M| ) (\w+)(\...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/ArmPlatformPkg/Scripts/Ds5/build_report.py
# # Copyright (c) 2011-2013, ARM Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # from arm_ds.debugger_v1 import DebugException import struct import edk2_debugger import firmware_volume class DebugInfoTable: CONST_DEBUG_INFO_TABLE_GUID = ( 0x49152E77L, 0x47641ADAL, 0xFE7AA2B7L,...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/ArmPlatformPkg/Scripts/Ds5/system_table.py
## @file # This file contains the script to build UniversalPayload # # Copyright (c) 2021, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent ## import argparse import subprocess import os import shutil import sys from ctypes import * sys.dont_write_bytecode = True class UPL...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/UefiPayloadPkg/UniversalPayloadBuild.py
# -*- coding: utf-8 -*- # # Jansson documentation build configuration file, created by # sphinx-quickstart on Sun Sep 5 21:47:20 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/RedfishPkg/Library/JsonLib/jansson/doc/conf.py
""" refcounting ~~~~~~~~~~~ Reference count annotations for C API functions. Has the same result as the sphinx.ext.refcounting extension but works for all functions regardless of the signature, and the reference counting information is written inline with the documentation instead of a sepa...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/RedfishPkg/Library/JsonLib/jansson/doc/ext/refcounting.py
#!/usr/bin/python # # Copyright 2014 Apple Inc. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # import lldb import os import uuid import string import optparse import shlex guid_dict = {} def EFI_GUID_TypeSummary (valobj,internal_dict): """ Type summary for EFI GUID, print C Name if k...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/EmulatorPkg/Unix/lldbefi.py
# @file # Script to Build EmulatorPkg UEFI firmware # # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import logging import io from edk2toolext.environment import shell_environment from edk2toolext.environment.uefi_build import UefiBuilder from edk2toolext.invocables....
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/EmulatorPkg/PlatformCI/PlatformBuild.py
## @ SplitFspBin.py # # Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## import os import sys import uuid import copy import struct import argparse from ctypes import * from functools import reduce """ This utility supports some operations fo...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/Tools/SplitFspBin.py
#!/usr/bin/env python ## @ FspDscBsf2Yaml.py # This script convert DSC or BSF format file into YAML format # # Copyright(c) 2021, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## import os import re import sys from collections import OrderedDict from datetime import date...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py
## @ PatchFv.py # # Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## import os import re import sys # # Read data from file # # param [in] binfile Binary file # param [in] offset Offset # param [in] len Length # # retva...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/Tools/PatchFv.py
## @ GenCfgOpt.py # # Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## import os import re import sys import struct from datetime import date from functools import reduce # Generated file copyright header __copyright_txt__ = """## @file # # ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/Tools/GenCfgOpt.py
# @ GenCfgData.py # # Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## import os import re import sys import marshal from functools import reduce from datetime import date # Generated file copyright header __copyright_tmp__ = """/** @file C...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/Tools/FspGenCfgData.py
# @file # Split a file into two pieces at the request offset. # # Copyright (c) 2021, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules import unittest import tempfile import os import shutil import struct as st import filecmp import os, sys currentd...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/Tools/Tests/test_yaml.py
#!/usr/bin/env python # @ SingleSign.py # Single signing script # # Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## import os import sys import re import shutil import subprocess SIGNING_KEY = { # Key Id | Ke...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/Tools/ConfigEditor/SingleSign.py
# @ GenYamlCfg.py # # Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # # import os import sys import re import marshal import string import operator as op import ast import tkinter.messagebox as messagebox import tkinter from datetime import date ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/Tools/ConfigEditor/GenYamlCfg.py
#!/usr/bin/env python # @ CommonUtility.py # Common utility script # # Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## import os import sys import shutil import subprocess import string from ctypes import ARRAY, c_char, c_uint16, c_uint32, \ ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/Tools/ConfigEditor/CommonUtility.py
# @ ConfigEditor.py # # Copyright(c) 2018 - 2021, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## import os import sys import marshal import tkinter import tkinter.ttk as ttk import tkinter.messagebox as messagebox import tkinter.filedialog as filedialog from pickle imp...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/Tools/ConfigEditor/ConfigEditor.py
## @file # Automate the process of building the various reset vector types # # Copyright (c) 2014, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # import glob import os import subprocess import sys def RunCommand(commandLine): #print ' '.join(commandLine) retu...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/FspSecCore/Vtf0/Build.py
## @file # Apply fixup to VTF binary image for FFS Raw section # # Copyright (c) 2014, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # import sys filename = sys.argv[1] if filename.lower().find('ia32') >= 0: d = open(sys.argv[1], 'rb').read() c = ((len(d) + 4...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/IntelFsp2Pkg/FspSecCore/Vtf0/Tools/FixupForRawSection.py
# -*- coding: utf-8 -*- # dict_conv.py (Python3 script) import sys ENC_UTF16_BE = 1 ENC_UTF16_LE = 2 def add_char(enc, s, c): if enc == ENC_UTF16_BE: s += "\\x00" s += c if enc == ENC_UTF16_LE: s += "\\x00" return s def conv(enc, s): n = len(s) r = "" i = 0 while i < n: c = s[i] i...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/harnesses/dict_conv.py
#!/usr/bin/python # -*- coding: utf-8 -*- # gperf_fold_key_conv.py # Copyright (c) 2016-2018 K.Kosako import sys import re REG_LINE_GPERF = re.compile('#line .+gperf"') REG_HASH_FUNC = re.compile('hash\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+size_t\s+len\s*\)') REG_STR_AT = re.compile('str\[(\d+)\]') RE...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/src/gperf_fold_key_conv.py
#!/usr/bin/python # -*- coding: utf-8 -*- # make_unicode_property_data.py # Copyright (c) 2016-2019 K.Kosako import sys import re POSIX_LIST = [ 'NEWLINE', 'Alpha', 'Blank', 'Cntrl', 'Digit', 'Graph', 'Lower', 'Print', 'Punct', 'Space', 'Upper', 'XDigit', 'Word', 'Alnum', 'ASCII' ] MAX_CODE_POINT = 0x10ffff...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/src/make_unicode_property_data.py
#!/usr/bin/python # -*- coding: utf-8 -*- # make_unicode_fold_data.py # Copyright (c) 2016-2020 K.Kosako import sys import re SOURCE_FILE = 'CaseFolding.txt' GPERF_UNFOLD_KEY_FILE = 'unicode_unfold_key.gperf' GPERF_FOLD_KEY_FILES = ['unicode_fold1_key.gperf', 'unicode_fold2_key.gperf', 'unicode_fold3_key.gperf'] ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/src/make_unicode_fold_data.py
#!/usr/bin/python # -*- coding: utf-8 -*- # make_unicode_egcb_data.py # Copyright (c) 2017-2019 K.Kosako import sys import re MAX_CODE_POINT = 0x10ffff PR_TOTAL_REG = re.compile("#\s*Total\s+(?:code\s+points|elements):") PR_LINE_REG = re.compile("([0-9A-Fa-f]+)(?:..([0-9A-Fa-f]+))?\s*;\s*(\w+)") PA_LINE_REG = re....
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/src/make_unicode_egcb_data.py
#!/usr/bin/python # -*- coding: utf-8 -*- # make_unicode_wb_data.py # Copyright (c) 2019 K.Kosako import sys import re MAX_CODE_POINT = 0x10ffff PR_TOTAL_REG = re.compile("#\s*Total\s+(?:code\s+points|elements):") PR_LINE_REG = re.compile("([0-9A-Fa-f]+)(?:..([0-9A-Fa-f]+))?\s*;\s*(\w+)") PA_LINE_REG = re.compile...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/src/make_unicode_wb_data.py
#!/usr/bin/python # -*- coding: utf-8 -*- # gperf_unfold_key_conv.py # Copyright (c) 2016-2018 K.Kosako import sys import re REG_LINE_GPERF = re.compile('#line .+gperf"') REG_HASH_FUNC = re.compile('hash\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+size_t\s+len\s*\)') REG_STR_AT = re.compile('str\[(\d+)\]') ...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/src/gperf_unfold_key_conv.py
# Copyright 2015 The Brotli Authors. All rights reserved. # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT import os import platform import re import unittest try: from setuptools import Extension from setuptools import setup except: from dist...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/setup.py
#! /usr/bin/env python """Compression/decompression utility using the Brotli algorithm.""" from __future__ import print_function import argparse import sys import os import platform import brotli # default values of encoder parameters DEFAULT_PARAMS = { 'mode': brotli.MODE_GENERIC, 'quality': 11, 'lgwin'...
nvtrust-main
infrastructure/kvm/ovmf/ovmf_source/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/python/bro.py