Skip to content

Dsc

dsc

Data model for the EDK II DSC.

dsc_set

a DSC set object.

__init__

__init__(allowed_classes: list = None) -> dsc_set

Initializes an empty set.

add

add(item: Any) -> None

Adds the item to the set.

Raises:

Type Description
ValueError

if the type is not allowed to be added.

dsc_dict

A dictionary that allows specific classes as headers and sections.

__init__

__init__(
    allowed_key_classes: Optional[str] = None,
    allowed_value_classes: Optional[Any] = None,
) -> dsc_dict

Initializes a dsc_dict.

__missing__

__missing__(key: int) -> str

Describes how to handle a missing key.

Makes a new dsc_set if allowed.

Raises:

Type Description
KeyError

If not allowed

__setitem__

__setitem__(key: int, val: str) -> None

Setting a key value pair in the Ordered Dictionary.

Raises:

Type Description
ValueError

Adding a invalid key to restricted set

ValueError

Adding a invalid set to a restricted dict

ValueError

Adding a section that already exists

dsc

Class representing a DSC.

__init__

__init__(file_path: Optional[str] = None) -> dsc

Inits dsc type.

__eq__

__eq__(other: dsc) -> bool

Enables equality comparisons (a == b).

Warning

This doesn't check for a perfect copy of everything this is mainly focused on does it define the same things

dsc_section_type

dsc section type.

Attributes:

Name Type Description
arch str

architecture

module_type str

module type

__init__

__init__(
    arch: str = "common", module_type: str = "common"
) -> dsc_section_type

Inits dsc section type.

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__eq__

__eq__(other: dsc_section_type) -> bool

Enables equality comparisons (a == b).

__repr__

__repr__() -> str

A string representation of the object.

IsValidModuleType classmethod

IsValidModuleType(name: str) -> bool

If the module type is valid or not.

dsc_buildoption_section_type

Build option section type.

Attributes:

Name Type Description
codebase

Examples:

BuildOptions.$(arch).CodeBase.Edk2ModuleType
BuildOptions.$(arch).CodeBase
BuildOptions.common.CodeBase
BuildOptions.$(arch)
BuildOptions.common
BuildOptions

__init__

__init__(
    arch: str = "common",
    codebase: str = "common",
    module_type: str = "common",
) -> dsc_buildoption_section_type

Inits dsc build option section type.

IsValidCodeBase classmethod

IsValidCodeBase(codebase: str) -> bool

Determines if codebase is valid.

Parameters:

Name Type Description Default
codebase str

codebase

required

Returns:

Type Description
bool

True if COMMON, EDK, EDKII else false

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__eq__

__eq__(other: dsc_buildoption_section_type) -> bool

Enables equality comparisons (a == b).

__repr__

__repr__() -> str

A string representation of the object.

dsc_pcd_section_type

This class is uses to define the PCD section type inside a component.

Attributes:

Name Type Description
pcdtype

pcd type

arch

defaults to common

sku

defaults to DEFAULT

store

if none, we don't have anything done

__init__

__init__(
    pcdtype: str,
    arch: str = "common",
    sku: str = "DEFAULT",
    store: Optional[str] = None,
) -> dsc_pcd_section_type

Inits the dsc_pcd_section object.

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__repr__

__repr__() -> str

A string representation of the object.

__eq__

__eq__(other: dsc_pcd_section_type) -> bool

Enables equality comparisons (a == b).

dsc_pcd_component_type

This class is uses to define the PCD type inside a component.

__init__

__init__(pcdtype: str) -> dsc_pcd_component_type

Inits the dsc_pcd_component object.

__repr__

__repr__() -> str

A string representation of the object.

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__eq__

__eq__(other: dsc_pcd_component_type) -> bool

Enables equality comparisons (a == b).

sku_id

Contains the data for a sku.

Parameters:

Name Type Description Default
id int

sku id number

0
name str

name of the sku

'DEFAULT'
parent str

parent

'DEFAULT'
source_info Optional[source_info]

source info

None

__init__

__init__(
    id: int = 0,
    name: str = "DEFAULT",
    parent: str = "DEFAULT",
    source_info: Optional[source_info] = None,
) -> sku_id

Inits the sku_id object.

__eq__

__eq__(other: sku_id) -> bool

Enables equality comparisons (a == b).

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__repr__

__repr__() -> str

A string representation of the object.

component

Contains the data for a component for the EDK build system to build.

__init__

__init__(
    inf: str, source_info: Optional[source_info] = None
) -> component

Inits the component object.

__eq__

__eq__(other: component) -> bool

Enables equality comparisons (a == b).

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__repr__

__repr__() -> str

A string representation of the object.

definition

Contains the information on a definition.

Parameters:

Name Type Description Default
name str

definition name

required
value str

definition value

required
local bool

if the value is local or not

False
source_info Optional[source_info]

source info

None

__init__

__init__(
    name: str,
    value: str,
    local: bool = False,
    source_info: Optional[source_info] = None,
) -> definition

Inits the definition object.

NOTE: Local means DEFINE is in front and is localized to that particular section

__repr__

__repr__() -> str

A string representation of the object.

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__eq__

__eq__(other: definition) -> bool

Enables equality comparisons (a == b).

library

Contains the data for a specific EDK library.

Attributes:

Name Type Description
inf str

inf file

source_info

__init__

__init__(
    inf: str, source_info: Optional[source_info] = None
) -> library

Inits the Library object.

__eq__

__eq__(other: library) -> bool

Enables equality comparisons (a == b).

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__repr__

__repr__() -> str

A string representation of the object.

library_class

Contains the data for a specific EDK2 library class.

Attributes:

Name Type Description
libraryclass

the EDK2 library class

inf)

the inf

source_info

source info

__init__

__init__(
    libraryclass: str,
    inf: str,
    source_info: Optional[source_info] = None,
) -> library_class

Inits the Library class object.

Parameters:

Name Type Description Default
libraryclass str

the EDK2 library class

required
inf str

the inf

required
source_info Optional[source_info]

source info

None

__eq__

__eq__(other: library_class) -> bool

Enables equality comparisons (a == b).

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__repr__

__repr__() -> str

A string representation of the object.

pcd

A PCD object.

Attributes:

Name Type Description
namespace

namespace

name

pcd name

value

pcd value

source_info

source info

__init__

__init__(
    namespace: str,
    name: str,
    value: str,
    source_info: Optional[source_info] = None,
) -> pcd

Inits a PCD object.

Parameters:

Name Type Description Default
namespace str

namespace

required
name str

pcd name

required
value str

pcd value

required
source_info Optional[source_info]

source info

None

__eq__

__eq__(other: pcd) -> bool

Enables equality comparisons (a == b).

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__repr__

__repr__() -> str

A string representation of the object.

pcd_typed

A Typed PCD object.

Attributes:

Name Type Description
datum_type

Data Type

max_size

max size of the data type

__init__

__init__(
    namespace: str,
    name: str,
    value: str,
    datum_type: str,
    max_size: int = 0,
    source_info: Optional[source_info] = None,
) -> pcd_typed

Inits the Typed PCD Object.

__repr__

__repr__() -> str

A string representation of the object.

pcd_variable

A Variable PCD object.

Attributes:

Name Type Description
var_name

VariableName

var_guid

VariableGuid

var_offset

VariableOffset

default

default value

attribute

Optional attributes

source_info

source info

__init__

__init__(
    namespace: str,
    name: str,
    var_name: str,
    var_guid: str,
    var_offset: str,
    default: Optional[str] = None,
    attributes: Optional[str] = None,
    source_info: Optional[source_info] = None,
) -> pcd_variable

Inits a pcd_variable object.

__repr__

__repr__() -> str

A string representation of the object.

build_option

Build option object.

Attributes:

Name Type Description
tool_code

One of the defined tool codes in the Conf/tools_def.txt file.

attribute

for example flags, d_path, path

data

the actual flags or path you want to set

target

DEBUG, RELEASE, or other

tagname

the tool chain tag

arch

ARM, AARCH64, IA32, X64, etc

family

Conf/tools_def.txt defines FAMILY as one of MSFT, INTEL or GCC.

replace

whether or not this replaces the default from tools_def, if this is false, we append

source_info

source_info object.

Contains the data for a build option

__init__

__init__(
    tool_code: str,
    attribute: str,
    data: str,
    target: str = "*",
    tagname: str = "*",
    arch: str = "*",
    family: Optional[str] = None,
    replace: bool = False,
    source_info: source_info = None,
) -> build_option

Inits a build_option object.

Parameters:

Name Type Description Default
tool_code str

One of the defined tool codes in the Conf/tools_def.txt file.

required
attribute str

for example flags, d_path, path

required
data str

the actual flags or path you want to set

required
target str

DEBUG, RELEASE, or other

'*'
tagname str

the tool chain tag

'*'
arch str

ARM, AARCH64, IA32, X64, etc

'*'
family Optional[str]

Conf/tools_def.txt defines FAMILY as one of MSFT, INTEL or GCC.

None
replace bool

whether or not this replaces the default from tools_def, if this is false, we append

False
source_info source_info

source_info object.

None
attribute Attribute:

The flags defined in this section are appended to flags defined in the tools_def.txt file for individual tools.

fam9ily Attribute:

Typically, this field is used to help the build tools determine whether the line is used for Microsoft style Makefiles or the GNU style Makefile

__eq__

__eq__(other: build_option) -> bool

Enables equality comparisons (a == b).

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__repr__

__repr__(include_data: bool = True) -> str

A string representation of the object.

default_store

Object containing information on a default store.

Attributes:

Name Type Description
index

index

value

defaults to "Standard"

source_info

defaults to None

__init__

__init__(
    index: int = 0,
    value: str = "Standard",
    source_info: Optional[str] = None,
) -> default_store

Inits a default store object.

NOTE: Local means DEFINE is in front and is localized to that particular section

__repr__

__repr__() -> str

A string representation of the object.

__hash__

__hash__() -> int

Returns the hash of an object for hashtables.

__eq__

__eq__(other: default_store) -> bool

Enables equality comparisons (a == b).

source_info

Object representing source file information.

Attributes:

Name Type Description
file str

filename

lineno

__init__

__init__(file: str, lineno: int = None) -> source_info

Inits a source_info object.

__repr__

__repr__() -> str

Returns a string representation of object.