1 | ## @file
|
---|
2 | # Mde DSC include file for [LibraryClasses*] section of all Architectures.
|
---|
3 | #
|
---|
4 | # This file can be included to the [LibraryClasses*] section(s) of a platform DSC file
|
---|
5 | # by using "!include MdePkg/MdeLibs.dsc.inc" to specify the library instances
|
---|
6 | # of some EDKII basic/common library classes.
|
---|
7 | #
|
---|
8 | # Copyright (c) 2021 - 2024, Intel Corporation. All rights reserved.<BR>
|
---|
9 | #
|
---|
10 | # SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
11 | #
|
---|
12 | ##
|
---|
13 |
|
---|
14 | [Defines]
|
---|
15 | !ifndef CUSTOM_STACK_CHECK_LIB
|
---|
16 | # The DSC parser will set any unset macros to 0. Then, below when we check for STATIC or DYNAMIC, even if we couch
|
---|
17 | # that in a !ifdef CUSTOM_STACK_CHECK_LIB, the parser will issue a warning that we are comparing a boolean (0) against
|
---|
18 | # a string, which will always fail. So we set it to a dummy value here.
|
---|
19 | DEFINE CUSTOM_STACK_CHECK_LIB = NONE
|
---|
20 | !endif
|
---|
21 |
|
---|
22 | [LibraryClasses]
|
---|
23 | OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
|
---|
24 | ArmTrngLib|MdePkg/Library/BaseArmTrngLibNull/BaseArmTrngLibNull.inf
|
---|
25 | RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
|
---|
26 | CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
|
---|
27 | SmmCpuRendezvousLib|MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf
|
---|
28 | SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
|
---|
29 | SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
|
---|
30 | MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf
|
---|
31 | StackCheckFailureHookLib|MdePkg/Library/StackCheckFailureHookLibNull/StackCheckFailureHookLibNull.inf
|
---|
32 |
|
---|
33 | !if $(CUSTOM_STACK_CHECK_LIB) == STATIC
|
---|
34 | # To only use the static stack cookie, we just include the checking functionality.
|
---|
35 | StackCheckLib|MdePkg/Library/StackCheckLib/StackCheckLib.inf
|
---|
36 | !elseif $(CUSTOM_STACK_CHECK_LIB) == DYNAMIC
|
---|
37 | StackCheckLib|MdePkg/Library/StackCheckLib/StackCheckLib.inf
|
---|
38 |
|
---|
39 | # To use the dynamic stack cookie, we need to include the entry point libraries that will set up the stack cookie.
|
---|
40 | # Typically, PeiCore and PEIMs will not use dynamic stack cookies, so they are not included generally.
|
---|
41 | # If dynamic stack cookies are not enabled, we do not setup the entry points, as the existing behavior was
|
---|
42 | # for a platform to define them.
|
---|
43 | # StandaloneMmCoreEntryPoint is not included here because support dynamic stack cookies is not available for
|
---|
44 | # AARCH64 here. X64 platforms should include the DynamicStackCookieEntryPointLib in their DSC file.
|
---|
45 | DxeCoreEntryPoint|MdePkg/Library/DynamicStackCookieEntryPointLib/DxeCoreEntryPoint.inf
|
---|
46 | StandaloneMmDriverEntryPoint|MdePkg/Library/DynamicStackCookieEntryPointLib/StandaloneMmDriverEntryPoint.inf
|
---|
47 | UefiApplicationEntryPoint|MdePkg/Library/DynamicStackCookieEntryPointLib/UefiApplicationEntryPoint.inf
|
---|
48 | UefiDriverEntryPoint|MdePkg/Library/DynamicStackCookieEntryPointLib/UefiDriverEntryPoint.inf
|
---|
49 |
|
---|
50 | !else
|
---|
51 | # If CUSTOM_STACK_CHECK_LIB is set, MdeLibs.dsc.inc will not link StackCheckLibNull and it is expected that the
|
---|
52 | # DSC being built is providing it's own implementation of StackCheckLib.
|
---|
53 | StackCheckLib|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf
|
---|
54 | !endif
|
---|
55 |
|
---|
56 | [LibraryClasses.common.SEC, LibraryClasses.common.PEI_CORE]
|
---|
57 | # edk2 does not implement exception handling for SEC and PEI_CORE, so StackCheckLibNull is used, as failing
|
---|
58 | # stack cookies will generate an exception, which if unhandled can lead to a hung system state. If a platform
|
---|
59 | # implements exception handling for SEC and PEI_CORE, it can use StackCheckLib for these phases in its DSC.
|
---|
60 | StackCheckLib|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf
|
---|
61 |
|
---|
62 | [LibraryClasses.ARM, LibraryClasses.AARCH64]
|
---|
63 | #
|
---|
64 | # It is not possible to prevent the ARM/AARCH64 compilers from inserting generic intrinsic functions.
|
---|
65 | # This library provides the intrinsic functions generated by these compilers.
|
---|
66 | #
|
---|
67 | # Linking this here as a null library will cause all ARM/AARCH64 files to link against it and have
|
---|
68 | # definitions for the intrinsic functions.
|
---|
69 | #
|
---|
70 | NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
|
---|