Compare commits
365 Commits
edk2-stabl
...
edk2-stabl
Author | SHA1 | Date | |
---|---|---|---|
|
4c0f6e349d | ||
|
2be4828af1 | ||
|
edfe16a6d9 | ||
|
1d3215fd24 | ||
|
b85048261a | ||
|
70228e101e | ||
|
c70bdf9d4a | ||
|
0997352ddb | ||
|
c230c002ac | ||
|
b1c1147059 | ||
|
cb30c8f251 | ||
|
5cd8be6079 | ||
|
a83dbf008c | ||
|
adc6898366 | ||
|
929d1a24d1 | ||
|
9e56970090 | ||
|
c13742b180 | ||
|
fbb9607223 | ||
|
578bcdc260 | ||
|
6d8f4bafad | ||
|
0b9026a823 | ||
|
c73fce3d12 | ||
|
3cf658ee7e | ||
|
e36d5ac7d1 | ||
|
f1d78c489a | ||
|
764e8ba138 | ||
|
c32be82e99 | ||
|
f9713abe95 | ||
|
1e947f9bf5 | ||
|
466b877f43 | ||
|
5b45b44e6f | ||
|
c788c2b1ad | ||
|
534fcb84de | ||
|
0f1ddb21ff | ||
|
707e6be745 | ||
|
3e63a91b17 | ||
|
7a38ad07d0 | ||
|
a67efa3b22 | ||
|
58bccfa57c | ||
|
422bf2725b | ||
|
02b7b861b1 | ||
|
ec97412b7c | ||
|
82af1cbf0d | ||
|
c44e0a896c | ||
|
818283de3f | ||
|
e465aae055 | ||
|
27fb01a0b0 | ||
|
b3407223c5 | ||
|
f76d50166b | ||
|
69c135462d | ||
|
67ead55b35 | ||
|
348a34d984 | ||
|
d148a178c1 | ||
|
ccb4c38a50 | ||
|
214bc6e206 | ||
|
ea26838a52 | ||
|
84a534b406 | ||
|
c4a53853c1 | ||
|
ce7b77a71b | ||
|
eb9db72ca8 | ||
|
a4826c8664 | ||
|
54d33a5314 | ||
|
f69248d093 | ||
|
5bd326c5f3 | ||
|
7f9e354a01 | ||
|
ddb7050c68 | ||
|
66360134f8 | ||
|
418aded964 | ||
|
ef62da4ff7 | ||
|
f60f4cfeb4 | ||
|
2a0755a947 | ||
|
a57268fe9e | ||
|
6b81166fff | ||
|
1825c24fd8 | ||
|
a302263ebb | ||
|
c38f0816e7 | ||
|
582b6cdd08 | ||
|
f16bd39441 | ||
|
6a5033ca3e | ||
|
ba562ca040 | ||
|
dd40a1f85c | ||
|
f9fd0c2108 | ||
|
ce4cca7c06 | ||
|
fc70522ffe | ||
|
aad15888d6 | ||
|
493dde944d | ||
|
38c92f7030 | ||
|
9854561c08 | ||
|
a2e7559576 | ||
|
f6fc95c943 | ||
|
48cf40b8c9 | ||
|
f221466ea7 | ||
|
e79bf8d707 | ||
|
5add2c5577 | ||
|
ff82167537 | ||
|
f7c4d22465 | ||
|
dad13c8067 | ||
|
81c6f1762e | ||
|
4cefb5e903 | ||
|
bb3594e842 | ||
|
f6c8bbbe92 | ||
|
68ddad3f60 | ||
|
5feb1fbd44 | ||
|
6deb4baa1f | ||
|
efb5659334 | ||
|
7de8045a09 | ||
|
6c585b52e5 | ||
|
ba3b642d5b | ||
|
c36b7b5114 | ||
|
cd72b6cfd1 | ||
|
d80c3d6e19 | ||
|
81a46615f5 | ||
|
0d622d9c3d | ||
|
f97117bae7 | ||
|
c194ccca26 | ||
|
8f628f7820 | ||
|
8d774c745c | ||
|
788421d5a7 | ||
|
43516263a8 | ||
|
fae43d06dd | ||
|
a8ecf980c0 | ||
|
c1d8b697cf | ||
|
b219e2cd4c | ||
|
0dbaba4239 | ||
|
13a623cf9c | ||
|
d22867471f | ||
|
957ca63190 | ||
|
5099057fb8 | ||
|
4be497df49 | ||
|
93b8ed68dd | ||
|
b854b07540 | ||
|
cc530cd10c | ||
|
1d031e750b | ||
|
29f7ad8b7c | ||
|
8c39253dff | ||
|
02d7b79771 | ||
|
7636747f44 | ||
|
7feed95031 | ||
|
db62b65c63 | ||
|
3d6b7fd303 | ||
|
26cfe2c659 | ||
|
de949fdbcf | ||
|
e60536756e | ||
|
513edcec28 | ||
|
7aa8af4576 | ||
|
4b026f0d5a | ||
|
b34ed98694 | ||
|
c10f7f77b0 | ||
|
7dcf32c1ee | ||
|
e5b911d411 | ||
|
184ee9b1de | ||
|
e50c2bb383 | ||
|
3e61b953b7 | ||
|
f74abe4a2c | ||
|
0eb522987f | ||
|
0f7fb5c5e5 | ||
|
b238ce28f8 | ||
|
0a5d2b505c | ||
|
61364ab927 | ||
|
bd33a385ee | ||
|
cd70de1cc0 | ||
|
cc1d13c922 | ||
|
3b0e04305b | ||
|
668621362f | ||
|
322ac05f8b | ||
|
1333d8c8d3 | ||
|
01712e6508 | ||
|
c6a6193d12 | ||
|
3b4ad37ebe | ||
|
d14feb6cb7 | ||
|
45b0be3840 | ||
|
77b738b36f | ||
|
b5808fe960 | ||
|
7285f275ff | ||
|
1549651da6 | ||
|
c37cce7a84 | ||
|
38ed2ff3dd | ||
|
a4960cf1b6 | ||
|
8778ee616a | ||
|
21821933ae | ||
|
7990438f14 | ||
|
f469c70281 | ||
|
a9e3458ba7 | ||
|
75839f977d | ||
|
50f911d25d | ||
|
9108fc17b0 | ||
|
300aae1180 | ||
|
84b223c18c | ||
|
adec2bd598 | ||
|
73974f809c | ||
|
e0ed7a9b15 | ||
|
04ff9d663b | ||
|
bca6fcd78f | ||
|
d74d56fcfa | ||
|
422da35375 | ||
|
b47fe2655d | ||
|
3feea54eae | ||
|
2c061de063 | ||
|
eafd990f26 | ||
|
8b0932c19f | ||
|
6aa31db5eb | ||
|
6d57592740 | ||
|
fb02f5b2cd | ||
|
c602e97446 | ||
|
12a4ef58a8 | ||
|
f891b052c5 | ||
|
47650a5cab | ||
|
61a9fa589a | ||
|
eccb856f01 | ||
|
1e0f973b65 | ||
|
83357313dd | ||
|
b75d1de536 | ||
|
4ef78a39f0 | ||
|
c8b8157e12 | ||
|
9a1f14ad72 | ||
|
a23fdff6fb | ||
|
5cd3d4bc43 | ||
|
18fcb37598 | ||
|
2ed845b3c3 | ||
|
d9c919744b | ||
|
48997fe4d3 | ||
|
430743a1e8 | ||
|
c67617f3c6 | ||
|
a22f4c34df | ||
|
4e2ac8062c | ||
|
c40c6351fa | ||
|
a523556244 | ||
|
302eb57b18 | ||
|
63653ff8c8 | ||
|
710ff7490a | ||
|
f6f66e0c30 | ||
|
94057f7402 | ||
|
a6a835bdb1 | ||
|
e3756ba90a | ||
|
4cca792399 | ||
|
a56af23f06 | ||
|
b112ec225f | ||
|
4465cd124f | ||
|
072b9c2839 | ||
|
27f44ea1fb | ||
|
9d1c9d0379 | ||
|
2d9950a2bf | ||
|
eaea26b781 | ||
|
6eacb857c1 | ||
|
7d3d87e4d7 | ||
|
dd01704111 | ||
|
c7c964b109 | ||
|
c0328cf380 | ||
|
8120390aab | ||
|
8f38b08b50 | ||
|
8ffa47fb3a | ||
|
1f0d809629 | ||
|
859046e000 | ||
|
df851da3ce | ||
|
e18792566c | ||
|
f55477fe2d | ||
|
cf3ad972a2 | ||
|
2649a735b2 | ||
|
972d887264 | ||
|
c9d7262843 | ||
|
396e791059 | ||
|
08a475df10 | ||
|
70911f1f4a | ||
|
4bb34b6df1 | ||
|
cc617b6e14 | ||
|
0ef6fbbd11 | ||
|
d96c7befc0 | ||
|
c751368c37 | ||
|
76b51586f4 | ||
|
0e660ee7a1 | ||
|
088573c973 | ||
|
ad12178c3d | ||
|
80f7c1b464 | ||
|
a292d6c8ef | ||
|
21429c1566 | ||
|
266efa6b29 | ||
|
43f2c9f8eb | ||
|
8ef8175a33 | ||
|
76fc038746 | ||
|
9b2e99e50a | ||
|
a85cdb9f2b | ||
|
44c9a93948 | ||
|
f235838f58 | ||
|
5556529b94 | ||
|
1bbbd6a79d | ||
|
59bbab3a9a | ||
|
082208a849 | ||
|
e2a8eaec0f | ||
|
52b6a7c889 | ||
|
0d141df465 | ||
|
31d60b9ba4 | ||
|
d42046e1da | ||
|
caa6584f36 | ||
|
83e78feb80 | ||
|
0ce7f25fe3 | ||
|
ba5410320b | ||
|
4a1aeca3bd | ||
|
6cfb6da951 | ||
|
d0d38ce20e | ||
|
f9c2c71ed6 | ||
|
0286fe8176 | ||
|
40801ac995 | ||
|
166830d8f7 | ||
|
f273905161 | ||
|
4fa25853cd | ||
|
df73a69faf | ||
|
f68cb23c14 | ||
|
49accdedf9 | ||
|
b948a49615 | ||
|
33a3293651 | ||
|
fd30b00707 | ||
|
88bd066166 | ||
|
e1ed55738e | ||
|
253909974a | ||
|
d786a17232 | ||
|
999463c865 | ||
|
a5abd9cc2c | ||
|
123b720eeb | ||
|
a457823f27 | ||
|
caa917491a | ||
|
ec8c74e8bc | ||
|
796b380ca7 | ||
|
665afccc52 | ||
|
95bb203861 | ||
|
c7a0aca0ed | ||
|
01b6090b75 | ||
|
c5d6a57da0 | ||
|
69ebe82806 | ||
|
78fb6b0e02 | ||
|
bfb141cf19 | ||
|
2fe25a74d6 | ||
|
d3add11e87 | ||
|
d39d1260c6 | ||
|
97eedf5dfb | ||
|
7e55cf6b48 | ||
|
a80032dc44 | ||
|
fc8b8deac2 | ||
|
3bfbc91507 | ||
|
91f6c533f8 | ||
|
0c3e8e9947 | ||
|
cb277815d5 | ||
|
e6edbe315f | ||
|
13c5e34a1b | ||
|
804666c86e | ||
|
49054b6bb6 | ||
|
62a75650e4 | ||
|
9caaa79dd7 | ||
|
490a62beb7 | ||
|
e8b9296c67 | ||
|
0f9395d7c5 | ||
|
94d4efb54e | ||
|
2926498f01 | ||
|
965dbf97ab | ||
|
d5cf0fba20 | ||
|
c9416efeef | ||
|
6cc63aee53 | ||
|
c8ff8e05af | ||
|
9c33f16f8c | ||
|
0a58c9a391 | ||
|
0844a16a07 | ||
|
46f6752834 | ||
|
4f47eaf945 | ||
|
4d613feee5 | ||
|
b49a6c8f80 | ||
|
fe6142f04c |
@@ -22,10 +22,10 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
TARGET_MDE_CPU:
|
TARGET_MDE_CPU:
|
||||||
Build.Pkgs: 'MdePkg,UefiCpuPkg'
|
Build.Pkgs: 'MdePkg,UefiCpuPkg'
|
||||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
||||||
TARGET_MDEMODULE_DEBUG:
|
TARGET_MDEMODULE_DEBUG:
|
||||||
Build.Pkgs: 'MdeModulePkg'
|
Build.Pkgs: 'MdeModulePkg'
|
||||||
Build.Targets: 'DEBUG'
|
Build.Targets: 'DEBUG,NOOPT'
|
||||||
TARGET_MDEMODULE_RELEASE:
|
TARGET_MDEMODULE_RELEASE:
|
||||||
Build.Pkgs: 'MdeModulePkg'
|
Build.Pkgs: 'MdeModulePkg'
|
||||||
Build.Targets: 'RELEASE,NO-TARGET'
|
Build.Targets: 'RELEASE,NO-TARGET'
|
||||||
@@ -35,9 +35,9 @@ jobs:
|
|||||||
TARGET_OTHER:
|
TARGET_OTHER:
|
||||||
Build.Pkgs: 'PcAtChipsetPkg,ShellPkg'
|
Build.Pkgs: 'PcAtChipsetPkg,ShellPkg'
|
||||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
|
||||||
TARGET_FMP:
|
TARGET_FMP_FAT_TEST:
|
||||||
Build.Pkgs: 'FmpDevicePkg,FatPkg'
|
Build.Pkgs: 'FmpDevicePkg,FatPkg,UnitTestFrameworkPkg'
|
||||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
||||||
TARGET_CRYPTO:
|
TARGET_CRYPTO:
|
||||||
Build.Pkgs: 'CryptoPkg'
|
Build.Pkgs: 'CryptoPkg'
|
||||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -4,3 +4,6 @@
|
|||||||
[submodule "SoftFloat"]
|
[submodule "SoftFloat"]
|
||||||
path = ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3
|
path = ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3
|
||||||
url = https://github.com/ucb-bar/berkeley-softfloat-3.git
|
url = https://github.com/ucb-bar/berkeley-softfloat-3.git
|
||||||
|
[submodule "UnitTestFrameworkPkg/Library/CmockaLib/cmocka"]
|
||||||
|
path = UnitTestFrameworkPkg/Library/CmockaLib/cmocka
|
||||||
|
url = https://git.cryptomilk.org/projects/cmocka.git
|
||||||
|
72
.mailmap
Normal file
72
.mailmap
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
#
|
||||||
|
# This list is used by git-shortlog to fix a few botched name translations
|
||||||
|
# in the git archive, either because the author's full name was messed up
|
||||||
|
# and/or not always written the same way, making contributions from the
|
||||||
|
# same person appearing not to be so or badly displayed.
|
||||||
|
#
|
||||||
|
# Please keep this file sorted alphabetically, and email in lowercase.
|
||||||
|
# The format used is:
|
||||||
|
#
|
||||||
|
# Firstname Lastname <email@domain.tld>
|
||||||
|
#
|
||||||
|
|
||||||
|
Aaron Li <aaron.li@intel.com> <songpeng.li@intel.com>
|
||||||
|
Antoine Cœur <coeur@gmx.fr>
|
||||||
|
Antoine Cœur <coeur@gmx.fr> <Coeur@gmx.fr>
|
||||||
|
Ard Biesheuvel <ard.biesheuvel@linaro.org> <abiesheuvel@Edk2>
|
||||||
|
Ashley DeSimone <ashley.e.desimone@intel.com> <ashdesimone@6f19259b-4bc3-4df7-8a09-765794883524>
|
||||||
|
Baraneedharan Anbazhagan <anbazhagan@hp.com>
|
||||||
|
Chasel Chiu <chasel.chiu@intel.com>
|
||||||
|
Christopher J Zurcher <christopher.j.zurcher@intel.com>
|
||||||
|
Eric Dong <eric.dong@intel.com>
|
||||||
|
Eric Dong <eric.dong@intel.com> Eric Dong <eirc.dong@intel.com>
|
||||||
|
Eric Dong <eric.dong@intel.com> <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
|
||||||
|
Eric Dong <eric.dong@intel.com> <ydong10@Edk2>
|
||||||
|
Erik Bjorge <erik.c.bjorge@intel.com> <geekboy15a@6f19259b-4bc3-4df7-8a09-765794883524>
|
||||||
|
Hao A Wu <hao.a.wu@intel.com>
|
||||||
|
Hao A Wu <hao.a.wu@intel.com> <hwu1225@Edk2>
|
||||||
|
Hot Tian <hot.tian@intel.com>
|
||||||
|
Hot Tian <hot.tian@intel.com> <hhtian@6f19259b-4bc3-4df7-8a09-765794883524>
|
||||||
|
Jiewen Yao <jiewen.yao@intel.com>
|
||||||
|
Jiewen Yao <jiewen.yao@intel.com> <Jiewen.yao@intel.com>
|
||||||
|
Jiewen Yao <jiewen.yao@intel.com> <Jiewen.Yao@intel.com>
|
||||||
|
Jiewen Yao <jiewen.yao@intel.com> <jyao1>
|
||||||
|
Jiewen Yao <jiewen.yao@intel.com> <jyao1@6f19259b-4bc3-4df7-8a09-765794883524>
|
||||||
|
Jiewen Yao <jiewen.yao@intel.com> <jyao1@Edk2>
|
||||||
|
Jim Dailey <Jim.Dailey@Dell.com>
|
||||||
|
Jim Dailey <Jim.Dailey@Dell.com> <Jim_Dailey@Dell.com>
|
||||||
|
Laszlo Ersek <lersek@redhat.com> <lersek@6f19259b-4bc3-4df7-8a09-765794883524>
|
||||||
|
Laszlo Ersek <lersek@redhat.com> <lersek@Edk2>
|
||||||
|
Liming Gao <liming.gao@intel.com> <Gao, Liming liming.gao@intel.com>
|
||||||
|
Liming Gao <liming.gao@intel.com> <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
|
||||||
|
Liming Gao <liming.gao@intel.com> <lgao4@Edk2>
|
||||||
|
Liming Gao <liming.gao@intel.com> <liming.gao@intel.com>
|
||||||
|
Maciej Rabeda <maciej.rabeda@intel.com>
|
||||||
|
Marc-André Lureau <marcandre.lureau@redhat.com> <marcandre.lureau@redhat.com>
|
||||||
|
Marvin Häuser <Marvin.Haeuser@outlook.com>
|
||||||
|
Marvin Häuser <Marvin.Haeuser@outlook.com> edk2-devel <edk2-devel-bounces@lists.01.org>
|
||||||
|
Marvin Häuser <mhaeuser@outlook.de>
|
||||||
|
Maurice Ma <maurice.ma@intel.com>
|
||||||
|
Michael Kubacki <michael.a.kubacki@intel.com>
|
||||||
|
Michael Kubacki <michael.a.kubacki@intel.com> </o=Intel/ou=External (FYDIBOHF25SPDLT)/cn=Recipients/cn=3c8b0226e75f4ab08d20c151cb7a8a72>
|
||||||
|
Ming Tan <ming.tan@intel.com>
|
||||||
|
Nikolai Saoukh <nms@otdel-1.org>
|
||||||
|
Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||||
|
Ray Ni <ray.ni@intel.com>
|
||||||
|
Ray Ni <ray.ni@intel.com> <C:/Program Files (x86)/Git/O=Intel/OU=Pacifica02/cn=Recipients/cn=rni2>
|
||||||
|
Ray Ni <ray.ni@intel.com> <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
|
||||||
|
Ray Ni <ray.ni@intel.com> <niruiyu@Edk2>
|
||||||
|
Ray Ni <ray.ni@intel.com> <ruiyu.ni@intel.com>
|
||||||
|
Ray Ni <ray.ni@intel.com> <Ruiyu.ni@Intel.com>
|
||||||
|
Ray Ni <ray.ni@intel.com> <ruyu.ni@intel.com>
|
||||||
|
Samer El-Haj-Mahmoud <samer@elhajmahmoud.com> <elhaj@hpe.com>
|
||||||
|
Samer El-Haj-Mahmoud <samer@elhajmahmoud.com> <Samer El-Haj-Mahmoud elhaj@hp.com>
|
||||||
|
Shenglei Zhang <shenglei.zhang@intel.com>
|
||||||
|
Star Zeng <star.zeng@intel.com>
|
||||||
|
Star Zeng <star.zeng@intel.com> <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
|
||||||
|
Star Zeng <star.zeng@intel.com> <lzeng14@Edk2>
|
||||||
|
Vitaly Cheptsov <vit9696@protonmail.com> Vitaly Cheptsov via Groups.Io <vit9696=protonmail.com@groups.io>
|
||||||
|
Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Vladimir Olovyannikov via edk2-devel <edk2-devel@lists.01.org>
|
||||||
|
Yonghong Zhu <yonghong.zhu@intel.com>
|
||||||
|
Yonghong Zhu <yonghong.zhu@intel.com> <yzhu52@Edk2>
|
||||||
|
Yu-Chen Lin <yuchenlin@synology.com>
|
@@ -48,7 +48,8 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
|||||||
"FmpDevicePkg",
|
"FmpDevicePkg",
|
||||||
"ShellPkg",
|
"ShellPkg",
|
||||||
"FatPkg",
|
"FatPkg",
|
||||||
"CryptoPkg"
|
"CryptoPkg",
|
||||||
|
"UnitTestFrameworkPkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
def GetArchitecturesSupported(self):
|
def GetArchitecturesSupported(self):
|
||||||
@@ -117,10 +118,13 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
|||||||
|
|
||||||
def GetActiveScopes(self):
|
def GetActiveScopes(self):
|
||||||
''' return tuple containing scopes that should be active for this process '''
|
''' return tuple containing scopes that should be active for this process '''
|
||||||
scopes = ("cibuild","edk2-build")
|
scopes = ("cibuild", "edk2-build", "host-based-test")
|
||||||
|
|
||||||
self.ActualToolChainTag = shell_environment.GetBuildVars().GetValue("TOOL_CHAIN_TAG", "")
|
self.ActualToolChainTag = shell_environment.GetBuildVars().GetValue("TOOL_CHAIN_TAG", "")
|
||||||
|
|
||||||
|
if GetHostInfo().os.upper() == "WINDOWS":
|
||||||
|
scopes += ('host-test-win',)
|
||||||
|
|
||||||
if GetHostInfo().os.upper() == "LINUX" and self.ActualToolChainTag.upper().startswith("GCC"):
|
if GetHostInfo().os.upper() == "LINUX" and self.ActualToolChainTag.upper().startswith("GCC"):
|
||||||
if "AARCH64" in self.ActualArchitectures:
|
if "AARCH64" in self.ActualArchitectures:
|
||||||
scopes += ("gcc_aarch64_linux",)
|
scopes += ("gcc_aarch64_linux",)
|
||||||
@@ -138,13 +142,16 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
|||||||
"ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3", False))
|
"ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3", False))
|
||||||
rs.append(RequiredSubmodule(
|
rs.append(RequiredSubmodule(
|
||||||
"CryptoPkg/Library/OpensslLib/openssl", False))
|
"CryptoPkg/Library/OpensslLib/openssl", False))
|
||||||
|
rs.append(RequiredSubmodule(
|
||||||
|
"UnitTestFrameworkPkg/Library/CmockaLib/cmocka", False))
|
||||||
return rs
|
return rs
|
||||||
|
|
||||||
def GetName(self):
|
def GetName(self):
|
||||||
return "Edk2"
|
return "Edk2"
|
||||||
|
|
||||||
def GetDependencies(self):
|
def GetDependencies(self):
|
||||||
return []
|
return [
|
||||||
|
]
|
||||||
|
|
||||||
def GetPackagesPath(self):
|
def GetPackagesPath(self):
|
||||||
return ()
|
return ()
|
||||||
@@ -158,7 +165,8 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
|||||||
build_these_packages = []
|
build_these_packages = []
|
||||||
possible_packages = potentialPackagesList.copy()
|
possible_packages = potentialPackagesList.copy()
|
||||||
for f in changedFilesList:
|
for f in changedFilesList:
|
||||||
nodes=f.split("/") # split each part of path for comparison later
|
# split each part of path for comparison later
|
||||||
|
nodes = f.split("/")
|
||||||
|
|
||||||
# python file change in .pytool folder causes building all
|
# python file change in .pytool folder causes building all
|
||||||
if f.endswith(".py") and ".pytool" in nodes:
|
if f.endswith(".py") and ".pytool" in nodes:
|
||||||
|
@@ -100,7 +100,7 @@ class CharEncodingCheck(ICiBuildPlugin):
|
|||||||
overall_status += 1
|
overall_status += 1
|
||||||
|
|
||||||
tc.LogStdOut("Tested Encoding on {0} files".format(files_tested))
|
tc.LogStdOut("Tested Encoding on {0} files".format(files_tested))
|
||||||
if overall_status is not 0:
|
if overall_status != 0:
|
||||||
tc.SetFailed("CharEncoding {0} Failed. Errors {1}".format(packagename, overall_status), "CHAR_ENCODING_CHECK_FAILED")
|
tc.SetFailed("CharEncoding {0} Failed. Errors {1}".format(packagename, overall_status), "CHAR_ENCODING_CHECK_FAILED")
|
||||||
else:
|
else:
|
||||||
tc.SetSuccess()
|
tc.SetSuccess()
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# @file HostUnitTestCompiler_plugin.py
|
# @file CompilerPlugin.py
|
||||||
##
|
##
|
||||||
# Copyright (c) Microsoft Corporation.
|
# Copyright (c) Microsoft Corporation.
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
@@ -42,7 +42,7 @@ class CompilerPlugin(ICiBuildPlugin):
|
|||||||
return ["DEBUG", "RELEASE"]
|
return ["DEBUG", "RELEASE"]
|
||||||
|
|
||||||
##
|
##
|
||||||
# External function of plugin. This function is used to perform the task of the MuBuild Plugin
|
# External function of plugin. This function is used to perform the task of the ICiBuildPlugin Plugin
|
||||||
#
|
#
|
||||||
# - package is the edk2 path to package. This means workspace/packagepath relative.
|
# - package is the edk2 path to package. This means workspace/packagepath relative.
|
||||||
# - edk2path object configured with workspace and packages path
|
# - edk2path object configured with workspace and packages path
|
||||||
|
@@ -113,7 +113,7 @@ class DependencyCheck(ICiBuildPlugin):
|
|||||||
overall_status += 1
|
overall_status += 1
|
||||||
|
|
||||||
# If XML object exists, add results
|
# If XML object exists, add results
|
||||||
if overall_status is not 0:
|
if overall_status != 0:
|
||||||
tc.SetFailed("Failed with {0} errors".format(overall_status), "DEPENDENCYCHECK_FAILED")
|
tc.SetFailed("Failed with {0} errors".format(overall_status), "DEPENDENCYCHECK_FAILED")
|
||||||
else:
|
else:
|
||||||
tc.SetSuccess()
|
tc.SetSuccess()
|
||||||
|
@@ -54,21 +54,25 @@ class DscCompleteCheck(ICiBuildPlugin):
|
|||||||
# Parse the config for required DscPath element
|
# Parse the config for required DscPath element
|
||||||
if "DscPath" not in pkgconfig:
|
if "DscPath" not in pkgconfig:
|
||||||
tc.SetSkipped()
|
tc.SetSkipped()
|
||||||
tc.LogStdError("DscPath not found in config file. Nothing to check.")
|
tc.LogStdError(
|
||||||
|
"DscPath not found in config file. Nothing to check.")
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
abs_pkg_path = Edk2pathObj.GetAbsolutePathOnThisSytemFromEdk2RelativePath(packagename)
|
abs_pkg_path = Edk2pathObj.GetAbsolutePathOnThisSytemFromEdk2RelativePath(
|
||||||
|
packagename)
|
||||||
abs_dsc_path = os.path.join(abs_pkg_path, pkgconfig["DscPath"].strip())
|
abs_dsc_path = os.path.join(abs_pkg_path, pkgconfig["DscPath"].strip())
|
||||||
wsr_dsc_path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(abs_dsc_path)
|
wsr_dsc_path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(
|
||||||
|
abs_dsc_path)
|
||||||
|
|
||||||
if abs_dsc_path is None or wsr_dsc_path is "" or not os.path.isfile(abs_dsc_path):
|
if abs_dsc_path is None or wsr_dsc_path == "" or not os.path.isfile(abs_dsc_path):
|
||||||
tc.SetSkipped()
|
tc.SetSkipped()
|
||||||
tc.LogStdError("Package Dsc not found")
|
tc.LogStdError("Package Dsc not found")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
# Get INF Files
|
# Get INF Files
|
||||||
INFFiles = self.WalkDirectoryForExtension([".inf"], abs_pkg_path)
|
INFFiles = self.WalkDirectoryForExtension([".inf"], abs_pkg_path)
|
||||||
INFFiles = [Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(x) for x in INFFiles] # make edk2relative path so can compare with DSC
|
INFFiles = [Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(
|
||||||
|
x) for x in INFFiles] # make edk2relative path so can compare with DSC
|
||||||
|
|
||||||
# remove ignores
|
# remove ignores
|
||||||
|
|
||||||
@@ -79,8 +83,10 @@ class DscCompleteCheck(ICiBuildPlugin):
|
|||||||
tc.LogStdOut("Ignoring INF {0}".format(a))
|
tc.LogStdOut("Ignoring INF {0}".format(a))
|
||||||
INFFiles.remove(a)
|
INFFiles.remove(a)
|
||||||
except:
|
except:
|
||||||
tc.LogStdError("DscCompleteCheck.IgnoreInf -> {0} not found in filesystem. Invalid ignore file".format(a))
|
tc.LogStdError(
|
||||||
logging.info("DscCompleteCheck.IgnoreInf -> {0} not found in filesystem. Invalid ignore file".format(a))
|
"DscCompleteCheck.IgnoreInf -> {0} not found in filesystem. Invalid ignore file".format(a))
|
||||||
|
logging.info(
|
||||||
|
"DscCompleteCheck.IgnoreInf -> {0} not found in filesystem. Invalid ignore file".format(a))
|
||||||
|
|
||||||
# DSC Parser
|
# DSC Parser
|
||||||
dp = DscParser()
|
dp = DscParser()
|
||||||
@@ -99,11 +105,19 @@ class DscCompleteCheck(ICiBuildPlugin):
|
|||||||
infp.SetPackagePaths(Edk2pathObj.PackagePathList)
|
infp.SetPackagePaths(Edk2pathObj.PackagePathList)
|
||||||
infp.ParseFile(INF)
|
infp.ParseFile(INF)
|
||||||
if("MODULE_TYPE" not in infp.Dict):
|
if("MODULE_TYPE" not in infp.Dict):
|
||||||
tc.LogStdOut("Ignoring INF. Missing key for MODULE_TYPE {0}".format(INF))
|
tc.LogStdOut(
|
||||||
|
"Ignoring INF. Missing key for MODULE_TYPE {0}".format(INF))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if(infp.Dict["MODULE_TYPE"] == "HOST_APPLICATION"):
|
if(infp.Dict["MODULE_TYPE"] == "HOST_APPLICATION"):
|
||||||
tc.LogStdOut("Ignoring INF. Module type is HOST_APPLICATION {0}".format(INF))
|
tc.LogStdOut(
|
||||||
|
"Ignoring INF. Module type is HOST_APPLICATION {0}".format(INF))
|
||||||
|
continue
|
||||||
|
|
||||||
|
if len(infp.SupportedPhases) == 1 and \
|
||||||
|
"HOST_APPLICATION" in infp.SupportedPhases:
|
||||||
|
tc.LogStdOut(
|
||||||
|
"Ignoring Library INF due to only supporting type HOST_APPLICATION {0}".format(INF))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logging.critical(INF + " not in " + wsr_dsc_path)
|
logging.critical(INF + " not in " + wsr_dsc_path)
|
||||||
@@ -111,8 +125,9 @@ class DscCompleteCheck(ICiBuildPlugin):
|
|||||||
overall_status = overall_status + 1
|
overall_status = overall_status + 1
|
||||||
|
|
||||||
# If XML object exists, add result
|
# If XML object exists, add result
|
||||||
if overall_status is not 0:
|
if overall_status != 0:
|
||||||
tc.SetFailed("DscCompleteCheck {0} Failed. Errors {1}".format(wsr_dsc_path, overall_status), "CHECK_FAILED")
|
tc.SetFailed("DscCompleteCheck {0} Failed. Errors {1}".format(
|
||||||
|
wsr_dsc_path, overall_status), "CHECK_FAILED")
|
||||||
else:
|
else:
|
||||||
tc.SetSuccess()
|
tc.SetSuccess()
|
||||||
return overall_status
|
return overall_status
|
||||||
|
@@ -7,6 +7,11 @@ that it would not be built if the package were built). This is critical because
|
|||||||
much of the CI infrastructure assumes that all modules will be listed in the DSC
|
much of the CI infrastructure assumes that all modules will be listed in the DSC
|
||||||
and compiled.
|
and compiled.
|
||||||
|
|
||||||
|
This test will ignore INFs in the following cases:
|
||||||
|
|
||||||
|
1. When MODULE_TYPE = HOST_APPLICATION
|
||||||
|
2. When a Library instance **only** supports the HOST_APPLICATION environment
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
The plugin has a few configuration options to support the UEFI codebase.
|
The plugin has a few configuration options to support the UEFI codebase.
|
||||||
@@ -14,7 +19,7 @@ The plugin has a few configuration options to support the UEFI codebase.
|
|||||||
``` yaml
|
``` yaml
|
||||||
"DscCompleteCheck": {
|
"DscCompleteCheck": {
|
||||||
"DscPath": "", # Path to dsc from root of package
|
"DscPath": "", # Path to dsc from root of package
|
||||||
"IgnoreInf": [] # Ignore INF if found in filesystem by not dsc
|
"IgnoreInf": [] # Ignore INF if found in filesystem but not dsc
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@@ -221,7 +221,7 @@ class GuidCheck(ICiBuildPlugin):
|
|||||||
|
|
||||||
# add result to test case
|
# add result to test case
|
||||||
overall_status = len(Errors)
|
overall_status = len(Errors)
|
||||||
if overall_status is not 0:
|
if overall_status != 0:
|
||||||
tc.SetFailed("GuidCheck {0} Failed. Errors {1}".format(
|
tc.SetFailed("GuidCheck {0} Failed. Errors {1}".format(
|
||||||
packagename, overall_status), "CHECK_FAILED")
|
packagename, overall_status), "CHECK_FAILED")
|
||||||
else:
|
else:
|
||||||
|
@@ -0,0 +1,149 @@
|
|||||||
|
# @file HostUnitTestCompilerPlugin.py
|
||||||
|
##
|
||||||
|
# Copyright (c) Microsoft Corporation.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
##
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
from edk2toollib.uefi.edk2.parsers.dsc_parser import DscParser
|
||||||
|
from edk2toolext.environment.plugintypes.ci_build_plugin import ICiBuildPlugin
|
||||||
|
from edk2toolext.environment.uefi_build import UefiBuilder
|
||||||
|
from edk2toolext import edk2_logging
|
||||||
|
from edk2toolext.environment.var_dict import VarDict
|
||||||
|
from edk2toollib.utility_functions import GetHostInfo
|
||||||
|
|
||||||
|
|
||||||
|
class HostUnitTestCompilerPlugin(ICiBuildPlugin):
|
||||||
|
"""
|
||||||
|
A CiBuildPlugin that compiles the dsc for host based unit test apps.
|
||||||
|
An IUefiBuildPlugin may be attached to this plugin that will run the
|
||||||
|
unit tests and collect the results after successful compilation.
|
||||||
|
|
||||||
|
Configuration options:
|
||||||
|
"HostUnitTestCompilerPlugin": {
|
||||||
|
"DscPath": "<path to dsc from root of pkg>"
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
|
def GetTestName(self, packagename: str, environment: VarDict) -> tuple:
|
||||||
|
""" Provide the testcase name and classname for use in reporting
|
||||||
|
testclassname: a descriptive string for the testcase can include whitespace
|
||||||
|
classname: should be patterned <packagename>.<plugin>.<optionally any unique condition>
|
||||||
|
|
||||||
|
Args:
|
||||||
|
packagename: string containing name of package to build
|
||||||
|
environment: The VarDict for the test to run in
|
||||||
|
Returns:
|
||||||
|
a tuple containing the testcase name and the classname
|
||||||
|
(testcasename, classname)
|
||||||
|
"""
|
||||||
|
num,types = self.__GetHostUnitTestArch(environment)
|
||||||
|
types = types.replace(" ", "_")
|
||||||
|
|
||||||
|
return ("Compile and Run Host-Based UnitTests for " + packagename + " on arch " + types,
|
||||||
|
packagename + ".HostUnitTestCompiler." + types)
|
||||||
|
|
||||||
|
def RunsOnTargetList(self):
|
||||||
|
return ["NOOPT"]
|
||||||
|
|
||||||
|
#
|
||||||
|
# Find the intersection of application types that can run on this host
|
||||||
|
# and the TARGET_ARCH being build in this request.
|
||||||
|
#
|
||||||
|
# return tuple with (number of UEFI arch types, space separated string)
|
||||||
|
def __GetHostUnitTestArch(self, environment):
|
||||||
|
requested = environment.GetValue("TARGET_ARCH").split(' ')
|
||||||
|
host = []
|
||||||
|
if GetHostInfo().arch == 'x86':
|
||||||
|
#assume 64bit can handle 64 and 32
|
||||||
|
#assume 32bit can only handle 32
|
||||||
|
## change once IA32 issues resolved host.append("IA32")
|
||||||
|
if GetHostInfo().bit == '64':
|
||||||
|
host.append("X64")
|
||||||
|
elif GetHostInfo().arch == 'ARM':
|
||||||
|
if GetHostInfo().bit == '64':
|
||||||
|
host.append("AARCH64")
|
||||||
|
elif GetHostInfo().bit == '32':
|
||||||
|
host.append("ARM")
|
||||||
|
|
||||||
|
willrun = set(requested) & set(host)
|
||||||
|
return (len(willrun), " ".join(willrun))
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
# External function of plugin. This function is used to perform the task of the ICiBuildPlugin Plugin
|
||||||
|
#
|
||||||
|
# - package is the edk2 path to package. This means workspace/packagepath relative.
|
||||||
|
# - edk2path object configured with workspace and packages path
|
||||||
|
# - PkgConfig Object (dict) for the pkg
|
||||||
|
# - EnvConfig Object
|
||||||
|
# - Plugin Manager Instance
|
||||||
|
# - Plugin Helper Obj Instance
|
||||||
|
# - Junit Logger
|
||||||
|
# - output_stream the StringIO output stream from this plugin via logging
|
||||||
|
def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, PLM, PLMHelper, tc, output_stream=None):
|
||||||
|
self._env = environment
|
||||||
|
environment.SetValue("CI_BUILD_TYPE", "host_unit_test", "Set in HostUnitTestCompilerPlugin")
|
||||||
|
|
||||||
|
# Parse the config for required DscPath element
|
||||||
|
if "DscPath" not in pkgconfig:
|
||||||
|
tc.SetSkipped()
|
||||||
|
tc.LogStdError("DscPath not found in config file. Nothing to compile for HostBasedUnitTests.")
|
||||||
|
return -1
|
||||||
|
|
||||||
|
AP = Edk2pathObj.GetAbsolutePathOnThisSytemFromEdk2RelativePath(packagename)
|
||||||
|
|
||||||
|
APDSC = os.path.join(AP, pkgconfig["DscPath"].strip())
|
||||||
|
AP_Path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(APDSC)
|
||||||
|
if AP is None or AP_Path is None or not os.path.isfile(APDSC):
|
||||||
|
tc.SetSkipped()
|
||||||
|
tc.LogStdError("Package HostBasedUnitTest Dsc not found.")
|
||||||
|
return -1
|
||||||
|
|
||||||
|
logging.info("Building {0}".format(AP_Path))
|
||||||
|
self._env.SetValue("ACTIVE_PLATFORM", AP_Path, "Set in Compiler Plugin")
|
||||||
|
num, RUNNABLE_ARCHITECTURES = self.__GetHostUnitTestArch(environment)
|
||||||
|
if(num == 0):
|
||||||
|
tc.SetSkipped()
|
||||||
|
tc.LogStdError("No host architecture compatibility")
|
||||||
|
return -1
|
||||||
|
|
||||||
|
if not environment.SetValue("TARGET_ARCH",
|
||||||
|
RUNNABLE_ARCHITECTURES,
|
||||||
|
"Update Target Arch based on Host Support"):
|
||||||
|
#use AllowOverride function since this is a controlled attempt to change
|
||||||
|
environment.AllowOverride("TARGET_ARCH")
|
||||||
|
if not environment.SetValue("TARGET_ARCH",
|
||||||
|
RUNNABLE_ARCHITECTURES,
|
||||||
|
"Update Target Arch based on Host Support"):
|
||||||
|
raise RuntimeError("Can't Change TARGET_ARCH as required")
|
||||||
|
|
||||||
|
# Parse DSC to check for SUPPORTED_ARCHITECTURES
|
||||||
|
dp = DscParser()
|
||||||
|
dp.SetBaseAbsPath(Edk2pathObj.WorkspacePath)
|
||||||
|
dp.SetPackagePaths(Edk2pathObj.PackagePathList)
|
||||||
|
dp.ParseFile(AP_Path)
|
||||||
|
if "SUPPORTED_ARCHITECTURES" in dp.LocalVars:
|
||||||
|
SUPPORTED_ARCHITECTURES = dp.LocalVars["SUPPORTED_ARCHITECTURES"].split('|')
|
||||||
|
TARGET_ARCHITECTURES = environment.GetValue("TARGET_ARCH").split(' ')
|
||||||
|
|
||||||
|
# Skip if there is no intersection between SUPPORTED_ARCHITECTURES and TARGET_ARCHITECTURES
|
||||||
|
if len(set(SUPPORTED_ARCHITECTURES) & set(TARGET_ARCHITECTURES)) == 0:
|
||||||
|
tc.SetSkipped()
|
||||||
|
tc.LogStdError("No supported architecutres to build for host unit tests")
|
||||||
|
return -1
|
||||||
|
|
||||||
|
uefiBuilder = UefiBuilder()
|
||||||
|
# do all the steps
|
||||||
|
# WorkSpace, PackagesPath, PInHelper, PInManager
|
||||||
|
ret = uefiBuilder.Go(Edk2pathObj.WorkspacePath, os.pathsep.join(Edk2pathObj.PackagePathList), PLMHelper, PLM)
|
||||||
|
if ret != 0: # failure:
|
||||||
|
tc.SetFailed("Compile failed for {0}".format(packagename), "Compile_FAILED")
|
||||||
|
tc.LogStdError("{0} Compile failed with error code {1} ".format(AP_Path, ret))
|
||||||
|
return 1
|
||||||
|
|
||||||
|
else:
|
||||||
|
tc.SetSuccess()
|
||||||
|
return 0
|
@@ -0,0 +1,12 @@
|
|||||||
|
##
|
||||||
|
# CiBuildPlugin used to build anything that identifies
|
||||||
|
# as a unit test.
|
||||||
|
#
|
||||||
|
# Copyright (c) Microsoft Corporation.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
##
|
||||||
|
{
|
||||||
|
"scope": "host-based-test",
|
||||||
|
"name": "Host Unit Test Compiler Plugin",
|
||||||
|
"module": "HostUnitTestCompilerPlugin"
|
||||||
|
}
|
24
.pytool/Plugin/HostUnitTestCompilerPlugin/Readme.md
Normal file
24
.pytool/Plugin/HostUnitTestCompilerPlugin/Readme.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Host UnitTest Compiler Plugin
|
||||||
|
|
||||||
|
A CiBuildPlugin that compiles the dsc for host based unit test apps.
|
||||||
|
An IUefiBuildPlugin may be attached to this plugin that will run the unit tests and collect the results after successful compilation.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The package relative path of the DSC file to build.
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
"HostUnitTestCompilerPlugin": {
|
||||||
|
"DscPath": "<path to dsc from root of pkg>"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### DscPath
|
||||||
|
|
||||||
|
Package relative path to the DSC file to build.
|
||||||
|
|
||||||
|
## Copyright
|
||||||
|
|
||||||
|
Copyright (c) Microsoft Corporation.
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
@@ -0,0 +1,140 @@
|
|||||||
|
# @file HostUnitTestDscCompleteCheck.py
|
||||||
|
#
|
||||||
|
# This is a copy of DscCompleteCheck with different filtering logic.
|
||||||
|
# It should be discussed if this should be one plugin
|
||||||
|
#
|
||||||
|
# Copyright (c) Microsoft Corporation.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
##
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
from edk2toolext.environment.plugintypes.ci_build_plugin import ICiBuildPlugin
|
||||||
|
from edk2toollib.uefi.edk2.parsers.dsc_parser import DscParser
|
||||||
|
from edk2toollib.uefi.edk2.parsers.inf_parser import InfParser
|
||||||
|
from edk2toolext.environment.var_dict import VarDict
|
||||||
|
|
||||||
|
|
||||||
|
class HostUnitTestDscCompleteCheck(ICiBuildPlugin):
|
||||||
|
"""
|
||||||
|
A CiBuildPlugin that scans the package Host Unit Test dsc file and confirms all Host application modules (inf files) are
|
||||||
|
listed in the components sections.
|
||||||
|
|
||||||
|
Configuration options:
|
||||||
|
"HostUnitTestDscCompleteCheck": {
|
||||||
|
"DscPath": "", # Path to Host based unit test DSC file
|
||||||
|
"IgnoreInf": [] # Ignore INF if found in filesystem but not dsc
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
|
def GetTestName(self, packagename: str, environment: VarDict) -> tuple:
|
||||||
|
""" Provide the testcase name and classname for use in reporting
|
||||||
|
|
||||||
|
Args:
|
||||||
|
packagename: string containing name of package to build
|
||||||
|
environment: The VarDict for the test to run in
|
||||||
|
Returns:
|
||||||
|
a tuple containing the testcase name and the classname
|
||||||
|
(testcasename, classname)
|
||||||
|
testclassname: a descriptive string for the testcase can include whitespace
|
||||||
|
classname: should be patterned <packagename>.<plugin>.<optionally any unique condition>
|
||||||
|
"""
|
||||||
|
return ("Check the " + packagename + " Host Unit Test DSC for a being complete", packagename + ".HostUnitTestDscCompleteCheck")
|
||||||
|
|
||||||
|
##
|
||||||
|
# External function of plugin. This function is used to perform the task of the MuBuild Plugin
|
||||||
|
#
|
||||||
|
# - package is the edk2 path to package. This means workspace/packagepath relative.
|
||||||
|
# - edk2path object configured with workspace and packages path
|
||||||
|
# - PkgConfig Object (dict) for the pkg
|
||||||
|
# - VarDict containing the shell environment Build Vars
|
||||||
|
# - Plugin Manager Instance
|
||||||
|
# - Plugin Helper Obj Instance
|
||||||
|
# - Junit Logger
|
||||||
|
# - output_stream the StringIO output stream from this plugin via logging
|
||||||
|
def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, PLM, PLMHelper, tc, output_stream=None):
|
||||||
|
overall_status = 0
|
||||||
|
|
||||||
|
# Parse the config for required DscPath element
|
||||||
|
if "DscPath" not in pkgconfig:
|
||||||
|
tc.SetSkipped()
|
||||||
|
tc.LogStdError(
|
||||||
|
"DscPath not found in config file. Nothing to check.")
|
||||||
|
return -1
|
||||||
|
|
||||||
|
abs_pkg_path = Edk2pathObj.GetAbsolutePathOnThisSytemFromEdk2RelativePath(
|
||||||
|
packagename)
|
||||||
|
abs_dsc_path = os.path.join(abs_pkg_path, pkgconfig["DscPath"].strip())
|
||||||
|
wsr_dsc_path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(
|
||||||
|
abs_dsc_path)
|
||||||
|
|
||||||
|
if abs_dsc_path is None or wsr_dsc_path == "" or not os.path.isfile(abs_dsc_path):
|
||||||
|
tc.SetSkipped()
|
||||||
|
tc.LogStdError("Package Host Unit Test Dsc not found")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
# Get INF Files
|
||||||
|
INFFiles = self.WalkDirectoryForExtension([".inf"], abs_pkg_path)
|
||||||
|
INFFiles = [Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(
|
||||||
|
x) for x in INFFiles] # make edk2relative path so can compare with DSC
|
||||||
|
|
||||||
|
# remove ignores
|
||||||
|
|
||||||
|
if "IgnoreInf" in pkgconfig:
|
||||||
|
for a in pkgconfig["IgnoreInf"]:
|
||||||
|
a = a.replace(os.sep, "/")
|
||||||
|
try:
|
||||||
|
tc.LogStdOut("Ignoring INF {0}".format(a))
|
||||||
|
INFFiles.remove(a)
|
||||||
|
except:
|
||||||
|
tc.LogStdError(
|
||||||
|
"HostUnitTestDscCompleteCheck.IgnoreInf -> {0} not found in filesystem. Invalid ignore file".format(a))
|
||||||
|
logging.info(
|
||||||
|
"HostUnitTestDscCompleteCheck.IgnoreInf -> {0} not found in filesystem. Invalid ignore file".format(a))
|
||||||
|
|
||||||
|
# DSC Parser
|
||||||
|
dp = DscParser()
|
||||||
|
dp.SetBaseAbsPath(Edk2pathObj.WorkspacePath)
|
||||||
|
dp.SetPackagePaths(Edk2pathObj.PackagePathList)
|
||||||
|
dp.SetInputVars(environment.GetAllBuildKeyValues())
|
||||||
|
dp.ParseFile(wsr_dsc_path)
|
||||||
|
|
||||||
|
# Check if INF in component section
|
||||||
|
for INF in INFFiles:
|
||||||
|
if not any(INF.strip() in x for x in dp.ThreeMods) and \
|
||||||
|
not any(INF.strip() in x for x in dp.SixMods) and \
|
||||||
|
not any(INF.strip() in x for x in dp.OtherMods):
|
||||||
|
|
||||||
|
infp = InfParser().SetBaseAbsPath(Edk2pathObj.WorkspacePath)
|
||||||
|
infp.SetPackagePaths(Edk2pathObj.PackagePathList)
|
||||||
|
infp.ParseFile(INF)
|
||||||
|
if("MODULE_TYPE" not in infp.Dict):
|
||||||
|
tc.LogStdOut(
|
||||||
|
"Ignoring INF. Missing key for MODULE_TYPE {0}".format(INF))
|
||||||
|
continue
|
||||||
|
|
||||||
|
if(infp.Dict["MODULE_TYPE"] == "HOST_APPLICATION"):
|
||||||
|
# should compile test a library that is declared type HOST_APPLICATION
|
||||||
|
pass
|
||||||
|
|
||||||
|
elif len(infp.SupportedPhases) > 0 and \
|
||||||
|
"HOST_APPLICATION" in infp.SupportedPhases:
|
||||||
|
# should compile test a library that supports HOST_APPLICATION but
|
||||||
|
# require it to be an explicit opt-in
|
||||||
|
pass
|
||||||
|
|
||||||
|
else:
|
||||||
|
tc.LogStdOut(
|
||||||
|
"Ignoring INF. MODULE_TYPE or suppored phases not HOST_APPLICATION {0}".format(INF))
|
||||||
|
continue
|
||||||
|
|
||||||
|
logging.critical(INF + " not in " + wsr_dsc_path)
|
||||||
|
tc.LogStdError("{0} not in {1}".format(INF, wsr_dsc_path))
|
||||||
|
overall_status = overall_status + 1
|
||||||
|
|
||||||
|
# If XML object exists, add result
|
||||||
|
if overall_status != 0:
|
||||||
|
tc.SetFailed("HostUnitTestDscCompleteCheck {0} Failed. Errors {1}".format(
|
||||||
|
wsr_dsc_path, overall_status), "CHECK_FAILED")
|
||||||
|
else:
|
||||||
|
tc.SetSuccess()
|
||||||
|
return overall_status
|
@@ -0,0 +1,12 @@
|
|||||||
|
##
|
||||||
|
# CiBuildPlugin used to confirm all INFs are listed in
|
||||||
|
# the components section of package dsc
|
||||||
|
#
|
||||||
|
# Copyright (c) Microsoft Corporation.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
##
|
||||||
|
{
|
||||||
|
"scope": "host-based-test",
|
||||||
|
"name": "Host Unit Test Dsc Complete Check Test",
|
||||||
|
"module": "HostUnitTestDscCompleteCheck"
|
||||||
|
}
|
32
.pytool/Plugin/HostUnitTestDscCompleteCheck/Readme.md
Normal file
32
.pytool/Plugin/HostUnitTestDscCompleteCheck/Readme.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Host Unit Test Dsc Complete Check Plugin
|
||||||
|
|
||||||
|
This CiBuildPlugin scans all INF files from a package for those related to host
|
||||||
|
based unit tests confirms they are listed in the unit test DSC file for the package.
|
||||||
|
The test considers it an error if any INF meeting the requirements does not appear
|
||||||
|
in the `Components` section of the unit test DSC. This is critical because
|
||||||
|
much of the CI infrastructure assumes that modules will be listed in the DSC
|
||||||
|
and compiled.
|
||||||
|
|
||||||
|
This test will only require INFs in the following cases:
|
||||||
|
|
||||||
|
1. When MODULE_TYPE = HOST_APPLICATION
|
||||||
|
2. When a Library instance supports the HOST_APPLICATION environment
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The plugin has a few configuration options to support the UEFI codebase.
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
"HostUnitTestDscCompleteCheck": {
|
||||||
|
"DscPath": "", # Path to Host based unit test DSC file
|
||||||
|
"IgnoreInf": [] # Ignore INF if found in filesystem but not dsc
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### DscPath
|
||||||
|
|
||||||
|
Path to DSC to consider platform dsc
|
||||||
|
|
||||||
|
### IgnoreInf
|
||||||
|
|
||||||
|
Ignore error if Inf file is not listed in DSC file
|
@@ -67,7 +67,7 @@ class LibraryClassCheck(ICiBuildPlugin):
|
|||||||
abs_dec_path = self.__GetPkgDec(abs_pkg_path)
|
abs_dec_path = self.__GetPkgDec(abs_pkg_path)
|
||||||
wsr_dec_path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(abs_dec_path)
|
wsr_dec_path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(abs_dec_path)
|
||||||
|
|
||||||
if abs_dec_path is None or wsr_dec_path is "" or not os.path.isfile(abs_dec_path):
|
if abs_dec_path is None or wsr_dec_path == "" or not os.path.isfile(abs_dec_path):
|
||||||
tc.SetSkipped()
|
tc.SetSkipped()
|
||||||
tc.LogStdError("No DEC file {0} in package {1}".format(abs_dec_path, abs_pkg_path))
|
tc.LogStdError("No DEC file {0} in package {1}".format(abs_dec_path, abs_pkg_path))
|
||||||
return -1
|
return -1
|
||||||
@@ -146,7 +146,7 @@ class LibraryClassCheck(ICiBuildPlugin):
|
|||||||
|
|
||||||
|
|
||||||
# If XML object exists, add result
|
# If XML object exists, add result
|
||||||
if overall_status is not 0:
|
if overall_status != 0:
|
||||||
tc.SetFailed("LibraryClassCheck {0} Failed. Errors {1}".format(wsr_dec_path, overall_status), "CHECK_FAILED")
|
tc.SetFailed("LibraryClassCheck {0} Failed. Errors {1}".format(wsr_dec_path, overall_status), "CHECK_FAILED")
|
||||||
else:
|
else:
|
||||||
tc.SetSuccess()
|
tc.SetSuccess()
|
||||||
|
@@ -78,10 +78,6 @@
|
|||||||
# Define if the GICv3 controller should use the GICv2 legacy
|
# Define if the GICv3 controller should use the GICv2 legacy
|
||||||
gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE|BOOLEAN|0x00000042
|
gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE|BOOLEAN|0x00000042
|
||||||
|
|
||||||
# Whether to implement warm reboot for capsule update using a jump back to the
|
|
||||||
# PEI entry point with caches and interrupts disabled.
|
|
||||||
gArmTokenSpaceGuid.PcdArmReenterPeiForCapsuleWarmReboot|FALSE|BOOLEAN|0x0000001F
|
|
||||||
|
|
||||||
[PcdsFeatureFlag.ARM]
|
[PcdsFeatureFlag.ARM]
|
||||||
# Whether to map normal memory as non-shareable. FALSE is the safe choice, but
|
# Whether to map normal memory as non-shareable. FALSE is the safe choice, but
|
||||||
# TRUE may be appropriate to fix performance problems if you don't care about
|
# TRUE may be appropriate to fix performance problems if you don't care about
|
||||||
|
@@ -259,6 +259,43 @@ GetMmCompatibility ()
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC EFI_GUID* CONST mGuidedEventGuid[] = {
|
||||||
|
&gEfiEndOfDxeEventGroupGuid,
|
||||||
|
&gEfiEventExitBootServicesGuid,
|
||||||
|
&gEfiEventReadyToBootGuid,
|
||||||
|
};
|
||||||
|
|
||||||
|
STATIC EFI_EVENT mGuidedEvent[ARRAY_SIZE (mGuidedEventGuid)];
|
||||||
|
|
||||||
|
/**
|
||||||
|
Event notification that is fired when GUIDed Event Group is signaled.
|
||||||
|
|
||||||
|
@param Event The Event that is being processed, not used.
|
||||||
|
@param Context Event Context, not used.
|
||||||
|
|
||||||
|
**/
|
||||||
|
STATIC
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
MmGuidedEventNotify (
|
||||||
|
IN EFI_EVENT Event,
|
||||||
|
IN VOID *Context
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_MM_COMMUNICATE_HEADER Header;
|
||||||
|
UINTN Size;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Use Guid to initialize EFI_SMM_COMMUNICATE_HEADER structure
|
||||||
|
//
|
||||||
|
CopyGuid (&Header.HeaderGuid, Context);
|
||||||
|
Header.MessageLength = 1;
|
||||||
|
Header.Data[0] = 0;
|
||||||
|
|
||||||
|
Size = sizeof (Header);
|
||||||
|
MmCommunicationCommunicate (&mMmCommunication, &Header, &Size);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The Entry Point for MM Communication
|
The Entry Point for MM Communication
|
||||||
|
|
||||||
@@ -281,6 +318,7 @@ MmCommunicationInitialize (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
UINTN Index;
|
||||||
|
|
||||||
// Check if we can make the MM call
|
// Check if we can make the MM call
|
||||||
Status = GetMmCompatibility ();
|
Status = GetMmCompatibility ();
|
||||||
@@ -345,8 +383,13 @@ MmCommunicationInitialize (
|
|||||||
NULL,
|
NULL,
|
||||||
&mSetVirtualAddressMapEvent
|
&mSetVirtualAddressMapEvent
|
||||||
);
|
);
|
||||||
if (Status == EFI_SUCCESS) {
|
ASSERT_EFI_ERROR (Status);
|
||||||
return Status;
|
|
||||||
|
for (Index = 0; Index < ARRAY_SIZE (mGuidedEventGuid); Index++) {
|
||||||
|
Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_CALLBACK,
|
||||||
|
MmGuidedEventNotify, mGuidedEventGuid[Index],
|
||||||
|
mGuidedEventGuid[Index], &mGuidedEvent[Index]);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
gBS->UninstallProtocolInterface (
|
gBS->UninstallProtocolInterface (
|
||||||
|
@@ -42,6 +42,11 @@
|
|||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiMmCommunicationProtocolGuid ## PRODUCES
|
gEfiMmCommunicationProtocolGuid ## PRODUCES
|
||||||
|
|
||||||
|
[Guids]
|
||||||
|
gEfiEndOfDxeEventGroupGuid
|
||||||
|
gEfiEventExitBootServicesGuid
|
||||||
|
gEfiEventReadyToBootGuid
|
||||||
|
|
||||||
[Pcd.common]
|
[Pcd.common]
|
||||||
gArmTokenSpaceGuid.PcdMmBufferBase
|
gArmTokenSpaceGuid.PcdMmBufferBase
|
||||||
gArmTokenSpaceGuid.PcdMmBufferSize
|
gArmTokenSpaceGuid.PcdMmBufferSize
|
||||||
|
@@ -1,24 +0,0 @@
|
|||||||
/** @file
|
|
||||||
ResetSystemLib implementation using PSCI calls
|
|
||||||
|
|
||||||
Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
|
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
#include <AsmMacroIoLibV8.h>
|
|
||||||
|
|
||||||
ASM_FUNC(DisableMmuAndReenterPei)
|
|
||||||
stp x29, x30, [sp, #-16]!
|
|
||||||
mov x29, sp
|
|
||||||
|
|
||||||
bl ArmDisableMmu
|
|
||||||
|
|
||||||
// no memory accesses after MMU and caches have been disabled
|
|
||||||
|
|
||||||
MOV64 (x0, FixedPcdGet64 (PcdFvBaseAddress))
|
|
||||||
blr x0
|
|
||||||
|
|
||||||
// never returns
|
|
||||||
nop
|
|
@@ -1,29 +0,0 @@
|
|||||||
;/** @file
|
|
||||||
; ResetSystemLib implementation using PSCI calls
|
|
||||||
;
|
|
||||||
; Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
|
|
||||||
;
|
|
||||||
; SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
;
|
|
||||||
;**/
|
|
||||||
|
|
||||||
AREA Reset, CODE, READONLY
|
|
||||||
|
|
||||||
EXPORT DisableMmuAndReenterPei
|
|
||||||
IMPORT ArmDisableMmu
|
|
||||||
|
|
||||||
DisableMmuAndReenterPei
|
|
||||||
stp x29, x30, [sp, #-16]!
|
|
||||||
mov x29, sp
|
|
||||||
|
|
||||||
bl ArmDisableMmu
|
|
||||||
|
|
||||||
; no memory accesses after MMU and caches have been disabled
|
|
||||||
|
|
||||||
movl x0, FixedPcdGet64 (PcdFvBaseAddress)
|
|
||||||
blr x0
|
|
||||||
|
|
||||||
; never returns
|
|
||||||
nop
|
|
||||||
|
|
||||||
END
|
|
@@ -1,23 +0,0 @@
|
|||||||
/** @file
|
|
||||||
ResetSystemLib implementation using PSCI calls
|
|
||||||
|
|
||||||
Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
|
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
#include <AsmMacroIoLib.h>
|
|
||||||
|
|
||||||
ASM_FUNC(DisableMmuAndReenterPei)
|
|
||||||
push {lr}
|
|
||||||
|
|
||||||
bl ArmDisableMmu
|
|
||||||
|
|
||||||
// no memory accesses after MMU and caches have been disabled
|
|
||||||
|
|
||||||
MOV32 (r0, FixedPcdGet64 (PcdFvBaseAddress))
|
|
||||||
blx r0
|
|
||||||
|
|
||||||
// never returns
|
|
||||||
nop
|
|
@@ -1,28 +0,0 @@
|
|||||||
;/** @file
|
|
||||||
; ResetSystemLib implementation using PSCI calls
|
|
||||||
;
|
|
||||||
; Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
|
|
||||||
;
|
|
||||||
; SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
;
|
|
||||||
;**/
|
|
||||||
|
|
||||||
INCLUDE AsmMacroExport.inc
|
|
||||||
PRESERVE8
|
|
||||||
|
|
||||||
IMPORT ArmDisableMmu
|
|
||||||
|
|
||||||
RVCT_ASM_EXPORT DisableMmuAndReenterPei
|
|
||||||
push {lr}
|
|
||||||
|
|
||||||
bl ArmDisableMmu
|
|
||||||
|
|
||||||
; no memory accesses after MMU and caches have been disabled
|
|
||||||
|
|
||||||
mov32 r0, FixedPcdGet64 (PcdFvBaseAddress)
|
|
||||||
blx r0
|
|
||||||
|
|
||||||
; never returns
|
|
||||||
nop
|
|
||||||
|
|
||||||
END
|
|
@@ -10,13 +10,10 @@
|
|||||||
|
|
||||||
#include <PiDxe.h>
|
#include <PiDxe.h>
|
||||||
|
|
||||||
#include <Library/ArmMmuLib.h>
|
|
||||||
#include <Library/ArmSmcLib.h>
|
#include <Library/ArmSmcLib.h>
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/ResetSystemLib.h>
|
#include <Library/ResetSystemLib.h>
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
|
||||||
#include <Library/UefiRuntimeLib.h>
|
|
||||||
|
|
||||||
#include <IndustryStandard/ArmStdSmc.h>
|
#include <IndustryStandard/ArmStdSmc.h>
|
||||||
|
|
||||||
@@ -76,79 +73,6 @@ ResetShutdown (
|
|||||||
ArmCallSmc (&ArmSmcArgs);
|
ArmCallSmc (&ArmSmcArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID DisableMmuAndReenterPei (VOID);
|
|
||||||
|
|
||||||
/**
|
|
||||||
This function causes the system to enter S3 and then wake up immediately.
|
|
||||||
|
|
||||||
If this function returns, it means that the system does not support S3 feature.
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
EnterS3WithImmediateWake (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
EFI_PHYSICAL_ADDRESS Alloc;
|
|
||||||
EFI_MEMORY_DESCRIPTOR *MemMap;
|
|
||||||
UINTN MemMapSize;
|
|
||||||
UINTN MapKey, DescriptorSize;
|
|
||||||
UINT32 DescriptorVersion;
|
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
if (FeaturePcdGet (PcdArmReenterPeiForCapsuleWarmReboot) &&
|
|
||||||
!EfiAtRuntime ()) {
|
|
||||||
//
|
|
||||||
// At boot time, we are the only core running, so we can implement the
|
|
||||||
// immediate wake (which is used by capsule update) by disabling the MMU
|
|
||||||
// and interrupts, and jumping to the PEI entry point.
|
|
||||||
//
|
|
||||||
|
|
||||||
//
|
|
||||||
// Obtain the size of the memory map
|
|
||||||
//
|
|
||||||
MemMapSize = 0;
|
|
||||||
MemMap = NULL;
|
|
||||||
Status = gBS->GetMemoryMap (&MemMapSize, MemMap, &MapKey, &DescriptorSize,
|
|
||||||
&DescriptorVersion);
|
|
||||||
ASSERT (Status == EFI_BUFFER_TOO_SMALL);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Add some slack to the allocation to cater for changes in the memory
|
|
||||||
// map if ExitBootServices () fails the first time around.
|
|
||||||
//
|
|
||||||
MemMapSize += SIZE_4KB;
|
|
||||||
Status = gBS->AllocatePages (AllocateAnyPages, EfiBootServicesData,
|
|
||||||
EFI_SIZE_TO_PAGES (MemMapSize), &Alloc);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
MemMap = (EFI_MEMORY_DESCRIPTOR *)(UINTN)Alloc;
|
|
||||||
|
|
||||||
Status = gBS->GetMemoryMap (&MemMapSize, MemMap, &MapKey, &DescriptorSize,
|
|
||||||
&DescriptorVersion);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
Status = gBS->ExitBootServices (gImageHandle, MapKey);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
//
|
|
||||||
// ExitBootServices () may fail the first time around if an event fired
|
|
||||||
// right after the call to GetMemoryMap() which allocated or freed memory.
|
|
||||||
// Since that first call to ExitBootServices () will disarm the timer,
|
|
||||||
// this is guaranteed not to happen again, so one additional attempt
|
|
||||||
// should suffice.
|
|
||||||
//
|
|
||||||
Status = gBS->GetMemoryMap (&MemMapSize, MemMap, &MapKey, &DescriptorSize,
|
|
||||||
&DescriptorVersion);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
Status = gBS->ExitBootServices (gImageHandle, MapKey);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
}
|
|
||||||
|
|
||||||
DisableMmuAndReenterPei ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function causes a systemwide reset. The exact type of the reset is
|
This function causes a systemwide reset. The exact type of the reset is
|
||||||
defined by the EFI_GUID that follows the Null-terminated Unicode string passed
|
defined by the EFI_GUID that follows the Null-terminated Unicode string passed
|
||||||
|
@@ -15,14 +15,6 @@
|
|||||||
VERSION_STRING = 1.0
|
VERSION_STRING = 1.0
|
||||||
LIBRARY_CLASS = ResetSystemLib
|
LIBRARY_CLASS = ResetSystemLib
|
||||||
|
|
||||||
[Sources.AARCH64]
|
|
||||||
AArch64/Reset.S | GCC
|
|
||||||
AArch64/Reset.asm | MSFT
|
|
||||||
|
|
||||||
[Sources.ARM]
|
|
||||||
Arm/Reset.S | GCC
|
|
||||||
Arm/Reset.asm | RVCT
|
|
||||||
|
|
||||||
[Sources]
|
[Sources]
|
||||||
ArmSmcPsciResetSystemLib.c
|
ArmSmcPsciResetSystemLib.c
|
||||||
|
|
||||||
@@ -32,15 +24,6 @@
|
|||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
ArmMmuLib
|
|
||||||
ArmSmcLib
|
ArmSmcLib
|
||||||
BaseLib
|
BaseLib
|
||||||
DebugLib
|
DebugLib
|
||||||
UefiBootServicesTableLib
|
|
||||||
UefiRuntimeLib
|
|
||||||
|
|
||||||
[FeaturePcd]
|
|
||||||
gArmTokenSpaceGuid.PcdArmReenterPeiForCapsuleWarmReboot
|
|
||||||
|
|
||||||
[FixedPcd]
|
|
||||||
gArmTokenSpaceGuid.PcdFvBaseAddress
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
Implementation for PlatformBootManagerLib library class interfaces.
|
Implementation for PlatformBootManagerLib library class interfaces.
|
||||||
|
|
||||||
Copyright (C) 2015-2016, Red Hat, Inc.
|
Copyright (C) 2015-2016, Red Hat, Inc.
|
||||||
Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
|
Copyright (c) 2014 - 2019, ARM Ltd. All rights reserved.<BR>
|
||||||
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||||
|
|
||||||
@@ -549,6 +549,11 @@ PlatformBootManagerBeforeConsole (
|
|||||||
//
|
//
|
||||||
EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
|
EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Dispatch deferred images after EndOfDxe event.
|
||||||
|
//
|
||||||
|
EfiBootManagerDispatchDeferredImages ();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Locate the PCI root bridges and make the PCI bus driver connect each,
|
// Locate the PCI root bridges and make the PCI bus driver connect each,
|
||||||
// non-recursively. This will produce a number of child handles with PciIo on
|
// non-recursively. This will produce a number of child handles with PciIo on
|
||||||
|
@@ -77,6 +77,11 @@ CEntryPoint (
|
|||||||
ASSERT (((UINTN)PeiVectorTable & ARM_VECTOR_TABLE_ALIGNMENT) == 0);
|
ASSERT (((UINTN)PeiVectorTable & ARM_VECTOR_TABLE_ALIGNMENT) == 0);
|
||||||
ArmWriteVBar ((UINTN)PeiVectorTable);
|
ArmWriteVBar ((UINTN)PeiVectorTable);
|
||||||
|
|
||||||
|
// Enable Floating Point
|
||||||
|
if (FixedPcdGet32 (PcdVFPEnabled)) {
|
||||||
|
ArmEnableVFP ();
|
||||||
|
}
|
||||||
|
|
||||||
//Note: The MMU will be enabled by MemoryPeim. Only the primary core will have the MMU on.
|
//Note: The MMU will be enabled by MemoryPeim. Only the primary core will have the MMU on.
|
||||||
|
|
||||||
// If not primary Jump to Secondary Main
|
// If not primary Jump to Secondary Main
|
||||||
|
@@ -62,6 +62,7 @@
|
|||||||
[FixedPcd]
|
[FixedPcd]
|
||||||
gArmTokenSpaceGuid.PcdFvBaseAddress
|
gArmTokenSpaceGuid.PcdFvBaseAddress
|
||||||
gArmTokenSpaceGuid.PcdFvSize
|
gArmTokenSpaceGuid.PcdFvSize
|
||||||
|
gArmTokenSpaceGuid.PcdVFPEnabled
|
||||||
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase
|
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase
|
||||||
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
|
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
|
||||||
|
@@ -60,6 +60,7 @@
|
|||||||
[FixedPcd]
|
[FixedPcd]
|
||||||
gArmTokenSpaceGuid.PcdFvBaseAddress
|
gArmTokenSpaceGuid.PcdFvBaseAddress
|
||||||
gArmTokenSpaceGuid.PcdFvSize
|
gArmTokenSpaceGuid.PcdFvSize
|
||||||
|
gArmTokenSpaceGuid.PcdVFPEnabled
|
||||||
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase
|
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase
|
||||||
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
|
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
|
||||||
|
@@ -81,7 +81,7 @@ class EfiSectionTE:
|
|||||||
filename = self.base_te + debug_rva + 0xc
|
filename = self.base_te + debug_rva + 0xc
|
||||||
else:
|
else:
|
||||||
filename = self.base_te + debug_rva + 0x10
|
filename = self.base_te + debug_rva + 0x10
|
||||||
filename = struct.unpack("200s", self.ec.getMemoryService().read(filename, 200, 32))[0]
|
filename = struct.unpack("400s", self.ec.getMemoryService().read(filename, 400, 32))[0]
|
||||||
return filename[0:string.find(filename,'\0')]
|
return filename[0:string.find(filename,'\0')]
|
||||||
|
|
||||||
def get_debug_elfbase(self):
|
def get_debug_elfbase(self):
|
||||||
@@ -119,7 +119,7 @@ class EfiSectionPE32:
|
|||||||
filename = self.base_pe32 + debug_rva + 0xc
|
filename = self.base_pe32 + debug_rva + 0xc
|
||||||
else:
|
else:
|
||||||
filename = self.base_pe32 + debug_rva + 0x10
|
filename = self.base_pe32 + debug_rva + 0x10
|
||||||
filename = struct.unpack("200s", self.ec.getMemoryService().read(str(filename), 200, 32))[0]
|
filename = struct.unpack("400s", self.ec.getMemoryService().read(str(filename), 400, 32))[0]
|
||||||
return filename[0:string.find(filename,'\0')]
|
return filename[0:string.find(filename,'\0')]
|
||||||
|
|
||||||
def get_debug_elfbase(self):
|
def get_debug_elfbase(self):
|
||||||
@@ -154,7 +154,7 @@ class EfiSectionPE64:
|
|||||||
filename = self.base_pe64 + debug_rva + 0xc
|
filename = self.base_pe64 + debug_rva + 0xc
|
||||||
else:
|
else:
|
||||||
filename = self.base_pe64 + debug_rva + 0x10
|
filename = self.base_pe64 + debug_rva + 0x10
|
||||||
filename = struct.unpack("200s", self.ec.getMemoryService().read(str(filename), 200, 32))[0]
|
filename = struct.unpack("400s", self.ec.getMemoryService().read(str(filename), 400, 32))[0]
|
||||||
return filename[0:string.find(filename,'\0')]
|
return filename[0:string.find(filename,'\0')]
|
||||||
|
|
||||||
def get_debug_elfbase(self):
|
def get_debug_elfbase(self):
|
||||||
|
@@ -145,20 +145,6 @@ ResetShutdown (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
This function causes the system to enter S3 and then wake up immediately.
|
|
||||||
|
|
||||||
If this function returns, it means that the system does not support S3 feature.
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
EnterS3WithImmediateWake (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// not implemented
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function causes a systemwide reset. The exact type of the reset is
|
This function causes a systemwide reset. The exact type of the reset is
|
||||||
defined by the EFI_GUID that follows the Null-terminated Unicode string passed
|
defined by the EFI_GUID that follows the Null-terminated Unicode string passed
|
||||||
|
14
BaseTools/BinWrappers/PosixLike/AmlToHex
Executable file
14
BaseTools/BinWrappers/PosixLike/AmlToHex
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#python `dirname $0`/RunToolFromSource.py `basename $0` $*
|
||||||
|
|
||||||
|
# If a ${PYTHON_COMMAND} command is available, use it in preference to python
|
||||||
|
if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then
|
||||||
|
python_exe=${PYTHON_COMMAND}
|
||||||
|
fi
|
||||||
|
|
||||||
|
full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
|
||||||
|
dir=$(dirname "$full_cmd")
|
||||||
|
exe=$(basename "$full_cmd")
|
||||||
|
|
||||||
|
export PYTHONPATH="$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}"
|
||||||
|
exec "${python_exe:-python}" "$dir/../../Source/Python/$exe/$exe.py" "$@"
|
3
BaseTools/BinWrappers/WindowsLike/AmlToHex.bat
Normal file
3
BaseTools/BinWrappers/WindowsLike/AmlToHex.bat
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@setlocal
|
||||||
|
@set ToolName=%~n0%
|
||||||
|
@%PYTHON_COMMAND% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*
|
@@ -1,6 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
# Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
# Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
||||||
|
# Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
|
|
||||||
@@ -81,6 +82,8 @@
|
|||||||
# will be generated only when this macro is used in command line.
|
# will be generated only when this macro is used in command line.
|
||||||
# This is intended to get over the long command line limitation.
|
# This is intended to get over the long command line limitation.
|
||||||
# )
|
# )
|
||||||
|
# $(DEPS_FLAGS) This is a tool flag to have c compiler generate dependent header file list for a source file.
|
||||||
|
# To enable incremental build, this flag must apply to $(CC), $(VFRPP), $(PP), $(ASLCC) and $(ASLPP).
|
||||||
#
|
#
|
||||||
# $(CP) copy command
|
# $(CP) copy command
|
||||||
# $(MV) move command
|
# $(MV) move command
|
||||||
@@ -123,14 +126,14 @@
|
|||||||
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||||
|
|
||||||
<Command.MSFT, Command.INTEL>
|
<Command.MSFT, Command.INTEL>
|
||||||
"$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src}
|
"$(CC)" /Fo${dst} $(DEPS_FLAGS) $(CC_FLAGS) $(INC) ${src}
|
||||||
|
|
||||||
<Command.GCC, Command.RVCT>
|
<Command.GCC, Command.RVCT>
|
||||||
# For RVCTCYGWIN CC_FLAGS must be first to work around pathing issues
|
# For RVCTCYGWIN CC_FLAGS must be first to work around pathing issues
|
||||||
"$(CC)" $(CC_FLAGS) -c -o ${dst} $(INC) ${src}
|
"$(CC)" $(DEPS_FLAGS) $(CC_FLAGS) -c -o ${dst} $(INC) ${src}
|
||||||
|
|
||||||
<Command.XCODE>
|
<Command.XCODE>
|
||||||
"$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src}
|
"$(CC)" $(DEPS_FLAGS) $(CC_FLAGS) -o ${dst} $(INC) ${src}
|
||||||
|
|
||||||
[C-Code-File.BASE.AARCH64,C-Code-File.SEC.AARCH64,C-Code-File.PEI_CORE.AARCH64,C-Code-File.PEIM.AARCH64,C-Code-File.BASE.ARM,C-Code-File.SEC.ARM,C-Code-File.PEI_CORE.ARM,C-Code-File.PEIM.ARM]
|
[C-Code-File.BASE.AARCH64,C-Code-File.SEC.AARCH64,C-Code-File.PEI_CORE.AARCH64,C-Code-File.PEIM.AARCH64,C-Code-File.BASE.ARM,C-Code-File.SEC.ARM,C-Code-File.PEI_CORE.ARM,C-Code-File.PEIM.ARM]
|
||||||
<InputFile>
|
<InputFile>
|
||||||
@@ -167,15 +170,17 @@
|
|||||||
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||||
|
|
||||||
<Command.MSFT, Command.INTEL>
|
<Command.MSFT, Command.INTEL>
|
||||||
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
Trim --asm-file -o ${d_path}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
Trim --source-code --convert-hex --trim-long -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
"$(PP)" $(DEPS_FLAGS) $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.ii
|
||||||
"$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iii
|
Trim --source-code --convert-hex --trim-long -o ${d_path}(+)${s_base}.iiii ${d_path}(+)${s_base}.ii
|
||||||
|
"$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iiii
|
||||||
|
|
||||||
<Command.GCC, Command.RVCT>
|
<Command.GCC, Command.RVCT>
|
||||||
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
Trim --asm-file -o ${d_path}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
Trim --trim-long --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
"$(PP)" $(DEPS_FLAGS) $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.ii
|
||||||
|
Trim --trim-long --source-code -o ${d_path}(+)${s_base}.iiii ${d_path}(+)${s_base}.ii
|
||||||
# For RVCTCYGWIN ASM_FLAGS must be first to work around pathing issues
|
# For RVCTCYGWIN ASM_FLAGS must be first to work around pathing issues
|
||||||
"$(ASM)" $(ASM_FLAGS) -o ${dst} $(INC) ${d_path}(+)${s_base}.iii
|
"$(ASM)" $(ASM_FLAGS) -o ${dst} $(INC) ${d_path}(+)${s_base}.iiii
|
||||||
|
|
||||||
[Assembly-Code-File.COMMON.ARM,Assembly-Code-File.COMMON.AARCH64]
|
[Assembly-Code-File.COMMON.ARM,Assembly-Code-File.COMMON.AARCH64]
|
||||||
# Remove --convert-hex for ARM as it breaks MSFT assemblers
|
# Remove --convert-hex for ARM as it breaks MSFT assemblers
|
||||||
@@ -192,20 +197,23 @@
|
|||||||
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||||
|
|
||||||
<Command.INTEL>
|
<Command.INTEL>
|
||||||
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
Trim --asm-file -o ${d_path}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
Trim --source-code --convert-hex --trim-long -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
"$(PP)" $(DEPS_FLAGS) $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.ii
|
||||||
"$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iii
|
Trim --source-code --convert-hex --trim-long -o ${d_path}(+)${s_base}.iiii ${d_path}(+)${s_base}.ii
|
||||||
|
"$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iiii
|
||||||
|
|
||||||
<Command.MSFT>
|
<Command.MSFT>
|
||||||
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
Trim --asm-file -o ${d_path}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
Trim --source-code --trim-long -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
"$(PP)" $(DEPS_FLAGS) $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.ii
|
||||||
"$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iii
|
Trim --source-code --trim-long -o ${d_path}(+)${s_base}.iiii ${d_path}(+)${s_base}.ii
|
||||||
|
"$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iiii
|
||||||
|
|
||||||
<Command.GCC, Command.RVCT>
|
<Command.GCC, Command.RVCT>
|
||||||
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
Trim --asm-file -o ${d_path}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
Trim --trim-long --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
"$(PP)" $(DEPS_FLAGS) $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.ii
|
||||||
|
Trim --trim-long --source-code -o ${d_path}(+)${s_base}.iiii ${d_path}(+)${s_base}.ii
|
||||||
# For RVCTCYGWIN ASM_FLAGS must be first to work around pathing issues
|
# For RVCTCYGWIN ASM_FLAGS must be first to work around pathing issues
|
||||||
"$(ASM)" $(ASM_FLAGS) -o ${dst} $(INC) ${d_path}(+)${s_base}.iii
|
"$(ASM)" $(ASM_FLAGS) -o ${dst} $(INC) ${d_path}(+)${s_base}.iiii
|
||||||
|
|
||||||
[Nasm-Assembly-Code-File.COMMON.COMMON]
|
[Nasm-Assembly-Code-File.COMMON.COMMON]
|
||||||
<InputFile>
|
<InputFile>
|
||||||
@@ -218,8 +226,9 @@
|
|||||||
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||||
|
|
||||||
<Command>
|
<Command>
|
||||||
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
Trim --asm-file -o ${d_path}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
Trim --trim-long --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
"$(PP)" $(DEPS_FLAGS) $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.ii
|
||||||
|
Trim --trim-long --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.ii
|
||||||
"$(NASM)" -I${s_path}(+) $(NASM_INC) $(NASM_FLAGS) -o $dst ${d_path}(+)${s_base}.iii
|
"$(NASM)" -I${s_path}(+) $(NASM_INC) $(NASM_FLAGS) -o $dst ${d_path}(+)${s_base}.iii
|
||||||
|
|
||||||
[Device-Tree-Source-File]
|
[Device-Tree-Source-File]
|
||||||
@@ -249,7 +258,7 @@
|
|||||||
$(DEBUG_DIR)(+)${s_dir}(+)${s_base}.c
|
$(DEBUG_DIR)(+)${s_dir}(+)${s_base}.c
|
||||||
|
|
||||||
<Command>
|
<Command>
|
||||||
"$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_base}.i
|
"$(VFRPP)" $(DEPS_FLAGS) $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_base}.i
|
||||||
"$(VFR)" $(VFR_FLAGS) --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_base}.i
|
"$(VFR)" $(VFR_FLAGS) --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_base}.i
|
||||||
|
|
||||||
[Object-File]
|
[Object-File]
|
||||||
@@ -400,7 +409,7 @@
|
|||||||
$(MAKE_FILE)
|
$(MAKE_FILE)
|
||||||
|
|
||||||
<Command>
|
<Command>
|
||||||
"$(PP)" $(APP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
"$(PP)" $(DEPS_FLAGS) $(APP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
||||||
Trim --source-code -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
Trim --source-code -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
||||||
GenDepex -t $(MODULE_TYPE) -o ${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
GenDepex -t $(MODULE_TYPE) -o ${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
||||||
|
|
||||||
@@ -415,16 +424,18 @@
|
|||||||
$(MAKE_FILE)
|
$(MAKE_FILE)
|
||||||
|
|
||||||
<Command.MSFT, Command.INTEL>
|
<Command.MSFT, Command.INTEL>
|
||||||
Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i -i $(INC_LIST) ${src}
|
Trim --asl-file --asl-deps -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
"$(ASLPP)" $(ASLPP_FLAGS) $(INC) /I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
"$(ASLPP)" $(DEPS_FLAGS) $(ASLPP_FLAGS) $(INC) /I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
||||||
Trim --source-code -l -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
Trim --source-code -l -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
||||||
"$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii
|
"$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii
|
||||||
|
-AmlToHex $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.aml
|
||||||
|
|
||||||
<Command.GCC>
|
<Command.GCC>
|
||||||
Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i -i $(INC_LIST) ${src}
|
Trim --asl-file --asl-deps -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
"$(ASLPP)" $(ASLPP_FLAGS) $(INC) -I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
"$(ASLPP)" $(DEPS_FLAGS) $(ASLPP_FLAGS) $(INC) -I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
||||||
Trim --source-code -l -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
Trim --source-code -l -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
||||||
"$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii
|
"$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii
|
||||||
|
-AmlToHex $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.aml
|
||||||
|
|
||||||
[C-Code-File.AcpiTable]
|
[C-Code-File.AcpiTable]
|
||||||
<InputFile>
|
<InputFile>
|
||||||
@@ -437,12 +448,12 @@
|
|||||||
$(MAKE_FILE)
|
$(MAKE_FILE)
|
||||||
|
|
||||||
<Command.MSFT, Command.INTEL>
|
<Command.MSFT, Command.INTEL>
|
||||||
"$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASLCC_FLAGS) $(INC) ${src}
|
"$(ASLCC)" $(DEPS_FLAGS) /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASLCC_FLAGS) $(DEPS_FLAGS) $(INC) ${src}
|
||||||
"$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
"$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||||
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
||||||
|
|
||||||
<Command.GCC>
|
<Command.GCC>
|
||||||
"$(ASLCC)" -c -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}
|
"$(ASLCC)" $(DEPS_FLAGS) -c -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(DEPS_FLAGS) $(INC) ${src}
|
||||||
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||||
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
||||||
|
|
||||||
@@ -457,22 +468,22 @@
|
|||||||
$(MAKE_FILE)
|
$(MAKE_FILE)
|
||||||
|
|
||||||
<Command.MSFT, Command.INTEL>
|
<Command.MSFT, Command.INTEL>
|
||||||
"$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASLCC_FLAGS) $(INC) ${src}
|
"$(ASLCC)" $(DEPS_FLAGS) /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASLCC_FLAGS) $(DEPS_FLAGS) $(INC) ${src}
|
||||||
"$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
"$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||||
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
||||||
|
|
||||||
<Command.GCC>
|
<Command.GCC>
|
||||||
"$(ASLCC)" -c -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}
|
"$(ASLCC)" $(DEPS_FLAGS) -c -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(DEPS_FLAGS) $(INC) ${src}
|
||||||
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS)
|
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS)
|
||||||
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
||||||
|
|
||||||
<Command.CLANGPDB>
|
<Command.CLANGPDB>
|
||||||
"$(ASLCC)" -c -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}
|
"$(ASLCC)" $(DEPS_FLAGS) -c -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(DEPS_FLAGS) $(INC) ${src}
|
||||||
"$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
"$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||||
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
|
||||||
|
|
||||||
<Command.XCODE>
|
<Command.XCODE>
|
||||||
"$(ASLCC)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASLCC_FLAGS) $(INC) ${src}
|
"$(ASLCC)" $(DEPS_FLAGS) -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASLCC_FLAGS) $(DEPS_FLAGS) $(INC) ${src}
|
||||||
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||||
"$(MTOC)" -subsystem $(MODULE_TYPE) $(MTOC_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.pecoff
|
"$(MTOC)" -subsystem $(MODULE_TYPE) $(MTOC_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.pecoff
|
||||||
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.pecoff $(GENFW_FLAGS)
|
"$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.pecoff $(GENFW_FLAGS)
|
||||||
@@ -489,21 +500,24 @@
|
|||||||
$(OUTPUT_DIR)(+)${s_base}.com
|
$(OUTPUT_DIR)(+)${s_base}.com
|
||||||
|
|
||||||
<Command.MSFT, Command.INTEL>
|
<Command.MSFT, Command.INTEL>
|
||||||
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
Trim --asm-file -o ${d_path}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
Trim --source-code --convert-hex --trim-long -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
"$(PP)" $(DEPS_FLAGS) $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.ii
|
||||||
|
Trim --source-code --convert-hex --trim-long -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.ii
|
||||||
cd $(OUTPUT_DIR)(+)${s_dir}
|
cd $(OUTPUT_DIR)(+)${s_dir}
|
||||||
"$(ASM16)" /nologo /c /omf $(INC) /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${d_path}(+)${s_base}.iii
|
"$(ASM16)" /nologo /c /omf $(INC) /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${d_path}(+)${s_base}.iii
|
||||||
"$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,
|
"$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,
|
||||||
|
|
||||||
<Command.GCC>
|
<Command.GCC>
|
||||||
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
Trim --asm-file -o {d_path}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
"$(PP)" $(DEPS_FLAGS) $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.ii
|
||||||
|
Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.ii
|
||||||
"$(ASM)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii
|
"$(ASM)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii
|
||||||
"$(DLINK)" -o ${dst} $(DLINK_FLAGS) --start-group $(DLINK_SPATH) $(LIBS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj --end-group
|
"$(DLINK)" -o ${dst} $(DLINK_FLAGS) --start-group $(DLINK_SPATH) $(LIBS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj --end-group
|
||||||
|
|
||||||
<Command.XCODE>
|
<Command.XCODE>
|
||||||
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
Trim --asm-file -o ${d_path}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
"$(PP)" $(DEPS_FLAGS) $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.ii
|
||||||
|
Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.ii
|
||||||
"$(ASM)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii
|
"$(ASM)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii
|
||||||
"$(SLINK)" $(SLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.slib $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
"$(SLINK)" $(SLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.slib $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
||||||
otool -t $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.slib | hex2bin.py ${dst}
|
otool -t $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.slib | hex2bin.py ${dst}
|
||||||
@@ -520,9 +534,10 @@
|
|||||||
$(OUTPUT_DIR)(+)${s_base}.bin
|
$(OUTPUT_DIR)(+)${s_base}.bin
|
||||||
|
|
||||||
<Command>
|
<Command>
|
||||||
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
Trim --asm-file -o ${d_path}(+)${s_base}.i -i $(INC_LIST) ${src}
|
||||||
Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
"$(PP)" $(DEPS_FLAGS) $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.ii
|
||||||
"$(NASM)" -I${s_path}(+) -l ${d_path}(+)${s_base}.lst $(NASMB_FLAGS) -o $dst ${d_path}(+)${s_base}.iii
|
Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.ii
|
||||||
|
"$(NASM)" -I${s_path}(+) -l ${d_path}(+)${s_base}.lst $(NASMB_FLAGS) $(NASM_INC) -o $dst ${d_path}(+)${s_base}.iii
|
||||||
# copy the output file with .com postfix that be same to the output file of .asm16
|
# copy the output file with .com postfix that be same to the output file of .asm16
|
||||||
$(CP) ${dst} $(OUTPUT_DIR)(+)${s_base}.com
|
$(CP) ${dst} $(OUTPUT_DIR)(+)${s_base}.com
|
||||||
|
|
||||||
@@ -623,7 +638,7 @@
|
|||||||
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.hpk
|
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.hpk
|
||||||
|
|
||||||
<Command>
|
<Command>
|
||||||
"$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
"$(VFRPP)" $(DEPS_FLAGS) $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
||||||
"$(VFR)" $(VFR_FLAGS) --create-ifr-package --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory $(OUTPUT_DIR)(+)${s_dir} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
"$(VFR)" $(VFR_FLAGS) --create-ifr-package --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory $(OUTPUT_DIR)(+)${s_dir} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
||||||
|
|
||||||
[Hii-Binary-Package.UEFI_HII]
|
[Hii-Binary-Package.UEFI_HII]
|
||||||
|
@@ -17,3 +17,14 @@
|
|||||||
*.fdf diff=ini
|
*.fdf diff=ini
|
||||||
*.fdf.inc diff=ini
|
*.fdf.inc diff=ini
|
||||||
*.inf diff=ini
|
*.inf diff=ini
|
||||||
|
*.c diff=cpp
|
||||||
|
*.C diff=cpp
|
||||||
|
*.cc diff=cpp
|
||||||
|
*.CC diff=cpp
|
||||||
|
*.cpp diff=cpp
|
||||||
|
*.Cpp diff=cpp
|
||||||
|
*.CPP diff=cpp
|
||||||
|
*.aslc diff=cpp
|
||||||
|
*.act diff=cpp
|
||||||
|
*.h diff=cpp
|
||||||
|
*.H diff=cpp
|
||||||
|
@@ -147,6 +147,9 @@ DEFINE DEFAULT_WIN_ASL_BIN = DEF(WIN_IASL_BIN)
|
|||||||
DEFINE DEFAULT_WIN_ASL_FLAGS = DEF(IASL_FLAGS)
|
DEFINE DEFAULT_WIN_ASL_FLAGS = DEF(IASL_FLAGS)
|
||||||
DEFINE DEFAULT_WIN_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
DEFINE DEFAULT_WIN_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
||||||
|
|
||||||
|
# MSFT Build Flag for included header file list generation
|
||||||
|
DEFINE MSFT_DEPS_FLAGS = /showIncludes
|
||||||
|
|
||||||
DEFINE MSFT_ASLPP_FLAGS = /nologo /E /C /FIAutoGen.h
|
DEFINE MSFT_ASLPP_FLAGS = /nologo /E /C /FIAutoGen.h
|
||||||
DEFINE MSFT_ASLCC_FLAGS = /nologo /c /FIAutoGen.h /TC /Dmain=ReferenceAcpiTable
|
DEFINE MSFT_ASLCC_FLAGS = /nologo /c /FIAutoGen.h /TC /Dmain=ReferenceAcpiTable
|
||||||
DEFINE MSFT_ASLDLINK_FLAGS = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:CONSOLE
|
DEFINE MSFT_ASLDLINK_FLAGS = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:CONSOLE
|
||||||
@@ -334,12 +337,16 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
|
|||||||
# Required to build platforms or ACPI tables:
|
# Required to build platforms or ACPI tables:
|
||||||
# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
|
# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
|
||||||
# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
|
# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
|
||||||
|
# Notes: Since this tool chain is obsolete, it doesn't enable the compiler option for included header file list generation,
|
||||||
|
# and lose the incremental build capability.
|
||||||
# RVCTLINUX -unix- Requires:
|
# RVCTLINUX -unix- Requires:
|
||||||
# ARM C/C++ Compiler, 5.00
|
# ARM C/C++ Compiler, 5.00
|
||||||
# Optional:
|
# Optional:
|
||||||
# Required to build platforms or ACPI tables:
|
# Required to build platforms or ACPI tables:
|
||||||
# Intel(r) ACPI Compiler from
|
# Intel(r) ACPI Compiler from
|
||||||
# https://acpica.org/downloads
|
# https://acpica.org/downloads
|
||||||
|
# Notes: Since this tool chain is obsolete, it doesn't enable the compiler option for included header file list generation,
|
||||||
|
# and lose the incremental build capability.
|
||||||
# * Commented out - All versions of VS2005 use the same standard install directory
|
# * Commented out - All versions of VS2005 use the same standard install directory
|
||||||
#
|
#
|
||||||
####################################################################################
|
####################################################################################
|
||||||
@@ -415,7 +422,7 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
|
|||||||
*_VS2008_*_APP_FLAGS = /nologo /E /TC
|
*_VS2008_*_APP_FLAGS = /nologo /E /TC
|
||||||
*_VS2008_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
*_VS2008_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||||
*_VS2008_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2008_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
|
*_VS2008_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
*_VS2008_*_ASM16_PATH = DEF(VS2008_BIN)\ml.exe
|
*_VS2008_*_ASM16_PATH = DEF(VS2008_BIN)\ml.exe
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -478,9 +485,9 @@ NOOPT_VS2008_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2008_X64_ASLPP_PATH = DEF(VS2008_BINX64)\cl.exe
|
*_VS2008_X64_ASLPP_PATH = DEF(VS2008_BINX64)\cl.exe
|
||||||
*_VS2008_X64_ASLDLINK_PATH = DEF(VS2008_BINX64)\link.exe
|
*_VS2008_X64_ASLDLINK_PATH = DEF(VS2008_BINX64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2008_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /MP
|
DEBUG_VS2008_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7
|
||||||
RELEASE_VS2008_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /MP
|
RELEASE_VS2008_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
|
||||||
NOOPT_VS2008_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2008_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2008_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2008_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2008_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2008_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
@@ -531,7 +538,7 @@ NOOPT_VS2008_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT
|
|||||||
*_VS2008x86_*_APP_FLAGS = /nologo /E /TC
|
*_VS2008x86_*_APP_FLAGS = /nologo /E /TC
|
||||||
*_VS2008x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
*_VS2008x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||||
*_VS2008x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2008x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
|
*_VS2008x86_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
*_VS2008x86_*_ASM16_PATH = DEF(VS2008x86_BIN)\ml.exe
|
*_VS2008x86_*_ASM16_PATH = DEF(VS2008x86_BIN)\ml.exe
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -562,9 +569,9 @@ NOOPT_VS2008_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT
|
|||||||
*_VS2008x86_IA32_ASM_PATH = DEF(VS2008x86_BIN)\ml.exe
|
*_VS2008x86_IA32_ASM_PATH = DEF(VS2008x86_BIN)\ml.exe
|
||||||
|
|
||||||
*_VS2008x86_IA32_MAKE_FLAGS = /nologo
|
*_VS2008x86_IA32_MAKE_FLAGS = /nologo
|
||||||
DEBUG_VS2008x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /MP
|
DEBUG_VS2008x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7
|
||||||
RELEASE_VS2008x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /MP
|
RELEASE_VS2008x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
|
||||||
NOOPT_VS2008x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
|
NOOPT_VS2008x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2008x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
DEBUG_VS2008x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||||
RELEASE_VS2008x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
RELEASE_VS2008x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||||
@@ -594,10 +601,9 @@ NOOPT_VS2008x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2008x86_X64_DLINK_PATH = DEF(VS2008x86_BINX64)\link.exe
|
*_VS2008x86_X64_DLINK_PATH = DEF(VS2008x86_BINX64)\link.exe
|
||||||
*_VS2008x86_X64_ASLDLINK_PATH = DEF(VS2008x86_BINX64)\link.exe
|
*_VS2008x86_X64_ASLDLINK_PATH = DEF(VS2008x86_BINX64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2008x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /MP
|
DEBUG_VS2008x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7
|
||||||
RELEASE_VS2008x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /MP
|
RELEASE_VS2008x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
|
||||||
NOOPT_VS2008x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2008x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2008x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2008x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2008x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2008x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
NOOPT_VS2008x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
NOOPT_VS2008x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
@@ -650,7 +656,7 @@ NOOPT_VS2008x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2010_*_APP_FLAGS = /nologo /E /TC
|
*_VS2010_*_APP_FLAGS = /nologo /E /TC
|
||||||
*_VS2010_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
*_VS2010_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||||
*_VS2010_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2010_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
|
*_VS2010_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
*_VS2010_*_ASM16_PATH = DEF(VS2010_BIN)\ml.exe
|
*_VS2010_*_ASM16_PATH = DEF(VS2010_BIN)\ml.exe
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -681,9 +687,9 @@ NOOPT_VS2008x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2010_IA32_ASLDLINK_PATH = DEF(VS2010_BIN)\link.exe
|
*_VS2010_IA32_ASLDLINK_PATH = DEF(VS2010_BIN)\link.exe
|
||||||
|
|
||||||
*_VS2010_IA32_MAKE_FLAGS = /nologo
|
*_VS2010_IA32_MAKE_FLAGS = /nologo
|
||||||
DEBUG_VS2010_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /MP
|
DEBUG_VS2010_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7
|
||||||
RELEASE_VS2010_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /MP
|
RELEASE_VS2010_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
|
||||||
NOOPT_VS2010_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od /MP
|
NOOPT_VS2010_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
|
||||||
|
|
||||||
DEBUG_VS2010_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
DEBUG_VS2010_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||||
RELEASE_VS2010_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
RELEASE_VS2010_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||||
@@ -713,9 +719,9 @@ NOOPT_VS2010_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2010_X64_ASLPP_PATH = DEF(VS2010_BINX64)\cl.exe
|
*_VS2010_X64_ASLPP_PATH = DEF(VS2010_BINX64)\cl.exe
|
||||||
*_VS2010_X64_ASLDLINK_PATH = DEF(VS2010_BINX64)\link.exe
|
*_VS2010_X64_ASLDLINK_PATH = DEF(VS2010_BINX64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2010_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /MP
|
DEBUG_VS2010_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7
|
||||||
RELEASE_VS2010_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /MP
|
RELEASE_VS2010_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
|
||||||
NOOPT_VS2010_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2010_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2010_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2010_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2010_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2010_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
@@ -766,7 +772,7 @@ NOOPT_VS2010_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT
|
|||||||
*_VS2010x86_*_APP_FLAGS = /nologo /E /TC
|
*_VS2010x86_*_APP_FLAGS = /nologo /E /TC
|
||||||
*_VS2010x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
*_VS2010x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||||
*_VS2010x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2010x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
|
*_VS2010x86_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
*_VS2010x86_*_ASM16_PATH = DEF(VS2010x86_BIN)\ml.exe
|
*_VS2010x86_*_ASM16_PATH = DEF(VS2010x86_BIN)\ml.exe
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -797,9 +803,9 @@ NOOPT_VS2010_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT
|
|||||||
*_VS2010x86_IA32_ASM_PATH = DEF(VS2010x86_BIN)\ml.exe
|
*_VS2010x86_IA32_ASM_PATH = DEF(VS2010x86_BIN)\ml.exe
|
||||||
|
|
||||||
*_VS2010x86_IA32_MAKE_FLAGS = /nologo
|
*_VS2010x86_IA32_MAKE_FLAGS = /nologo
|
||||||
DEBUG_VS2010x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /MP
|
DEBUG_VS2010x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7
|
||||||
RELEASE_VS2010x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /MP
|
RELEASE_VS2010x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
|
||||||
NOOPT_VS2010x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
|
NOOPT_VS2010x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2010x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
DEBUG_VS2010x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||||
RELEASE_VS2010x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
RELEASE_VS2010x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||||
@@ -829,9 +835,9 @@ NOOPT_VS2010x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2010x86_X64_DLINK_PATH = DEF(VS2010x86_BINX64)\link.exe
|
*_VS2010x86_X64_DLINK_PATH = DEF(VS2010x86_BINX64)\link.exe
|
||||||
*_VS2010x86_X64_ASLDLINK_PATH = DEF(VS2010x86_BINX64)\link.exe
|
*_VS2010x86_X64_ASLDLINK_PATH = DEF(VS2010x86_BINX64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2010x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /MP
|
DEBUG_VS2010x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7
|
||||||
RELEASE_VS2010x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /MP
|
RELEASE_VS2010x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
|
||||||
NOOPT_VS2010x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2010x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2010x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2010x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2010x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2010x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
@@ -884,7 +890,7 @@ NOOPT_VS2010x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2012_*_APP_FLAGS = /nologo /E /TC
|
*_VS2012_*_APP_FLAGS = /nologo /E /TC
|
||||||
*_VS2012_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
*_VS2012_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||||
*_VS2012_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2012_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
|
*_VS2012_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
*_VS2012_*_ASM16_PATH = DEF(VS2012_BIN)\ml.exe
|
*_VS2012_*_ASM16_PATH = DEF(VS2012_BIN)\ml.exe
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -915,9 +921,9 @@ NOOPT_VS2010x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2012_IA32_ASLDLINK_PATH = DEF(VS2012_BIN)\link.exe
|
*_VS2012_IA32_ASLDLINK_PATH = DEF(VS2012_BIN)\link.exe
|
||||||
|
|
||||||
*_VS2012_IA32_MAKE_FLAGS = /nologo
|
*_VS2012_IA32_MAKE_FLAGS = /nologo
|
||||||
DEBUG_VS2012_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /MP
|
DEBUG_VS2012_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7
|
||||||
RELEASE_VS2012_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /MP
|
RELEASE_VS2012_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
|
||||||
NOOPT_VS2012_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
|
NOOPT_VS2012_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2012_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
DEBUG_VS2012_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||||
RELEASE_VS2012_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
RELEASE_VS2012_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||||
@@ -947,9 +953,9 @@ NOOPT_VS2012_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2012_X64_ASLPP_PATH = DEF(VS2012_BINX64)\cl.exe
|
*_VS2012_X64_ASLPP_PATH = DEF(VS2012_BINX64)\cl.exe
|
||||||
*_VS2012_X64_ASLDLINK_PATH = DEF(VS2012_BINX64)\link.exe
|
*_VS2012_X64_ASLDLINK_PATH = DEF(VS2012_BINX64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2012_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /MP
|
DEBUG_VS2012_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7
|
||||||
RELEASE_VS2012_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /MP
|
RELEASE_VS2012_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
|
||||||
NOOPT_VS2012_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2012_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2012_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2012_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2012_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2012_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
@@ -1000,7 +1006,7 @@ NOOPT_VS2012_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT
|
|||||||
*_VS2012x86_*_APP_FLAGS = /nologo /E /TC
|
*_VS2012x86_*_APP_FLAGS = /nologo /E /TC
|
||||||
*_VS2012x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
*_VS2012x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||||
*_VS2012x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2012x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
|
*_VS2012x86_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
*_VS2012x86_*_ASM16_PATH = DEF(VS2012x86_BIN)\ml.exe
|
*_VS2012x86_*_ASM16_PATH = DEF(VS2012x86_BIN)\ml.exe
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -1031,9 +1037,9 @@ NOOPT_VS2012_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT
|
|||||||
*_VS2012x86_IA32_ASM_PATH = DEF(VS2012x86_BIN)\ml.exe
|
*_VS2012x86_IA32_ASM_PATH = DEF(VS2012x86_BIN)\ml.exe
|
||||||
|
|
||||||
*_VS2012x86_IA32_MAKE_FLAGS = /nologo
|
*_VS2012x86_IA32_MAKE_FLAGS = /nologo
|
||||||
DEBUG_VS2012x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /MP
|
DEBUG_VS2012x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7
|
||||||
RELEASE_VS2012x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /MP
|
RELEASE_VS2012x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
|
||||||
NOOPT_VS2012x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
|
NOOPT_VS2012x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2012x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
DEBUG_VS2012x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||||
RELEASE_VS2012x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
RELEASE_VS2012x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||||
@@ -1063,9 +1069,9 @@ NOOPT_VS2012x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2012x86_X64_DLINK_PATH = DEF(VS2012x86_BINX64)\link.exe
|
*_VS2012x86_X64_DLINK_PATH = DEF(VS2012x86_BINX64)\link.exe
|
||||||
*_VS2012x86_X64_ASLDLINK_PATH = DEF(VS2012x86_BINX64)\link.exe
|
*_VS2012x86_X64_ASLDLINK_PATH = DEF(VS2012x86_BINX64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /MP
|
DEBUG_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7
|
||||||
RELEASE_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /MP
|
RELEASE_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
|
||||||
NOOPT_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2012x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2012x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2012x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2012x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
@@ -1118,7 +1124,7 @@ NOOPT_VS2012x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2013_*_APP_FLAGS = /nologo /E /TC
|
*_VS2013_*_APP_FLAGS = /nologo /E /TC
|
||||||
*_VS2013_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
*_VS2013_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||||
*_VS2013_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2013_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
|
*_VS2013_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
*_VS2013_*_ASM16_PATH = DEF(VS2013_BIN)\ml.exe
|
*_VS2013_*_ASM16_PATH = DEF(VS2013_BIN)\ml.exe
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -1149,9 +1155,9 @@ NOOPT_VS2012x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2013_IA32_ASLDLINK_PATH = DEF(VS2013_BIN)\link.exe
|
*_VS2013_IA32_ASLDLINK_PATH = DEF(VS2013_BIN)\link.exe
|
||||||
|
|
||||||
*_VS2013_IA32_MAKE_FLAGS = /nologo
|
*_VS2013_IA32_MAKE_FLAGS = /nologo
|
||||||
DEBUG_VS2013_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw /MP
|
DEBUG_VS2013_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw
|
||||||
RELEASE_VS2013_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2013_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2013_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
|
NOOPT_VS2013_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2013_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
DEBUG_VS2013_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||||
RELEASE_VS2013_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
RELEASE_VS2013_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||||
@@ -1181,9 +1187,9 @@ NOOPT_VS2013_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2013_X64_ASLPP_PATH = DEF(VS2013_BINX64)\cl.exe
|
*_VS2013_X64_ASLPP_PATH = DEF(VS2013_BINX64)\cl.exe
|
||||||
*_VS2013_X64_ASLDLINK_PATH = DEF(VS2013_BINX64)\link.exe
|
*_VS2013_X64_ASLDLINK_PATH = DEF(VS2013_BINX64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2013_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /MP
|
DEBUG_VS2013_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw
|
||||||
RELEASE_VS2013_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2013_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2013_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2013_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2013_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2013_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2013_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2013_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
@@ -1234,7 +1240,7 @@ NOOPT_VS2013_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT
|
|||||||
*_VS2013x86_*_APP_FLAGS = /nologo /E /TC
|
*_VS2013x86_*_APP_FLAGS = /nologo /E /TC
|
||||||
*_VS2013x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
*_VS2013x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||||
*_VS2013x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2013x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
|
*_VS2013x86_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
*_VS2013x86_*_ASM16_PATH = DEF(VS2013x86_BIN)\ml.exe
|
*_VS2013x86_*_ASM16_PATH = DEF(VS2013x86_BIN)\ml.exe
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -1265,9 +1271,9 @@ NOOPT_VS2013_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT
|
|||||||
*_VS2013x86_IA32_ASM_PATH = DEF(VS2013x86_BIN)\ml.exe
|
*_VS2013x86_IA32_ASM_PATH = DEF(VS2013x86_BIN)\ml.exe
|
||||||
|
|
||||||
*_VS2013x86_IA32_MAKE_FLAGS = /nologo
|
*_VS2013x86_IA32_MAKE_FLAGS = /nologo
|
||||||
DEBUG_VS2013x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw /MP
|
DEBUG_VS2013x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw
|
||||||
RELEASE_VS2013x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2013x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2013x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
|
NOOPT_VS2013x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2013x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
DEBUG_VS2013x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||||
RELEASE_VS2013x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
RELEASE_VS2013x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||||
@@ -1297,9 +1303,9 @@ NOOPT_VS2013x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2013x86_X64_DLINK_PATH = DEF(VS2013x86_BINX64)\link.exe
|
*_VS2013x86_X64_DLINK_PATH = DEF(VS2013x86_BINX64)\link.exe
|
||||||
*_VS2013x86_X64_ASLDLINK_PATH = DEF(VS2013x86_BINX64)\link.exe
|
*_VS2013x86_X64_ASLDLINK_PATH = DEF(VS2013x86_BINX64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2013x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /MP
|
DEBUG_VS2013x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw
|
||||||
RELEASE_VS2013x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2013x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2013x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2013x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2013x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2013x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2013x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2013x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
@@ -1353,7 +1359,7 @@ NOOPT_VS2013x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2015_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
*_VS2015_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||||
*_VS2015_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2015_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
*_VS2015_*_DLINK2_FLAGS =
|
*_VS2015_*_DLINK2_FLAGS =
|
||||||
|
*_VS2015_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
*_VS2015_*_ASM16_PATH = DEF(VS2015_BIN)\ml.exe
|
*_VS2015_*_ASM16_PATH = DEF(VS2015_BIN)\ml.exe
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -1384,9 +1390,9 @@ NOOPT_VS2013x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2015_IA32_ASLDLINK_PATH = DEF(VS2015_BIN)\link.exe
|
*_VS2015_IA32_ASLDLINK_PATH = DEF(VS2015_BIN)\link.exe
|
||||||
|
|
||||||
*_VS2015_IA32_MAKE_FLAGS = /nologo
|
*_VS2015_IA32_MAKE_FLAGS = /nologo
|
||||||
DEBUG_VS2015_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw /MP
|
DEBUG_VS2015_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw
|
||||||
RELEASE_VS2015_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2015_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2015_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
|
NOOPT_VS2015_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2015_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
DEBUG_VS2015_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||||
RELEASE_VS2015_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
RELEASE_VS2015_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||||
@@ -1416,9 +1422,9 @@ NOOPT_VS2015_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2015_X64_ASLPP_PATH = DEF(VS2015_BINX64)\cl.exe
|
*_VS2015_X64_ASLPP_PATH = DEF(VS2015_BINX64)\cl.exe
|
||||||
*_VS2015_X64_ASLDLINK_PATH = DEF(VS2015_BINX64)\link.exe
|
*_VS2015_X64_ASLDLINK_PATH = DEF(VS2015_BINX64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2015_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /MP
|
DEBUG_VS2015_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw
|
||||||
RELEASE_VS2015_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2015_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2015_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2015_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2015_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2015_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2015_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2015_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
@@ -1470,7 +1476,7 @@ NOOPT_VS2015_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT
|
|||||||
*_VS2015x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
*_VS2015x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
|
||||||
*_VS2015x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2015x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
*_VS2015x86_*_DLINK2_FLAGS =
|
*_VS2015x86_*_DLINK2_FLAGS =
|
||||||
|
*_VS2015x86_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
*_VS2015x86_*_ASM16_PATH = DEF(VS2015x86_BIN)\ml.exe
|
*_VS2015x86_*_ASM16_PATH = DEF(VS2015x86_BIN)\ml.exe
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -1501,9 +1507,9 @@ NOOPT_VS2015_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT
|
|||||||
*_VS2015x86_IA32_ASM_PATH = DEF(VS2015x86_BIN)\ml.exe
|
*_VS2015x86_IA32_ASM_PATH = DEF(VS2015x86_BIN)\ml.exe
|
||||||
|
|
||||||
*_VS2015x86_IA32_MAKE_FLAGS = /nologo
|
*_VS2015x86_IA32_MAKE_FLAGS = /nologo
|
||||||
DEBUG_VS2015x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw /MP
|
DEBUG_VS2015x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw
|
||||||
RELEASE_VS2015x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2015x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2015x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
|
NOOPT_VS2015x86_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2015x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
DEBUG_VS2015x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||||
RELEASE_VS2015x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
RELEASE_VS2015x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||||
@@ -1533,9 +1539,9 @@ NOOPT_VS2015x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2015x86_X64_DLINK_PATH = DEF(VS2015x86_BINX64)\link.exe
|
*_VS2015x86_X64_DLINK_PATH = DEF(VS2015x86_BINX64)\link.exe
|
||||||
*_VS2015x86_X64_ASLDLINK_PATH = DEF(VS2015x86_BINX64)\link.exe
|
*_VS2015x86_X64_ASLDLINK_PATH = DEF(VS2015x86_BINX64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2015x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /MP
|
DEBUG_VS2015x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw
|
||||||
RELEASE_VS2015x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2015x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2015x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2015x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2015x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2015x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2015x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2015x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
@@ -1589,7 +1595,7 @@ NOOPT_VS2015x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2017_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2017_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
*_VS2017_*_DLINK2_FLAGS = /WHOLEARCHIVE
|
*_VS2017_*_DLINK2_FLAGS = /WHOLEARCHIVE
|
||||||
*_VS2017_*_ASM16_PATH = DEF(VS2017_BIN_IA32)\ml.exe
|
*_VS2017_*_ASM16_PATH = DEF(VS2017_BIN_IA32)\ml.exe
|
||||||
|
*_VS2017_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
##################
|
##################
|
||||||
# ASL definitions
|
# ASL definitions
|
||||||
##################
|
##################
|
||||||
@@ -1615,9 +1621,9 @@ NOOPT_VS2015x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2017_IA32_ASM_PATH = DEF(VS2017_BIN_IA32)\ml.exe
|
*_VS2017_IA32_ASM_PATH = DEF(VS2017_BIN_IA32)\ml.exe
|
||||||
|
|
||||||
*_VS2017_IA32_MAKE_FLAGS = /nologo
|
*_VS2017_IA32_MAKE_FLAGS = /nologo
|
||||||
DEBUG_VS2017_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw /MP
|
DEBUG_VS2017_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw
|
||||||
RELEASE_VS2017_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2017_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2017_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
|
NOOPT_VS2017_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2017_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
DEBUG_VS2017_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||||
RELEASE_VS2017_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
RELEASE_VS2017_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||||
@@ -1645,9 +1651,9 @@ NOOPT_VS2017_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /O
|
|||||||
*_VS2017_X64_DLINK_PATH = DEF(VS2017_BIN_X64)\link.exe
|
*_VS2017_X64_DLINK_PATH = DEF(VS2017_BIN_X64)\link.exe
|
||||||
*_VS2017_X64_ASLDLINK_PATH = DEF(VS2017_BIN_X64)\link.exe
|
*_VS2017_X64_ASLDLINK_PATH = DEF(VS2017_BIN_X64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2017_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /MP
|
DEBUG_VS2017_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw
|
||||||
RELEASE_VS2017_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2017_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2017_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2017_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2017_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2017_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2017_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2017_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
@@ -1752,7 +1758,7 @@ NOOPT_VS2017_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2019_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
*_VS2019_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
|
||||||
*_VS2019_*_DLINK2_FLAGS = /WHOLEARCHIVE
|
*_VS2019_*_DLINK2_FLAGS = /WHOLEARCHIVE
|
||||||
*_VS2019_*_ASM16_PATH = DEF(VS2019_BIN_IA32)\ml.exe
|
*_VS2019_*_ASM16_PATH = DEF(VS2019_BIN_IA32)\ml.exe
|
||||||
|
*_VS2019_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
|
||||||
##################
|
##################
|
||||||
# ASL definitions
|
# ASL definitions
|
||||||
##################
|
##################
|
||||||
@@ -1778,9 +1784,9 @@ NOOPT_VS2017_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
|
|||||||
*_VS2019_IA32_ASM_PATH = DEF(VS2019_BIN_IA32)\ml.exe
|
*_VS2019_IA32_ASM_PATH = DEF(VS2019_BIN_IA32)\ml.exe
|
||||||
|
|
||||||
*_VS2019_IA32_MAKE_FLAGS = /nologo
|
*_VS2019_IA32_MAKE_FLAGS = /nologo
|
||||||
DEBUG_VS2019_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw /MP
|
DEBUG_VS2019_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw
|
||||||
RELEASE_VS2019_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2019_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2019_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
|
NOOPT_VS2019_IA32_CC_FLAGS = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2019_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
DEBUG_VS2019_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
|
||||||
RELEASE_VS2019_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
RELEASE_VS2019_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
|
||||||
@@ -1808,9 +1814,9 @@ NOOPT_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /O
|
|||||||
*_VS2019_X64_DLINK_PATH = DEF(VS2019_BIN_X64)\link.exe
|
*_VS2019_X64_DLINK_PATH = DEF(VS2019_BIN_X64)\link.exe
|
||||||
*_VS2019_X64_ASLDLINK_PATH = DEF(VS2019_BIN_X64)\link.exe
|
*_VS2019_X64_ASLDLINK_PATH = DEF(VS2019_BIN_X64)\link.exe
|
||||||
|
|
||||||
DEBUG_VS2019_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /MP
|
DEBUG_VS2019_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw
|
||||||
RELEASE_VS2019_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
|
RELEASE_VS2019_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw
|
||||||
NOOPT_VS2019_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
|
NOOPT_VS2019_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od
|
||||||
|
|
||||||
DEBUG_VS2019_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
DEBUG_VS2019_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
|
||||||
RELEASE_VS2019_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
RELEASE_VS2019_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
|
||||||
@@ -1941,6 +1947,9 @@ DEFINE GCC_X64_RC_FLAGS = -I binary -O elf64-x86-64 -B i386
|
|||||||
DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm --rename-section .data=.hii
|
DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm --rename-section .data=.hii
|
||||||
DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
|
DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
|
||||||
|
|
||||||
|
# GCC Build Flag for included header file list generation
|
||||||
|
DEFINE GCC_DEPS_FLAGS = -MMD -MF $@.deps
|
||||||
|
|
||||||
DEFINE GCC48_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
|
DEFINE GCC48_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
|
||||||
DEFINE GCC48_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20
|
DEFINE GCC48_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20
|
||||||
DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address
|
DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address
|
||||||
@@ -1965,7 +1974,7 @@ DEFINE GCC48_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_ASLDLINK_FLAGS) -Wl,--oformat
|
|||||||
DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_ASLDLINK_FLAGS)
|
DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_ASLDLINK_FLAGS)
|
||||||
DEFINE GCC48_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
|
DEFINE GCC48_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
|
||||||
|
|
||||||
DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS)
|
DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -fno-pic -fno-pie
|
||||||
DEFINE GCC49_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS)
|
DEFINE GCC49_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS)
|
||||||
DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40
|
DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40
|
||||||
DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0 DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
|
DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0 DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
|
||||||
@@ -1988,7 +1997,7 @@ DEFINE GCC49_ARM_ASLDLINK_FLAGS = DEF(GCC48_ARM_ASLDLINK_FLAGS)
|
|||||||
DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = DEF(GCC48_AARCH64_ASLDLINK_FLAGS)
|
DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = DEF(GCC48_AARCH64_ASLDLINK_FLAGS)
|
||||||
DEFINE GCC49_ASLCC_FLAGS = DEF(GCC48_ASLCC_FLAGS)
|
DEFINE GCC49_ASLCC_FLAGS = DEF(GCC48_ASLCC_FLAGS)
|
||||||
|
|
||||||
DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -fno-pic -fno-pie
|
DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS)
|
||||||
DEFINE GCC5_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS)
|
DEFINE GCC5_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS)
|
||||||
DEFINE GCC5_IA32_X64_DLINK_COMMON = DEF(GCC49_IA32_X64_DLINK_COMMON)
|
DEFINE GCC5_IA32_X64_DLINK_COMMON = DEF(GCC49_IA32_X64_DLINK_COMMON)
|
||||||
DEFINE GCC5_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_ASLDLINK_FLAGS)
|
DEFINE GCC5_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_ASLDLINK_FLAGS)
|
||||||
@@ -2030,6 +2039,7 @@ DEFINE GCC5_ASLCC_FLAGS = DEF(GCC49_ASLCC_FLAGS) -fno-lto
|
|||||||
*_GCC48_*_APP_FLAGS =
|
*_GCC48_*_APP_FLAGS =
|
||||||
*_GCC48_*_ASL_FLAGS = DEF(IASL_FLAGS)
|
*_GCC48_*_ASL_FLAGS = DEF(IASL_FLAGS)
|
||||||
*_GCC48_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
*_GCC48_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
||||||
|
*_GCC48_*_DEPS_FLAGS = DEF(GCC_DEPS_FLAGS)
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# GCC48 IA32 definitions
|
# GCC48 IA32 definitions
|
||||||
@@ -2169,6 +2179,7 @@ RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s
|
|||||||
*_GCC49_*_APP_FLAGS =
|
*_GCC49_*_APP_FLAGS =
|
||||||
*_GCC49_*_ASL_FLAGS = DEF(IASL_FLAGS)
|
*_GCC49_*_ASL_FLAGS = DEF(IASL_FLAGS)
|
||||||
*_GCC49_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
*_GCC49_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
||||||
|
*_GCC49_*_DEPS_FLAGS = DEF(GCC_DEPS_FLAGS)
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# GCC49 IA32 definitions
|
# GCC49 IA32 definitions
|
||||||
@@ -2315,6 +2326,7 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
|
|||||||
*_GCC5_*_APP_FLAGS =
|
*_GCC5_*_APP_FLAGS =
|
||||||
*_GCC5_*_ASL_FLAGS = DEF(IASL_FLAGS)
|
*_GCC5_*_ASL_FLAGS = DEF(IASL_FLAGS)
|
||||||
*_GCC5_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
*_GCC5_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
||||||
|
*_GCC5_*_DEPS_FLAGS = DEF(GCC_DEPS_FLAGS)
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# GCC5 IA32 definitions
|
# GCC5 IA32 definitions
|
||||||
@@ -2480,6 +2492,7 @@ RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
|
|||||||
*_CLANG35_*_ASLPP_PATH = ENV(CLANG35_BIN)clang
|
*_CLANG35_*_ASLPP_PATH = ENV(CLANG35_BIN)clang
|
||||||
*_CLANG35_*_DLINK_PATH = ENV(CLANG35_BIN)clang
|
*_CLANG35_*_DLINK_PATH = ENV(CLANG35_BIN)clang
|
||||||
*_CLANG35_*_ASLDLINK_PATH = ENV(CLANG35_BIN)clang
|
*_CLANG35_*_ASLDLINK_PATH = ENV(CLANG35_BIN)clang
|
||||||
|
*_CLANG35_*_DEPS_FLAGS = DEF(GCC_DEPS_FLAGS)
|
||||||
|
|
||||||
DEFINE CLANG35_ARM_TARGET = -target arm-linux-gnueabi
|
DEFINE CLANG35_ARM_TARGET = -target arm-linux-gnueabi
|
||||||
DEFINE CLANG35_AARCH64_TARGET = -target aarch64-linux-gnu
|
DEFINE CLANG35_AARCH64_TARGET = -target aarch64-linux-gnu
|
||||||
@@ -2547,7 +2560,7 @@ RELEASE_CLANG35_AARCH64_CC_FLAGS = DEF(CLANG35_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS)
|
|||||||
*_CLANG38_*_APP_FLAGS =
|
*_CLANG38_*_APP_FLAGS =
|
||||||
*_CLANG38_*_ASL_FLAGS = DEF(IASL_FLAGS)
|
*_CLANG38_*_ASL_FLAGS = DEF(IASL_FLAGS)
|
||||||
*_CLANG38_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
*_CLANG38_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
||||||
|
*_CLANG38_*_DEPS_FLAGS = DEF(GCC_DEPS_FLAGS)
|
||||||
DEFINE CLANG38_IA32_PREFIX = ENV(CLANG38_BIN)
|
DEFINE CLANG38_IA32_PREFIX = ENV(CLANG38_BIN)
|
||||||
DEFINE CLANG38_X64_PREFIX = ENV(CLANG38_BIN)
|
DEFINE CLANG38_X64_PREFIX = ENV(CLANG38_BIN)
|
||||||
|
|
||||||
@@ -2737,15 +2750,16 @@ RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl
|
|||||||
*_CLANGPDB_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
|
*_CLANGPDB_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
|
||||||
*_CLANGPDB_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
|
*_CLANGPDB_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
|
||||||
*_CLANGPDB_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
|
*_CLANGPDB_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
|
||||||
|
*_CLANGPDB_*_DEPS_FLAGS = DEF(GCC_DEPS_FLAGS)
|
||||||
|
|
||||||
DEFINE CLANGPDB_IA32_PREFIX = ENV(CLANG_BIN)
|
DEFINE CLANGPDB_IA32_PREFIX = ENV(CLANG_BIN)
|
||||||
DEFINE CLANGPDB_X64_PREFIX = ENV(CLANG_BIN)
|
DEFINE CLANGPDB_X64_PREFIX = ENV(CLANG_BIN)
|
||||||
|
|
||||||
DEFINE CLANGPDB_IA32_TARGET = -target i686-unknown-windows
|
DEFINE CLANGPDB_IA32_TARGET = -target i686-unknown-windows-gnu
|
||||||
DEFINE CLANGPDB_X64_TARGET = -target x86_64-unknown-windows
|
DEFINE CLANGPDB_X64_TARGET = -target x86_64-unknown-windows-gnu
|
||||||
|
|
||||||
DEFINE CLANGPDB_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -Wno-microsoft-enum-forward-reference
|
DEFINE CLANGPDB_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -Wno-microsoft-enum-forward-reference
|
||||||
DEFINE CLANGPDB_ALL_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) DEF(CLANGPDB_WARNING_OVERRIDES) -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -fno-asynchronous-unwind-tables -mno-implicit-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -funsigned-char -fno-ms-extensions -Wno-null-dereference -fms-compatibility -mno-stack-arg-probe
|
DEFINE CLANGPDB_ALL_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) DEF(CLANGPDB_WARNING_OVERRIDES) -fno-stack-protector -funsigned-char -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -Wno-null-dereference -mno-implicit-float -mms-bitfields -mno-stack-arg-probe -nostdlib -nostdlibinc
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# CLANGPDB IA32 definitions
|
# CLANGPDB IA32 definitions
|
||||||
@@ -2803,18 +2817,20 @@ NOOPT_CLANGPDB_IA32_DLINK2_FLAGS =
|
|||||||
*_CLANGPDB_X64_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) DEF(CLANGPDB_X64_TARGET)
|
*_CLANGPDB_X64_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) DEF(CLANGPDB_X64_TARGET)
|
||||||
*_CLANGPDB_X64_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS) DEF(CLANGPDB_X64_TARGET)
|
*_CLANGPDB_X64_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS) DEF(CLANGPDB_X64_TARGET)
|
||||||
|
|
||||||
DEBUG_CLANGPDB_X64_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -Oz -flto DEF(CLANGPDB_X64_TARGET) -gcodeview
|
DEBUG_CLANGPDB_X64_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -Oz -flto DEF(CLANGPDB_X64_TARGET) -gcodeview -funwind-tables
|
||||||
DEBUG_CLANGPDB_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DEBUG:GHASH /lldmap
|
DEBUG_CLANGPDB_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /Machine:X64 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DEBUG:GHASH /lldmap
|
||||||
DEBUG_CLANGPDB_X64_DLINK2_FLAGS =
|
DEBUG_CLANGPDB_X64_DLINK2_FLAGS =
|
||||||
|
DEBUG_CLANGPDB_X64_GENFW_FLAGS = --keepexceptiontable
|
||||||
|
|
||||||
RELEASE_CLANGPDB_X64_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -Oz -flto DEF(CLANGPDB_X64_TARGET)
|
RELEASE_CLANGPDB_X64_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -Oz -flto DEF(CLANGPDB_X64_TARGET) -fno-unwind-tables
|
||||||
RELEASE_CLANGPDB_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /MERGE:.rdata=.data /lldmap
|
RELEASE_CLANGPDB_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /MERGE:.rdata=.data /lldmap
|
||||||
RELEASE_CLANGPDB_X64_DLINK2_FLAGS =
|
RELEASE_CLANGPDB_X64_DLINK2_FLAGS =
|
||||||
|
RELEASE_CLANGPDB_X64_GENFW_FLAGS =
|
||||||
|
|
||||||
NOOPT_CLANGPDB_X64_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -O0 DEF(CLANGPDB_X64_TARGET) -gcodeview
|
NOOPT_CLANGPDB_X64_CC_FLAGS = DEF(CLANGPDB_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -mno-red-zone -mcmodel=small -O0 DEF(CLANGPDB_X64_TARGET) -gcodeview -funwind-tables
|
||||||
NOOPT_CLANGPDB_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DEBUG:GHASH /lldmap
|
NOOPT_CLANGPDB_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /ALIGN:32 /FILEALIGN:32 /Machine:X64 /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DEBUG:GHASH /lldmap
|
||||||
NOOPT_CLANGPDB_X64_DLINK2_FLAGS =
|
NOOPT_CLANGPDB_X64_DLINK2_FLAGS =
|
||||||
|
NOOPT_CLANGPDB_X64_GENFW_FLAGS = --keepexceptiontable
|
||||||
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@@ -2840,6 +2856,7 @@ NOOPT_CLANGPDB_X64_DLINK2_FLAGS =
|
|||||||
*_XCODE5_*_ASLDLINK_PATH = ld
|
*_XCODE5_*_ASLDLINK_PATH = ld
|
||||||
*_XCODE5_*_DSYMUTIL_PATH = /usr/bin/dsymutil
|
*_XCODE5_*_DSYMUTIL_PATH = /usr/bin/dsymutil
|
||||||
*_XCODE5_*_MTOC_PATH = /usr/local/bin/mtoc
|
*_XCODE5_*_MTOC_PATH = /usr/local/bin/mtoc
|
||||||
|
*_XCODE5_*_DEPS_FLAGS = DEF(GCC_DEPS_FLAGS)
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# ASL definitions
|
# ASL definitions
|
||||||
|
@@ -0,0 +1,115 @@
|
|||||||
|
# @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 xml.etree.ElementTree
|
||||||
|
from edk2toolext.environment.plugintypes.uefi_build_plugin import IUefiBuildPlugin
|
||||||
|
from edk2toolext import edk2_logging
|
||||||
|
import edk2toollib.windows.locate_tools as locate_tools
|
||||||
|
from edk2toolext.environment import shell_environment
|
||||||
|
from edk2toollib.utility_functions import RunCmd
|
||||||
|
|
||||||
|
|
||||||
|
class HostBasedUnitTestRunner(IUefiBuildPlugin):
|
||||||
|
|
||||||
|
def do_pre_build(self, thebuilder):
|
||||||
|
'''
|
||||||
|
Works with the compiler (either the HostBasedCompilerPlugin or an other Builder) to set
|
||||||
|
up the environment that will be needed to build host-based unit tests.
|
||||||
|
|
||||||
|
EXPECTS:
|
||||||
|
- Build Var 'CI_BUILD_TYPE' - If not set to 'host_unit_test', will not do anything.
|
||||||
|
|
||||||
|
UPDATES:
|
||||||
|
- Shell Var (Several) - Updates the shell with all vars listed in interesting_keys.
|
||||||
|
- Shell Path - Updated from QueryVcVariables()
|
||||||
|
- Shell Var 'CMOCKA_MESSAGE_OUTPUT'
|
||||||
|
'''
|
||||||
|
ci_type = thebuilder.env.GetValue('CI_BUILD_TYPE')
|
||||||
|
if ci_type != 'host_unit_test':
|
||||||
|
return 0
|
||||||
|
|
||||||
|
shell_env = shell_environment.GetEnvironment()
|
||||||
|
# Use the tools lib to determine the correct values for the vars that interest us.
|
||||||
|
interesting_keys = ["ExtensionSdkDir", "INCLUDE", "LIB", "LIBPATH", "UniversalCRTSdkDir",
|
||||||
|
"UCRTVersion", "WindowsLibPath", "WindowsSdkBinPath", "WindowsSdkDir", "WindowsSdkVerBinPath",
|
||||||
|
"WindowsSDKVersion", "VCToolsInstallDir"]
|
||||||
|
vs_vars = locate_tools.QueryVcVariables(interesting_keys, "amd64")
|
||||||
|
for (k, v) in vs_vars.items():
|
||||||
|
if k.upper() == "PATH":
|
||||||
|
shell_env.append_path(v)
|
||||||
|
else:
|
||||||
|
shell_env.set_shell_var(k, v)
|
||||||
|
|
||||||
|
# Set up the reporting type for Cmocka.
|
||||||
|
shell_env.set_shell_var('CMOCKA_MESSAGE_OUTPUT', 'xml')
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def do_post_build(self, thebuilder):
|
||||||
|
'''
|
||||||
|
After a build, will automatically locate and run all host-based unit tests. Logs any
|
||||||
|
failures with Warning severity and will return a count of the failures as the return code.
|
||||||
|
|
||||||
|
EXPECTS:
|
||||||
|
- Build Var 'CI_BUILD_TYPE' - If not set to 'host_unit_test', will not do anything.
|
||||||
|
|
||||||
|
UPDATES:
|
||||||
|
- Shell Var 'CMOCKA_XML_FILE'
|
||||||
|
'''
|
||||||
|
ci_type = thebuilder.env.GetValue('CI_BUILD_TYPE')
|
||||||
|
if ci_type != 'host_unit_test':
|
||||||
|
return 0
|
||||||
|
|
||||||
|
shell_env = shell_environment.GetEnvironment()
|
||||||
|
logging.log(edk2_logging.get_section_level(),
|
||||||
|
"Run Host based Unit Tests")
|
||||||
|
path = thebuilder.env.GetValue("BUILD_OUTPUT_BASE")
|
||||||
|
|
||||||
|
failure_count = 0
|
||||||
|
|
||||||
|
for arch in thebuilder.env.GetValue("TARGET_ARCH").split():
|
||||||
|
logging.log(edk2_logging.get_subsection_level(),
|
||||||
|
"Testing for architecture: " + arch)
|
||||||
|
cp = os.path.join(path, arch)
|
||||||
|
|
||||||
|
# If any old results XML files exist, clean them up.
|
||||||
|
for old_result in glob.iglob(os.path.join(cp, "*.result.xml")):
|
||||||
|
os.remove(old_result)
|
||||||
|
|
||||||
|
# Determine whether any tests exist.
|
||||||
|
testList = glob.glob(os.path.join(cp, "*Test*.exe"))
|
||||||
|
for test in testList:
|
||||||
|
# Configure output name.
|
||||||
|
shell_env.set_shell_var(
|
||||||
|
'CMOCKA_XML_FILE', test + ".%g." + arch + ".result.xml")
|
||||||
|
|
||||||
|
# Run the test.
|
||||||
|
ret = RunCmd('"' + test + '"', "", workingdir=cp)
|
||||||
|
if(ret != 0):
|
||||||
|
logging.error("UnitTest Execution Error: " +
|
||||||
|
os.path.basename(test))
|
||||||
|
else:
|
||||||
|
logging.info("UnitTest Completed: " +
|
||||||
|
os.path.basename(test))
|
||||||
|
file_match_pattern = test + ".*." + arch + ".result.xml"
|
||||||
|
xml_results_list = glob.glob(file_match_pattern)
|
||||||
|
for xml_result_file in xml_results_list:
|
||||||
|
root = xml.etree.ElementTree.parse(
|
||||||
|
xml_result_file).getroot()
|
||||||
|
for suite in root:
|
||||||
|
for case in suite:
|
||||||
|
for result in case:
|
||||||
|
if result.tag == 'failure':
|
||||||
|
logging.warning(
|
||||||
|
"%s Test Failed" % os.path.basename(test))
|
||||||
|
logging.warning(
|
||||||
|
" %s - %s" % (case.attrib['name'], result.text))
|
||||||
|
failure_count += 1
|
||||||
|
|
||||||
|
return failure_count
|
@@ -0,0 +1,12 @@
|
|||||||
|
##
|
||||||
|
# IUefiBuildPlugin used to run any unittests that
|
||||||
|
# were built on this build.
|
||||||
|
#
|
||||||
|
# Copyright (c) Microsoft Corporation.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
##
|
||||||
|
{
|
||||||
|
"scope": "host-test-win",
|
||||||
|
"name": "Windows Host-Based Unit Test Runner",
|
||||||
|
"module": "HostBasedUnitTestRunner"
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
## @file WindowsVsToolChain.py
|
# @file WindowsVsToolChain.py
|
||||||
# Plugin to configures paths for the VS2017 and VS2019 tool chain
|
# Plugin to configures paths for the VS2017 and VS2019 tool chain
|
||||||
##
|
##
|
||||||
# This plugin works in conjuncture with the tools_def
|
# This plugin works in conjuncture with the tools_def
|
||||||
@@ -14,6 +14,7 @@ from edk2toollib.windows.locate_tools import FindWithVsWhere
|
|||||||
from edk2toolext.environment import shell_environment
|
from edk2toolext.environment import shell_environment
|
||||||
from edk2toolext.environment import version_aggregator
|
from edk2toolext.environment import version_aggregator
|
||||||
|
|
||||||
|
|
||||||
class WindowsVsToolChain(IUefiBuildPlugin):
|
class WindowsVsToolChain(IUefiBuildPlugin):
|
||||||
|
|
||||||
def do_post_build(self, thebuilder):
|
def do_post_build(self, thebuilder):
|
||||||
@@ -21,13 +22,16 @@ class WindowsVsToolChain(IUefiBuildPlugin):
|
|||||||
|
|
||||||
def do_pre_build(self, thebuilder):
|
def do_pre_build(self, thebuilder):
|
||||||
self.Logger = logging.getLogger("WindowsVsToolChain")
|
self.Logger = logging.getLogger("WindowsVsToolChain")
|
||||||
|
interesting_keys = ["ExtensionSdkDir", "INCLUDE", "LIB", "LIBPATH", "UniversalCRTSdkDir",
|
||||||
|
"UCRTVersion", "WindowsLibPath", "WindowsSdkBinPath", "WindowsSdkDir", "WindowsSdkVerBinPath",
|
||||||
|
"WindowsSDKVersion", "VCToolsInstallDir", "Path"]
|
||||||
|
|
||||||
#
|
#
|
||||||
# VS2017 - Follow VS2017 where there is potential for many versions of the tools.
|
# VS2017 - Follow VS2017 where there is potential for many versions of the tools.
|
||||||
# If a specific version is required then the user must set both env variables:
|
# If a specific version is required then the user must set both env variables:
|
||||||
## VS150INSTALLPATH: base install path on system to VC install dir. Here you will find the VC folder, etc
|
# VS150INSTALLPATH: base install path on system to VC install dir. Here you will find the VC folder, etc
|
||||||
## VS150TOOLVER: version number for the VC compiler tools
|
# VS150TOOLVER: version number for the VC compiler tools
|
||||||
## VS2017_PREFIX: path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
|
# VS2017_PREFIX: path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
|
||||||
if thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2017":
|
if thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2017":
|
||||||
|
|
||||||
# check to see if full path already configured
|
# check to see if full path already configured
|
||||||
@@ -35,11 +39,13 @@ class WindowsVsToolChain(IUefiBuildPlugin):
|
|||||||
self.Logger.info("VS2017_PREFIX is already set.")
|
self.Logger.info("VS2017_PREFIX is already set.")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
install_path = self._get_vs_install_path("VS2017".lower(), "VS150INSTALLPATH")
|
install_path = self._get_vs_install_path(
|
||||||
|
"VS2017".lower(), "VS150INSTALLPATH")
|
||||||
vc_ver = self._get_vc_version(install_path, "VS150TOOLVER")
|
vc_ver = self._get_vc_version(install_path, "VS150TOOLVER")
|
||||||
|
|
||||||
if install_path is None or vc_ver is None:
|
if install_path is None or vc_ver is None:
|
||||||
self.Logger.error("Failed to configure environment for VS2017")
|
self.Logger.error(
|
||||||
|
"Failed to configure environment for VS2017")
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
version_aggregator.GetVersionAggregator().ReportVersion(
|
version_aggregator.GetVersionAggregator().ReportVersion(
|
||||||
@@ -48,10 +54,21 @@ class WindowsVsToolChain(IUefiBuildPlugin):
|
|||||||
"VC Version", vc_ver, version_aggregator.VersionTypes.TOOL)
|
"VC Version", vc_ver, version_aggregator.VersionTypes.TOOL)
|
||||||
|
|
||||||
# make VS2017_PREFIX to align with tools_def.txt
|
# make VS2017_PREFIX to align with tools_def.txt
|
||||||
prefix = os.path.join(install_path, "VC", "Tools", "MSVC", vc_ver)
|
prefix = os.path.join(install_path, "VC",
|
||||||
|
"Tools", "MSVC", vc_ver)
|
||||||
prefix = prefix + os.path.sep
|
prefix = prefix + os.path.sep
|
||||||
shell_environment.GetEnvironment().set_shell_var("VS2017_PREFIX", prefix)
|
shell_environment.GetEnvironment().set_shell_var("VS2017_PREFIX", prefix)
|
||||||
|
|
||||||
|
shell_env = shell_environment.GetEnvironment()
|
||||||
|
# Use the tools lib to determine the correct values for the vars that interest us.
|
||||||
|
vs_vars = locate_tools.QueryVcVariables(
|
||||||
|
interesting_keys, "amd64", vs_version="vs2017")
|
||||||
|
for (k, v) in vs_vars.items():
|
||||||
|
if k.upper() == "PATH":
|
||||||
|
shell_env.insert_path(v)
|
||||||
|
else:
|
||||||
|
shell_env.set_shell_var(k, v)
|
||||||
|
|
||||||
# now confirm it exists
|
# now confirm it exists
|
||||||
if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2017_PREFIX")):
|
if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2017_PREFIX")):
|
||||||
self.Logger.error("Path for VS2017 toolchain is invalid")
|
self.Logger.error("Path for VS2017 toolchain is invalid")
|
||||||
@@ -60,9 +77,9 @@ class WindowsVsToolChain(IUefiBuildPlugin):
|
|||||||
#
|
#
|
||||||
# VS2019 - Follow VS2019 where there is potential for many versions of the tools.
|
# VS2019 - Follow VS2019 where there is potential for many versions of the tools.
|
||||||
# If a specific version is required then the user must set both env variables:
|
# If a specific version is required then the user must set both env variables:
|
||||||
## VS160INSTALLPATH: base install path on system to VC install dir. Here you will find the VC folder, etc
|
# VS160INSTALLPATH: base install path on system to VC install dir. Here you will find the VC folder, etc
|
||||||
## VS160TOOLVER: version number for the VC compiler tools
|
# VS160TOOLVER: version number for the VC compiler tools
|
||||||
## VS2019_PREFIX: path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
|
# VS2019_PREFIX: path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
|
||||||
elif thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2019":
|
elif thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2019":
|
||||||
|
|
||||||
# check to see if full path already configured
|
# check to see if full path already configured
|
||||||
@@ -70,11 +87,13 @@ class WindowsVsToolChain(IUefiBuildPlugin):
|
|||||||
self.Logger.info("VS2019_PREFIX is already set.")
|
self.Logger.info("VS2019_PREFIX is already set.")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
install_path = self._get_vs_install_path("VS2019".lower(), "VS160INSTALLPATH")
|
install_path = self._get_vs_install_path(
|
||||||
|
"VS2019".lower(), "VS160INSTALLPATH")
|
||||||
vc_ver = self._get_vc_version(install_path, "VS160TOOLVER")
|
vc_ver = self._get_vc_version(install_path, "VS160TOOLVER")
|
||||||
|
|
||||||
if install_path is None or vc_ver is None:
|
if install_path is None or vc_ver is None:
|
||||||
self.Logger.error("Failed to configure environment for VS2019")
|
self.Logger.error(
|
||||||
|
"Failed to configure environment for VS2019")
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
version_aggregator.GetVersionAggregator().ReportVersion(
|
version_aggregator.GetVersionAggregator().ReportVersion(
|
||||||
@@ -83,10 +102,21 @@ class WindowsVsToolChain(IUefiBuildPlugin):
|
|||||||
"VC Version", vc_ver, version_aggregator.VersionTypes.TOOL)
|
"VC Version", vc_ver, version_aggregator.VersionTypes.TOOL)
|
||||||
|
|
||||||
# make VS2019_PREFIX to align with tools_def.txt
|
# make VS2019_PREFIX to align with tools_def.txt
|
||||||
prefix = os.path.join(install_path, "VC", "Tools", "MSVC", vc_ver)
|
prefix = os.path.join(install_path, "VC",
|
||||||
|
"Tools", "MSVC", vc_ver)
|
||||||
prefix = prefix + os.path.sep
|
prefix = prefix + os.path.sep
|
||||||
shell_environment.GetEnvironment().set_shell_var("VS2019_PREFIX", prefix)
|
shell_environment.GetEnvironment().set_shell_var("VS2019_PREFIX", prefix)
|
||||||
|
|
||||||
|
shell_env = shell_environment.GetEnvironment()
|
||||||
|
# Use the tools lib to determine the correct values for the vars that interest us.
|
||||||
|
vs_vars = locate_tools.QueryVcVariables(
|
||||||
|
interesting_keys, "amd64", vs_version="vs2019")
|
||||||
|
for (k, v) in vs_vars.items():
|
||||||
|
if k.upper() == "PATH":
|
||||||
|
shell_env.insert_path(v)
|
||||||
|
else:
|
||||||
|
shell_env.set_shell_var(k, v)
|
||||||
|
|
||||||
# now confirm it exists
|
# now confirm it exists
|
||||||
if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2019_PREFIX")):
|
if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2019_PREFIX")):
|
||||||
self.Logger.error("Path for VS2019 toolchain is invalid")
|
self.Logger.error("Path for VS2019 toolchain is invalid")
|
||||||
@@ -103,14 +133,16 @@ class WindowsVsToolChain(IUefiBuildPlugin):
|
|||||||
if rc == 0 and path is not None and os.path.exists(path):
|
if rc == 0 and path is not None and os.path.exists(path):
|
||||||
self.Logger.debug("Found VS instance for %s", vs_version)
|
self.Logger.debug("Found VS instance for %s", vs_version)
|
||||||
else:
|
else:
|
||||||
self.Logger.error("Failed to find VS instance with VsWhere (%d)" % rc)
|
self.Logger.error(
|
||||||
|
"Failed to find VS instance with VsWhere (%d)" % rc)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def _get_vc_version(self, path, varname):
|
def _get_vc_version(self, path, varname):
|
||||||
# check if already specified
|
# check if already specified
|
||||||
vc_ver = shell_environment.GetEnvironment().get_shell_var(varname)
|
vc_ver = shell_environment.GetEnvironment().get_shell_var(varname)
|
||||||
if (path is None):
|
if (path is None):
|
||||||
self.Logger.critical("Failed to find Visual Studio tools. Might need to check for VS install")
|
self.Logger.critical(
|
||||||
|
"Failed to find Visual Studio tools. Might need to check for VS install")
|
||||||
return vc_ver
|
return vc_ver
|
||||||
if(vc_ver is None):
|
if(vc_ver is None):
|
||||||
# Not specified...find latest
|
# Not specified...find latest
|
||||||
@@ -122,5 +154,3 @@ class WindowsVsToolChain(IUefiBuildPlugin):
|
|||||||
vc_ver = os.listdir(p2)[-1].strip() # get last in list
|
vc_ver = os.listdir(p2)[-1].strip() # get last in list
|
||||||
self.Logger.debug("Found VC Tool version is %s" % vc_ver)
|
self.Logger.debug("Found VC Tool version is %s" % vc_ver)
|
||||||
return vc_ver
|
return vc_ver
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
## @file
|
## @file
|
||||||
# Check a patch for various format issues
|
# Check a patch for various format issues
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
|
# Copyright (C) 2020, Red Hat, Inc.<BR>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
@@ -22,6 +23,66 @@ class Verbose:
|
|||||||
SILENT, ONELINE, NORMAL = range(3)
|
SILENT, ONELINE, NORMAL = range(3)
|
||||||
level = NORMAL
|
level = NORMAL
|
||||||
|
|
||||||
|
class EmailAddressCheck:
|
||||||
|
"""Checks an email address."""
|
||||||
|
|
||||||
|
def __init__(self, email, description):
|
||||||
|
self.ok = True
|
||||||
|
|
||||||
|
if email is None:
|
||||||
|
self.error('Email address is missing!')
|
||||||
|
return
|
||||||
|
if description is None:
|
||||||
|
self.error('Email description is missing!')
|
||||||
|
return
|
||||||
|
|
||||||
|
self.description = "'" + description + "'"
|
||||||
|
self.check_email_address(email)
|
||||||
|
|
||||||
|
def error(self, *err):
|
||||||
|
if self.ok and Verbose.level > Verbose.ONELINE:
|
||||||
|
print('The ' + self.description + ' email address is not valid:')
|
||||||
|
self.ok = False
|
||||||
|
if Verbose.level < Verbose.NORMAL:
|
||||||
|
return
|
||||||
|
count = 0
|
||||||
|
for line in err:
|
||||||
|
prefix = (' *', ' ')[count > 0]
|
||||||
|
print(prefix, line)
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
email_re1 = re.compile(r'(?:\s*)(.*?)(\s*)<(.+)>\s*$',
|
||||||
|
re.MULTILINE|re.IGNORECASE)
|
||||||
|
|
||||||
|
def check_email_address(self, email):
|
||||||
|
email = email.strip()
|
||||||
|
mo = self.email_re1.match(email)
|
||||||
|
if mo is None:
|
||||||
|
self.error("Email format is invalid: " + email.strip())
|
||||||
|
return
|
||||||
|
|
||||||
|
name = mo.group(1).strip()
|
||||||
|
if name == '':
|
||||||
|
self.error("Name is not provided with email address: " +
|
||||||
|
email)
|
||||||
|
else:
|
||||||
|
quoted = len(name) > 2 and name[0] == '"' and name[-1] == '"'
|
||||||
|
if name.find(',') >= 0 and not quoted:
|
||||||
|
self.error('Add quotes (") around name with a comma: ' +
|
||||||
|
name)
|
||||||
|
|
||||||
|
if mo.group(2) == '':
|
||||||
|
self.error("There should be a space between the name and " +
|
||||||
|
"email address: " + email)
|
||||||
|
|
||||||
|
if mo.group(3).find(' ') >= 0:
|
||||||
|
self.error("The email address cannot contain a space: " +
|
||||||
|
mo.group(3))
|
||||||
|
|
||||||
|
if ' via Groups.Io' in name and mo.group(3).endswith('@groups.io'):
|
||||||
|
self.error("Email rewritten by lists DMARC / DKIM / SPF: " +
|
||||||
|
email)
|
||||||
|
|
||||||
class CommitMessageCheck:
|
class CommitMessageCheck:
|
||||||
"""Checks the contents of a git commit message."""
|
"""Checks the contents of a git commit message."""
|
||||||
|
|
||||||
@@ -35,6 +96,8 @@ class CommitMessageCheck:
|
|||||||
self.subject = subject
|
self.subject = subject
|
||||||
self.msg = message
|
self.msg = message
|
||||||
|
|
||||||
|
print (subject)
|
||||||
|
|
||||||
self.check_contributed_under()
|
self.check_contributed_under()
|
||||||
self.check_signed_off_by()
|
self.check_signed_off_by()
|
||||||
self.check_misc_signatures()
|
self.check_misc_signatures()
|
||||||
@@ -121,38 +184,10 @@ class CommitMessageCheck:
|
|||||||
if s[2] != ' ':
|
if s[2] != ' ':
|
||||||
self.error("There should be a space after '" + sig + ":'")
|
self.error("There should be a space after '" + sig + ":'")
|
||||||
|
|
||||||
self.check_email_address(s[3])
|
EmailAddressCheck(s[3], sig)
|
||||||
|
|
||||||
return sigs
|
return sigs
|
||||||
|
|
||||||
email_re1 = re.compile(r'(?:\s*)(.*?)(\s*)<(.+)>\s*$',
|
|
||||||
re.MULTILINE|re.IGNORECASE)
|
|
||||||
|
|
||||||
def check_email_address(self, email):
|
|
||||||
email = email.strip()
|
|
||||||
mo = self.email_re1.match(email)
|
|
||||||
if mo is None:
|
|
||||||
self.error("Email format is invalid: " + email.strip())
|
|
||||||
return
|
|
||||||
|
|
||||||
name = mo.group(1).strip()
|
|
||||||
if name == '':
|
|
||||||
self.error("Name is not provided with email address: " +
|
|
||||||
email)
|
|
||||||
else:
|
|
||||||
quoted = len(name) > 2 and name[0] == '"' and name[-1] == '"'
|
|
||||||
if name.find(',') >= 0 and not quoted:
|
|
||||||
self.error('Add quotes (") around name with a comma: ' +
|
|
||||||
name)
|
|
||||||
|
|
||||||
if mo.group(2) == '':
|
|
||||||
self.error("There should be a space between the name and " +
|
|
||||||
"email address: " + email)
|
|
||||||
|
|
||||||
if mo.group(3).find(' ') >= 0:
|
|
||||||
self.error("The email address cannot contain a space: " +
|
|
||||||
mo.group(3))
|
|
||||||
|
|
||||||
def check_signed_off_by(self):
|
def check_signed_off_by(self):
|
||||||
sob='Signed-off-by'
|
sob='Signed-off-by'
|
||||||
if self.msg.find(sob) < 0:
|
if self.msg.find(sob) < 0:
|
||||||
@@ -179,6 +214,8 @@ class CommitMessageCheck:
|
|||||||
for sig in self.sig_types:
|
for sig in self.sig_types:
|
||||||
self.find_signatures(sig)
|
self.find_signatures(sig)
|
||||||
|
|
||||||
|
cve_re = re.compile('CVE-[0-9]{4}-[0-9]{5}[^0-9]')
|
||||||
|
|
||||||
def check_overall_format(self):
|
def check_overall_format(self):
|
||||||
lines = self.msg.splitlines()
|
lines = self.msg.splitlines()
|
||||||
|
|
||||||
@@ -196,9 +233,26 @@ class CommitMessageCheck:
|
|||||||
self.error('Empty commit message!')
|
self.error('Empty commit message!')
|
||||||
return
|
return
|
||||||
|
|
||||||
if count >= 1 and len(lines[0]) >= 72:
|
if count >= 1 and re.search(self.cve_re, lines[0]):
|
||||||
self.error('First line of commit message (subject line) ' +
|
#
|
||||||
'is too long.')
|
# If CVE-xxxx-xxxxx is present in subject line, then limit length of
|
||||||
|
# subject line to 92 characters
|
||||||
|
#
|
||||||
|
if len(lines[0].rstrip()) >= 93:
|
||||||
|
self.error(
|
||||||
|
'First line of commit message (subject line) is too long (%d >= 93).' %
|
||||||
|
(len(lines[0].rstrip()))
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
#
|
||||||
|
# If CVE-xxxx-xxxxx is not present in subject line, then limit
|
||||||
|
# length of subject line to 75 characters
|
||||||
|
#
|
||||||
|
if len(lines[0].rstrip()) >= 76:
|
||||||
|
self.error(
|
||||||
|
'First line of commit message (subject line) is too long (%d >= 76).' %
|
||||||
|
(len(lines[0].rstrip()))
|
||||||
|
)
|
||||||
|
|
||||||
if count >= 1 and len(lines[0].strip()) == 0:
|
if count >= 1 and len(lines[0].strip()) == 0:
|
||||||
self.error('First line of commit message (subject line) ' +
|
self.error('First line of commit message (subject line) ' +
|
||||||
@@ -212,7 +266,14 @@ class CommitMessageCheck:
|
|||||||
if (len(lines[i]) >= 76 and
|
if (len(lines[i]) >= 76 and
|
||||||
len(lines[i].split()) > 1 and
|
len(lines[i].split()) > 1 and
|
||||||
not lines[i].startswith('git-svn-id:')):
|
not lines[i].startswith('git-svn-id:')):
|
||||||
self.error('Line %d of commit message is too long.' % (i + 1))
|
#
|
||||||
|
# Print a warning if body line is longer than 75 characters
|
||||||
|
#
|
||||||
|
print(
|
||||||
|
'WARNING - Line %d of commit message is too long (%d >= 76).' %
|
||||||
|
(i + 1, len(lines[i]))
|
||||||
|
)
|
||||||
|
print(lines[i])
|
||||||
|
|
||||||
last_sig_line = None
|
last_sig_line = None
|
||||||
for i in range(count - 1, 0, -1):
|
for i in range(count - 1, 0, -1):
|
||||||
@@ -284,7 +345,21 @@ class GitDiffCheck:
|
|||||||
self.state = PRE_PATCH
|
self.state = PRE_PATCH
|
||||||
self.filename = line[13:].split(' ', 1)[0]
|
self.filename = line[13:].split(' ', 1)[0]
|
||||||
self.is_newfile = False
|
self.is_newfile = False
|
||||||
self.force_crlf = not self.filename.endswith('.sh')
|
self.force_crlf = True
|
||||||
|
self.force_notabs = True
|
||||||
|
if self.filename.endswith('.sh'):
|
||||||
|
#
|
||||||
|
# Do not enforce CR/LF line endings for linux shell scripts.
|
||||||
|
#
|
||||||
|
self.force_crlf = False
|
||||||
|
if self.filename == '.gitmodules':
|
||||||
|
#
|
||||||
|
# .gitmodules is updated by git and uses tabs and LF line
|
||||||
|
# endings. Do not enforce no tabs and do not enforce
|
||||||
|
# CR/LF line endings.
|
||||||
|
#
|
||||||
|
self.force_crlf = False
|
||||||
|
self.force_notabs = False
|
||||||
elif len(line.rstrip()) != 0:
|
elif len(line.rstrip()) != 0:
|
||||||
self.format_error("didn't find diff command")
|
self.format_error("didn't find diff command")
|
||||||
self.line_num += 1
|
self.line_num += 1
|
||||||
@@ -298,6 +373,11 @@ class GitDiffCheck:
|
|||||||
self.binary = True
|
self.binary = True
|
||||||
if self.is_newfile:
|
if self.is_newfile:
|
||||||
self.new_bin.append(self.filename)
|
self.new_bin.append(self.filename)
|
||||||
|
elif line.startswith('new file mode 160000'):
|
||||||
|
#
|
||||||
|
# New submodule. Do not enforce CR/LF line endings
|
||||||
|
#
|
||||||
|
self.force_crlf = False
|
||||||
else:
|
else:
|
||||||
ok = False
|
ok = False
|
||||||
self.is_newfile = self.newfile_prefix_re.match(line)
|
self.is_newfile = self.newfile_prefix_re.match(line)
|
||||||
@@ -372,7 +452,7 @@ class GitDiffCheck:
|
|||||||
if self.force_crlf and eol != '\r\n':
|
if self.force_crlf and eol != '\r\n':
|
||||||
self.added_line_error('Line ending (%s) is not CRLF' % repr(eol),
|
self.added_line_error('Line ending (%s) is not CRLF' % repr(eol),
|
||||||
line)
|
line)
|
||||||
if '\t' in line:
|
if self.force_notabs and '\t' in line:
|
||||||
self.added_line_error('Tab character used', line)
|
self.added_line_error('Tab character used', line)
|
||||||
if len(stripped) < len(line):
|
if len(stripped) < len(line):
|
||||||
self.added_line_error('Trailing whitespace found', line)
|
self.added_line_error('Trailing whitespace found', line)
|
||||||
@@ -422,6 +502,9 @@ class CheckOnePatch:
|
|||||||
self.patch = patch
|
self.patch = patch
|
||||||
self.find_patch_pieces()
|
self.find_patch_pieces()
|
||||||
|
|
||||||
|
email_check = EmailAddressCheck(self.author_email, 'Author')
|
||||||
|
email_ok = email_check.ok
|
||||||
|
|
||||||
msg_check = CommitMessageCheck(self.commit_subject, self.commit_msg)
|
msg_check = CommitMessageCheck(self.commit_subject, self.commit_msg)
|
||||||
msg_ok = msg_check.ok
|
msg_ok = msg_check.ok
|
||||||
|
|
||||||
@@ -430,7 +513,7 @@ class CheckOnePatch:
|
|||||||
diff_check = GitDiffCheck(self.diff)
|
diff_check = GitDiffCheck(self.diff)
|
||||||
diff_ok = diff_check.ok
|
diff_ok = diff_check.ok
|
||||||
|
|
||||||
self.ok = msg_ok and diff_ok
|
self.ok = email_ok and msg_ok and diff_ok
|
||||||
|
|
||||||
if Verbose.level == Verbose.ONELINE:
|
if Verbose.level == Verbose.ONELINE:
|
||||||
if self.ok:
|
if self.ok:
|
||||||
@@ -503,11 +586,30 @@ class CheckOnePatch:
|
|||||||
else:
|
else:
|
||||||
self.stat = mo.group('stat')
|
self.stat = mo.group('stat')
|
||||||
self.commit_msg = mo.group('commit_message')
|
self.commit_msg = mo.group('commit_message')
|
||||||
|
#
|
||||||
|
# Parse subject line from email header. The subject line may be
|
||||||
|
# composed of multiple parts with different encodings. Decode and
|
||||||
|
# combine all the parts to produce a single string with the contents of
|
||||||
|
# the decoded subject line.
|
||||||
|
#
|
||||||
|
parts = email.header.decode_header(pmail.get('subject'))
|
||||||
|
subject = ''
|
||||||
|
for (part, encoding) in parts:
|
||||||
|
if encoding:
|
||||||
|
part = part.decode(encoding)
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
part = part.decode()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
subject = subject + part
|
||||||
|
|
||||||
self.commit_subject = pmail['subject'].replace('\r\n', '')
|
self.commit_subject = subject.replace('\r\n', '')
|
||||||
self.commit_subject = self.commit_subject.replace('\n', '')
|
self.commit_subject = self.commit_subject.replace('\n', '')
|
||||||
self.commit_subject = self.subject_prefix_re.sub('', self.commit_subject, 1)
|
self.commit_subject = self.subject_prefix_re.sub('', self.commit_subject, 1)
|
||||||
|
|
||||||
|
self.author_email = pmail['from']
|
||||||
|
|
||||||
class CheckGitCommits:
|
class CheckGitCommits:
|
||||||
"""Reads patches from git based on the specified git revision range.
|
"""Reads patches from git based on the specified git revision range.
|
||||||
|
|
||||||
@@ -527,6 +629,8 @@ class CheckGitCommits:
|
|||||||
else:
|
else:
|
||||||
blank_line = True
|
blank_line = True
|
||||||
print('Checking git commit:', commit)
|
print('Checking git commit:', commit)
|
||||||
|
email = self.read_committer_email_address_from_git(commit)
|
||||||
|
self.ok &= EmailAddressCheck(email, 'Committer').ok
|
||||||
patch = self.read_patch_from_git(commit)
|
patch = self.read_patch_from_git(commit)
|
||||||
self.ok &= CheckOnePatch(commit, patch).ok
|
self.ok &= CheckOnePatch(commit, patch).ok
|
||||||
if not commits:
|
if not commits:
|
||||||
@@ -543,7 +647,13 @@ class CheckGitCommits:
|
|||||||
|
|
||||||
def read_patch_from_git(self, commit):
|
def read_patch_from_git(self, commit):
|
||||||
# Run git to get the commit patch
|
# Run git to get the commit patch
|
||||||
return self.run_git('show', '--pretty=email', '--no-textconv', commit)
|
return self.run_git('show', '--pretty=email', '--no-textconv',
|
||||||
|
'--no-use-mailmap', commit)
|
||||||
|
|
||||||
|
def read_committer_email_address_from_git(self, commit):
|
||||||
|
# Run git to get the committer email
|
||||||
|
return self.run_git('show', '--pretty=%cn <%ce>', '--no-patch',
|
||||||
|
'--no-use-mailmap', commit)
|
||||||
|
|
||||||
def run_git(self, *args):
|
def run_git(self, *args):
|
||||||
cmd = [ 'git' ]
|
cmd = [ 'git' ]
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
# Set up the git configuration for contributing to TianoCore projects
|
# Set up the git configuration for contributing to TianoCore projects
|
||||||
#
|
#
|
||||||
# Copyright (c) 2019, Linaro Ltd. All rights reserved.<BR>
|
# 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
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
@@ -73,9 +74,11 @@ OPTIONS = [
|
|||||||
{'section': 'format', 'option': 'coverLetter', 'value': True},
|
{'section': 'format', 'option': 'coverLetter', 'value': True},
|
||||||
{'section': 'format', 'option': 'numbered', 'value': True},
|
{'section': 'format', 'option': 'numbered', 'value': True},
|
||||||
{'section': 'format', 'option': 'signoff', 'value': False},
|
{'section': 'format', 'option': 'signoff', 'value': False},
|
||||||
|
{'section': 'log', 'option': 'mailmap', 'value': True},
|
||||||
{'section': 'notes', 'option': 'rewriteRef', 'value': 'refs/notes/commits'},
|
{'section': 'notes', 'option': 'rewriteRef', 'value': 'refs/notes/commits'},
|
||||||
{'section': 'sendemail', 'option': 'chainreplyto', 'value': False},
|
{'section': 'sendemail', 'option': 'chainreplyto', 'value': False},
|
||||||
{'section': 'sendemail', 'option': 'thread', 'value': True},
|
{'section': 'sendemail', 'option': 'thread', 'value': True},
|
||||||
|
{'section': 'sendemail', 'option': 'transferEncoding', 'value': '8bit'},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@@ -28,7 +28,6 @@ OBJECTS = \
|
|||||||
PeCoffLoaderEx.o \
|
PeCoffLoaderEx.o \
|
||||||
SimpleFileParsing.o \
|
SimpleFileParsing.o \
|
||||||
StringFuncs.o \
|
StringFuncs.o \
|
||||||
TianoCompress.o \
|
TianoCompress.o
|
||||||
PcdValueCommon.o
|
|
||||||
|
|
||||||
include $(MAKEROOT)/Makefiles/lib.makefile
|
include $(MAKEROOT)/Makefiles/lib.makefile
|
||||||
|
@@ -28,8 +28,7 @@ OBJECTS = \
|
|||||||
PeCoffLoaderEx.obj \
|
PeCoffLoaderEx.obj \
|
||||||
SimpleFileParsing.obj \
|
SimpleFileParsing.obj \
|
||||||
StringFuncs.obj \
|
StringFuncs.obj \
|
||||||
TianoCompress.obj \
|
TianoCompress.obj
|
||||||
PcdValueCommon.obj
|
|
||||||
|
|
||||||
!INCLUDE ..\Makefiles\ms.lib
|
!INCLUDE ..\Makefiles\ms.lib
|
||||||
|
|
||||||
|
@@ -478,7 +478,7 @@ Returns:
|
|||||||
//
|
//
|
||||||
// Read all of the file contents.
|
// Read all of the file contents.
|
||||||
//
|
//
|
||||||
BytesRead = fread (*FileBuffer, sizeof (UINT8), *FileSize, InputFile);
|
BytesRead = (UINT32)fread (*FileBuffer, sizeof (UINT8), *FileSize, InputFile);
|
||||||
if (BytesRead != *FileSize * sizeof (UINT8)) {
|
if (BytesRead != *FileSize * sizeof (UINT8)) {
|
||||||
fprintf (stderr, "Error reading the input file %s\n", InputFileName);
|
fprintf (stderr, "Error reading the input file %s\n", InputFileName);
|
||||||
fclose (InputFile);
|
fclose (InputFile);
|
||||||
|
@@ -38,7 +38,7 @@ def RunCommand(WorkDir=None, *Args, **kwargs):
|
|||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
message = ""
|
message = ""
|
||||||
if stdout is not None:
|
if stdout is not None:
|
||||||
message = stdout.decode(encoding='utf-8', errors='ignore') #for compatibility in python 2 and 3
|
message = stdout.decode(errors='ignore') #for compatibility in python 2 and 3
|
||||||
|
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise RuntimeError("Error while execute command \'{0}\' in direcotry {1}\n{2}".format(" ".join(Args), WorkDir, message))
|
raise RuntimeError("Error while execute command \'{0}\' in direcotry {1}\n{2}".format(" ".join(Args), WorkDir, message))
|
||||||
|
156
BaseTools/Source/Python/AmlToHex/AmlToHex.py
Normal file
156
BaseTools/Source/Python/AmlToHex/AmlToHex.py
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
## @file
|
||||||
|
#
|
||||||
|
# Convert an AML file to a .hex file containing the AML bytecode stored in a
|
||||||
|
# C array.
|
||||||
|
# By default, "Tables\Dsdt.aml" will generate "Tables\Dsdt.hex".
|
||||||
|
# "Tables\Dsdt.hex" will contain a C array named "dsdt_aml_code" that contains
|
||||||
|
# the AML bytecode.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import Common.EdkLogger as EdkLogger
|
||||||
|
from Common.BuildToolError import *
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
## Parse the command line arguments.
|
||||||
|
#
|
||||||
|
# @retval A argparse.NameSpace instance, containing parsed values.
|
||||||
|
#
|
||||||
|
def ParseArgs():
|
||||||
|
# Initialize the parser.
|
||||||
|
Parser = argparse.ArgumentParser(
|
||||||
|
description="Convert an AML file to a .hex file containing the AML " + \
|
||||||
|
"bytecode stored in a C array. By default, " + \
|
||||||
|
"\"Tables\\Dsdt.aml\" will generate" + \
|
||||||
|
"\"Tables\\Dsdt.hex\". \"Tables\\Dsdt.hex\" will " + \
|
||||||
|
"contain a C array named \"dsdt_aml_code\" that " + \
|
||||||
|
"contains the AML bytecode."
|
||||||
|
)
|
||||||
|
|
||||||
|
# Define the possible arguments.
|
||||||
|
Parser.add_argument(
|
||||||
|
dest="InputFile",
|
||||||
|
help="Path to an input AML file to generate a .hex file from."
|
||||||
|
)
|
||||||
|
Parser.add_argument(
|
||||||
|
"-o", "--out-dir", dest="OutDir",
|
||||||
|
help="Output directory where the .hex file will be generated. " + \
|
||||||
|
"Default is the input file's directory."
|
||||||
|
)
|
||||||
|
|
||||||
|
# Parse the input arguments.
|
||||||
|
Args = Parser.parse_args()
|
||||||
|
SplitInputName = ""
|
||||||
|
|
||||||
|
if not os.path.exists(Args.InputFile):
|
||||||
|
EdkLogger.error(__file__, FILE_OPEN_FAILURE,
|
||||||
|
ExtraData=Args.InputFile)
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
with open(Args.InputFile, "rb") as fIn:
|
||||||
|
Signature = str(fIn.read(4))
|
||||||
|
if ("DSDT" not in Signature) and ("SSDT" not in Signature):
|
||||||
|
EdkLogger.info("Invalid file type. " + \
|
||||||
|
"File does not have a valid " + \
|
||||||
|
"DSDT or SSDT signature: %s" % Args.InputFile)
|
||||||
|
return None
|
||||||
|
|
||||||
|
# Get the basename of the input file.
|
||||||
|
SplitInputName = os.path.splitext(Args.InputFile)
|
||||||
|
BaseName = os.path.basename(SplitInputName[0])
|
||||||
|
|
||||||
|
# If no output directory is specified, output to the input directory.
|
||||||
|
if not Args.OutDir:
|
||||||
|
Args.OutputFile = os.path.join(
|
||||||
|
os.path.dirname(Args.InputFile),
|
||||||
|
BaseName + ".hex"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
if not os.path.exists(Args.OutDir):
|
||||||
|
os.mkdir(Args.OutDir)
|
||||||
|
Args.OutputFile = os.path.join(Args.OutDir, BaseName + ".hex")
|
||||||
|
|
||||||
|
Args.BaseName = BaseName
|
||||||
|
|
||||||
|
return Args
|
||||||
|
|
||||||
|
## Convert an AML file to a .hex file containing the AML bytecode stored
|
||||||
|
# in a C array.
|
||||||
|
#
|
||||||
|
# @param InputFile Path to the input AML file.
|
||||||
|
# @param OutputFile Path to the output .hex file to generate.
|
||||||
|
# @param BaseName Base name of the input file.
|
||||||
|
# This is also the name of the generated .hex file.
|
||||||
|
#
|
||||||
|
def AmlToHex(InputFile, OutputFile, BaseName):
|
||||||
|
|
||||||
|
MacroName = "__{}_HEX__".format(BaseName.upper())
|
||||||
|
ArrayName = BaseName.lower() + "_aml_code"
|
||||||
|
|
||||||
|
with open(InputFile, "rb") as fIn, open(OutputFile, "w") as fOut:
|
||||||
|
# Write header.
|
||||||
|
fOut.write("// This file has been generated from:\n" + \
|
||||||
|
"// \tPython script: " + \
|
||||||
|
os.path.abspath(__file__) + "\n" + \
|
||||||
|
"// \tInput AML file: " + \
|
||||||
|
os.path.abspath(InputFile) + "\n\n" + \
|
||||||
|
"#ifndef {}\n".format(MacroName) + \
|
||||||
|
"#define {}\n\n".format(MacroName)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Write the array and its content.
|
||||||
|
fOut.write("unsigned char {}[] = {{\n ".format(ArrayName))
|
||||||
|
cnt = 0
|
||||||
|
byte = fIn.read(1)
|
||||||
|
while len(byte) != 0:
|
||||||
|
fOut.write("0x{0:02X}, ".format(ord(byte)))
|
||||||
|
cnt += 1
|
||||||
|
if (cnt % 8) == 0:
|
||||||
|
fOut.write("\n ")
|
||||||
|
byte = fIn.read(1)
|
||||||
|
fOut.write("\n};\n")
|
||||||
|
|
||||||
|
# Write footer.
|
||||||
|
fOut.write("#endif // {}\n".format(MacroName))
|
||||||
|
|
||||||
|
## Main method
|
||||||
|
#
|
||||||
|
# This method:
|
||||||
|
# 1- Initialize an EdkLogger instance.
|
||||||
|
# 2- Parses the input arguments.
|
||||||
|
# 3- Converts an AML file to a .hex file containing the AML bytecode stored
|
||||||
|
# in a C array.
|
||||||
|
#
|
||||||
|
# @retval 0 Success.
|
||||||
|
# @retval 1 Error.
|
||||||
|
#
|
||||||
|
def Main():
|
||||||
|
# Initialize an EdkLogger instance.
|
||||||
|
EdkLogger.Initialize()
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Parse the input arguments.
|
||||||
|
CommandArguments = ParseArgs()
|
||||||
|
if not CommandArguments:
|
||||||
|
return 1
|
||||||
|
|
||||||
|
# Convert an AML file to a .hex file containing the AML bytecode stored
|
||||||
|
# in a C array.
|
||||||
|
AmlToHex(CommandArguments.InputFile, CommandArguments.OutputFile,
|
||||||
|
CommandArguments.BaseName)
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
return 1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
r = Main()
|
||||||
|
# 0-127 is a safe return range, and 1 is a standard default error
|
||||||
|
if r < 0 or r > 127: r = 1
|
||||||
|
sys.exit(r)
|
@@ -128,12 +128,27 @@ class AutoGenManager(threading.Thread):
|
|||||||
clearQ(taskq)
|
clearQ(taskq)
|
||||||
clearQ(self.feedback_q)
|
clearQ(self.feedback_q)
|
||||||
clearQ(logq)
|
clearQ(logq)
|
||||||
|
# Copy the cache queue itmes to parent thread before clear
|
||||||
|
cacheq = self.autogen_workers[0].cache_q
|
||||||
|
try:
|
||||||
|
cache_num = 0
|
||||||
|
while True:
|
||||||
|
item = cacheq.get()
|
||||||
|
if item == "CacheDone":
|
||||||
|
cache_num += 1
|
||||||
|
else:
|
||||||
|
GlobalData.gModuleAllCacheStatus.add(item)
|
||||||
|
if cache_num == len(self.autogen_workers):
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
print ("cache_q error")
|
||||||
|
|
||||||
def TerminateWorkers(self):
|
def TerminateWorkers(self):
|
||||||
self.error_event.set()
|
self.error_event.set()
|
||||||
def kill(self):
|
def kill(self):
|
||||||
self.feedback_q.put(None)
|
self.feedback_q.put(None)
|
||||||
class AutoGenWorkerInProcess(mp.Process):
|
class AutoGenWorkerInProcess(mp.Process):
|
||||||
def __init__(self,module_queue,data_pipe_file_path,feedback_q,file_lock,cache_lock,share_data,log_q,error_event):
|
def __init__(self,module_queue,data_pipe_file_path,feedback_q,file_lock,cache_q,log_q,error_event):
|
||||||
mp.Process.__init__(self)
|
mp.Process.__init__(self)
|
||||||
self.module_queue = module_queue
|
self.module_queue = module_queue
|
||||||
self.data_pipe_file_path =data_pipe_file_path
|
self.data_pipe_file_path =data_pipe_file_path
|
||||||
@@ -141,8 +156,7 @@ class AutoGenWorkerInProcess(mp.Process):
|
|||||||
self.feedback_q = feedback_q
|
self.feedback_q = feedback_q
|
||||||
self.PlatformMetaFileSet = {}
|
self.PlatformMetaFileSet = {}
|
||||||
self.file_lock = file_lock
|
self.file_lock = file_lock
|
||||||
self.cache_lock = cache_lock
|
self.cache_q = cache_q
|
||||||
self.share_data = share_data
|
|
||||||
self.log_q = log_q
|
self.log_q = log_q
|
||||||
self.error_event = error_event
|
self.error_event = error_event
|
||||||
def GetPlatformMetaFile(self,filepath,root):
|
def GetPlatformMetaFile(self,filepath,root):
|
||||||
@@ -184,12 +198,19 @@ class AutoGenWorkerInProcess(mp.Process):
|
|||||||
GlobalData.gDisableIncludePathCheck = False
|
GlobalData.gDisableIncludePathCheck = False
|
||||||
GlobalData.gFdfParser = self.data_pipe.Get("FdfParser")
|
GlobalData.gFdfParser = self.data_pipe.Get("FdfParser")
|
||||||
GlobalData.gDatabasePath = self.data_pipe.Get("DatabasePath")
|
GlobalData.gDatabasePath = self.data_pipe.Get("DatabasePath")
|
||||||
|
|
||||||
|
GlobalData.gUseHashCache = self.data_pipe.Get("UseHashCache")
|
||||||
GlobalData.gBinCacheSource = self.data_pipe.Get("BinCacheSource")
|
GlobalData.gBinCacheSource = self.data_pipe.Get("BinCacheSource")
|
||||||
GlobalData.gBinCacheDest = self.data_pipe.Get("BinCacheDest")
|
GlobalData.gBinCacheDest = self.data_pipe.Get("BinCacheDest")
|
||||||
GlobalData.gCacheIR = self.share_data
|
GlobalData.gPlatformHashFile = self.data_pipe.Get("PlatformHashFile")
|
||||||
|
GlobalData.gModulePreMakeCacheStatus = dict()
|
||||||
|
GlobalData.gModuleMakeCacheStatus = dict()
|
||||||
|
GlobalData.gHashChainStatus = dict()
|
||||||
|
GlobalData.gCMakeHashFile = dict()
|
||||||
|
GlobalData.gModuleHashFile = dict()
|
||||||
|
GlobalData.gFileHashDict = dict()
|
||||||
GlobalData.gEnableGenfdsMultiThread = self.data_pipe.Get("EnableGenfdsMultiThread")
|
GlobalData.gEnableGenfdsMultiThread = self.data_pipe.Get("EnableGenfdsMultiThread")
|
||||||
GlobalData.file_lock = self.file_lock
|
GlobalData.file_lock = self.file_lock
|
||||||
GlobalData.cache_lock = self.cache_lock
|
|
||||||
CommandTarget = self.data_pipe.Get("CommandTarget")
|
CommandTarget = self.data_pipe.Get("CommandTarget")
|
||||||
pcd_from_build_option = []
|
pcd_from_build_option = []
|
||||||
for pcd_tuple in self.data_pipe.Get("BuildOptPcd"):
|
for pcd_tuple in self.data_pipe.Get("BuildOptPcd"):
|
||||||
@@ -205,10 +226,6 @@ class AutoGenWorkerInProcess(mp.Process):
|
|||||||
GlobalData.FfsCmd = FfsCmd
|
GlobalData.FfsCmd = FfsCmd
|
||||||
PlatformMetaFile = self.GetPlatformMetaFile(self.data_pipe.Get("P_Info").get("ActivePlatform"),
|
PlatformMetaFile = self.GetPlatformMetaFile(self.data_pipe.Get("P_Info").get("ActivePlatform"),
|
||||||
self.data_pipe.Get("P_Info").get("WorkspaceDir"))
|
self.data_pipe.Get("P_Info").get("WorkspaceDir"))
|
||||||
libConstPcd = self.data_pipe.Get("LibConstPcd")
|
|
||||||
Refes = self.data_pipe.Get("REFS")
|
|
||||||
GlobalData.libConstPcd = libConstPcd
|
|
||||||
GlobalData.Refes = Refes
|
|
||||||
while True:
|
while True:
|
||||||
if self.module_queue.empty():
|
if self.module_queue.empty():
|
||||||
break
|
break
|
||||||
@@ -230,27 +247,41 @@ class AutoGenWorkerInProcess(mp.Process):
|
|||||||
toolchain = self.data_pipe.Get("P_Info").get("ToolChain")
|
toolchain = self.data_pipe.Get("P_Info").get("ToolChain")
|
||||||
Ma = ModuleAutoGen(self.Wa,module_metafile,target,toolchain,arch,PlatformMetaFile,self.data_pipe)
|
Ma = ModuleAutoGen(self.Wa,module_metafile,target,toolchain,arch,PlatformMetaFile,self.data_pipe)
|
||||||
Ma.IsLibrary = IsLib
|
Ma.IsLibrary = IsLib
|
||||||
if IsLib:
|
# SourceFileList calling sequence impact the makefile string sequence.
|
||||||
if (Ma.MetaFile.File,Ma.MetaFile.Root,Ma.Arch,Ma.MetaFile.Path) in libConstPcd:
|
# Create cached SourceFileList here to unify its calling sequence for both
|
||||||
Ma.ConstPcd = libConstPcd[(Ma.MetaFile.File,Ma.MetaFile.Root,Ma.Arch,Ma.MetaFile.Path)]
|
# CanSkipbyPreMakeCache and CreateCodeFile/CreateMakeFile.
|
||||||
if (Ma.MetaFile.File,Ma.MetaFile.Root,Ma.Arch,Ma.MetaFile.Path) in Refes:
|
RetVal = Ma.SourceFileList
|
||||||
Ma.ReferenceModules = Refes[(Ma.MetaFile.File,Ma.MetaFile.Root,Ma.Arch,Ma.MetaFile.Path)]
|
if GlobalData.gUseHashCache and not GlobalData.gBinCacheDest and CommandTarget in [None, "", "all"]:
|
||||||
if GlobalData.gBinCacheSource and CommandTarget in [None, "", "all"]:
|
try:
|
||||||
Ma.GenModuleFilesHash(GlobalData.gCacheIR)
|
CacheResult = Ma.CanSkipbyPreMakeCache()
|
||||||
Ma.GenPreMakefileHash(GlobalData.gCacheIR)
|
except:
|
||||||
if Ma.CanSkipbyPreMakefileCache(GlobalData.gCacheIR):
|
CacheResult = False
|
||||||
|
traceback.print_exc(file=sys.stdout)
|
||||||
|
self.feedback_q.put(taskname)
|
||||||
|
|
||||||
|
if CacheResult:
|
||||||
|
self.cache_q.put((Ma.MetaFile.Path, Ma.Arch, "PreMakeCache", True))
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
self.cache_q.put((Ma.MetaFile.Path, Ma.Arch, "PreMakeCache", False))
|
||||||
|
|
||||||
Ma.CreateCodeFile(False)
|
Ma.CreateCodeFile(False)
|
||||||
Ma.CreateMakeFile(False,GenFfsList=FfsCmd.get((Ma.MetaFile.Path, Ma.Arch),[]))
|
Ma.CreateMakeFile(False,GenFfsList=FfsCmd.get((Ma.MetaFile.Path, Ma.Arch),[]))
|
||||||
|
|
||||||
if GlobalData.gBinCacheSource and CommandTarget in [None, "", "all"]:
|
if GlobalData.gBinCacheSource and CommandTarget in [None, "", "all"]:
|
||||||
Ma.GenMakeHeaderFilesHash(GlobalData.gCacheIR)
|
try:
|
||||||
Ma.GenMakeHash(GlobalData.gCacheIR)
|
CacheResult = Ma.CanSkipbyMakeCache()
|
||||||
if Ma.CanSkipbyMakeCache(GlobalData.gCacheIR):
|
except:
|
||||||
|
CacheResult = False
|
||||||
|
traceback.print_exc(file=sys.stdout)
|
||||||
|
self.feedback_q.put(taskname)
|
||||||
|
|
||||||
|
if CacheResult:
|
||||||
|
self.cache_q.put((Ma.MetaFile.Path, Ma.Arch, "MakeCache", True))
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
Ma.PrintFirstMakeCacheMissFile(GlobalData.gCacheIR)
|
self.cache_q.put((Ma.MetaFile.Path, Ma.Arch, "MakeCache", False))
|
||||||
|
|
||||||
except Empty:
|
except Empty:
|
||||||
pass
|
pass
|
||||||
except:
|
except:
|
||||||
@@ -258,6 +289,8 @@ class AutoGenWorkerInProcess(mp.Process):
|
|||||||
self.feedback_q.put(taskname)
|
self.feedback_q.put(taskname)
|
||||||
finally:
|
finally:
|
||||||
self.feedback_q.put("Done")
|
self.feedback_q.put("Done")
|
||||||
|
self.cache_q.put("CacheDone")
|
||||||
|
|
||||||
def printStatus(self):
|
def printStatus(self):
|
||||||
print("Processs ID: %d Run %d modules in AutoGen " % (os.getpid(),len(AutoGen.Cache())))
|
print("Processs ID: %d Run %d modules in AutoGen " % (os.getpid(),len(AutoGen.Cache())))
|
||||||
print("Processs ID: %d Run %d modules in AutoGenInfo " % (os.getpid(),len(AutoGenInfo.GetCache())))
|
print("Processs ID: %d Run %d modules in AutoGenInfo " % (os.getpid(),len(AutoGenInfo.GetCache())))
|
||||||
|
@@ -20,7 +20,7 @@ from Common.BuildToolError import *
|
|||||||
from Common.Misc import tdict, PathClass
|
from Common.Misc import tdict, PathClass
|
||||||
from Common.StringUtils import NormPath
|
from Common.StringUtils import NormPath
|
||||||
from Common.DataType import *
|
from Common.DataType import *
|
||||||
from Common.TargetTxtClassObject import TargetTxt
|
from Common.TargetTxtClassObject import TargetTxtDict
|
||||||
gDefaultBuildRuleFile = 'build_rule.txt'
|
gDefaultBuildRuleFile = 'build_rule.txt'
|
||||||
AutoGenReqBuildRuleVerNum = '0.1'
|
AutoGenReqBuildRuleVerNum = '0.1'
|
||||||
|
|
||||||
@@ -588,8 +588,28 @@ class BuildRule:
|
|||||||
_UnknownSection : SkipSection,
|
_UnknownSection : SkipSection,
|
||||||
}
|
}
|
||||||
|
|
||||||
def GetBuildRule():
|
class ToolBuildRule():
|
||||||
|
|
||||||
|
def __new__(cls, *args, **kw):
|
||||||
|
if not hasattr(cls, '_instance'):
|
||||||
|
orig = super(ToolBuildRule, cls)
|
||||||
|
cls._instance = orig.__new__(cls, *args, **kw)
|
||||||
|
return cls._instance
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
if not hasattr(self, 'ToolBuildRule'):
|
||||||
|
self._ToolBuildRule = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ToolBuildRule(self):
|
||||||
|
if not self._ToolBuildRule:
|
||||||
|
self._GetBuildRule()
|
||||||
|
return self._ToolBuildRule
|
||||||
|
|
||||||
|
def _GetBuildRule(self):
|
||||||
BuildRuleFile = None
|
BuildRuleFile = None
|
||||||
|
TargetObj = TargetTxtDict()
|
||||||
|
TargetTxt = TargetObj.Target
|
||||||
if TAB_TAT_DEFINES_BUILD_RULE_CONF in TargetTxt.TargetTxtDictionary:
|
if TAB_TAT_DEFINES_BUILD_RULE_CONF in TargetTxt.TargetTxtDictionary:
|
||||||
BuildRuleFile = TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_BUILD_RULE_CONF]
|
BuildRuleFile = TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_BUILD_RULE_CONF]
|
||||||
if not BuildRuleFile:
|
if not BuildRuleFile:
|
||||||
@@ -603,9 +623,7 @@ def GetBuildRule():
|
|||||||
EdkLogger.error("build", AUTOGEN_ERROR,
|
EdkLogger.error("build", AUTOGEN_ERROR,
|
||||||
ExtraData="The version number [%s] of build_rule.txt is less than the version number required by the AutoGen.(the minimum required version number is [%s])"\
|
ExtraData="The version number [%s] of build_rule.txt is less than the version number required by the AutoGen.(the minimum required version number is [%s])"\
|
||||||
% (RetVal._FileVersion, AutoGenReqBuildRuleVerNum))
|
% (RetVal._FileVersion, AutoGenReqBuildRuleVerNum))
|
||||||
return RetVal
|
self._ToolBuildRule = RetVal
|
||||||
|
|
||||||
BuildRuleObj = GetBuildRule()
|
|
||||||
|
|
||||||
# This acts like the main() function for the script, unless it is 'import'ed into another
|
# This acts like the main() function for the script, unless it is 'import'ed into another
|
||||||
# script.
|
# script.
|
||||||
|
@@ -1,29 +0,0 @@
|
|||||||
## @file
|
|
||||||
# Build cache intermediate result and state
|
|
||||||
#
|
|
||||||
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
#
|
|
||||||
|
|
||||||
class ModuleBuildCacheIR():
|
|
||||||
def __init__(self, Path, Arch):
|
|
||||||
self.ModulePath = Path
|
|
||||||
self.ModuleArch = Arch
|
|
||||||
self.ModuleFilesHashDigest = None
|
|
||||||
self.ModuleFilesHashHexDigest = None
|
|
||||||
self.ModuleFilesChain = []
|
|
||||||
self.PreMakefileHashHexDigest = None
|
|
||||||
self.CreateCodeFileDone = False
|
|
||||||
self.CreateMakeFileDone = False
|
|
||||||
self.MakefilePath = None
|
|
||||||
self.AutoGenFileList = None
|
|
||||||
self.DependencyHeaderFileSet = None
|
|
||||||
self.MakeHeaderFilesHashChain = None
|
|
||||||
self.MakeHeaderFilesHashDigest = None
|
|
||||||
self.MakeHeaderFilesHashChain = []
|
|
||||||
self.MakeHashDigest = None
|
|
||||||
self.MakeHashHexDigest = None
|
|
||||||
self.MakeHashChain = []
|
|
||||||
self.CacheCrash = False
|
|
||||||
self.PreMakeCacheHit = False
|
|
||||||
self.MakeCacheHit = False
|
|
@@ -159,6 +159,8 @@ class MemoryDataPipe(DataPipe):
|
|||||||
|
|
||||||
self.DataContainer = {"LogLevel": EdkLogger.GetLevel()}
|
self.DataContainer = {"LogLevel": EdkLogger.GetLevel()}
|
||||||
|
|
||||||
|
self.DataContainer = {"UseHashCache":GlobalData.gUseHashCache}
|
||||||
|
|
||||||
self.DataContainer = {"BinCacheSource":GlobalData.gBinCacheSource}
|
self.DataContainer = {"BinCacheSource":GlobalData.gBinCacheSource}
|
||||||
|
|
||||||
self.DataContainer = {"BinCacheDest":GlobalData.gBinCacheDest}
|
self.DataContainer = {"BinCacheDest":GlobalData.gBinCacheDest}
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
## @file
|
## @file
|
||||||
# Create makefile for MS nmake and GNU make
|
# Create makefile for MS nmake and GNU make
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
|
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
|
|
||||||
@@ -52,13 +53,10 @@ gIncludeMacroConversion = {
|
|||||||
"EFI_PPI_DEPENDENCY" : gPpiDefinition,
|
"EFI_PPI_DEPENDENCY" : gPpiDefinition,
|
||||||
}
|
}
|
||||||
|
|
||||||
## default makefile type
|
NMAKE_FILETYPE = "nmake"
|
||||||
gMakeType = ""
|
GMAKE_FILETYPE = "gmake"
|
||||||
if sys.platform == "win32":
|
WIN32_PLATFORM = "win32"
|
||||||
gMakeType = "nmake"
|
POSIX_PLATFORM = "posix"
|
||||||
else:
|
|
||||||
gMakeType = "gmake"
|
|
||||||
|
|
||||||
|
|
||||||
## BuildFile class
|
## BuildFile class
|
||||||
#
|
#
|
||||||
@@ -73,10 +71,17 @@ class BuildFile(object):
|
|||||||
|
|
||||||
## default file name for each type of build file
|
## default file name for each type of build file
|
||||||
_FILE_NAME_ = {
|
_FILE_NAME_ = {
|
||||||
"nmake" : "Makefile",
|
NMAKE_FILETYPE : "Makefile",
|
||||||
"gmake" : "GNUmakefile"
|
GMAKE_FILETYPE : "GNUmakefile"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Get Makefile name.
|
||||||
|
def getMakefileName(self):
|
||||||
|
if not self._FileType:
|
||||||
|
return self._DEFAULT_FILE_NAME_
|
||||||
|
else:
|
||||||
|
return self._FILE_NAME_[self._FileType]
|
||||||
|
|
||||||
## Fixed header string for makefile
|
## Fixed header string for makefile
|
||||||
_MAKEFILE_HEADER = '''#
|
_MAKEFILE_HEADER = '''#
|
||||||
# DO NOT EDIT
|
# DO NOT EDIT
|
||||||
@@ -94,8 +99,8 @@ class BuildFile(object):
|
|||||||
|
|
||||||
## Header string for each type of build file
|
## Header string for each type of build file
|
||||||
_FILE_HEADER_ = {
|
_FILE_HEADER_ = {
|
||||||
"nmake" : _MAKEFILE_HEADER % _FILE_NAME_["nmake"],
|
NMAKE_FILETYPE : _MAKEFILE_HEADER % _FILE_NAME_[NMAKE_FILETYPE],
|
||||||
"gmake" : _MAKEFILE_HEADER % _FILE_NAME_["gmake"]
|
GMAKE_FILETYPE : _MAKEFILE_HEADER % _FILE_NAME_[GMAKE_FILETYPE]
|
||||||
}
|
}
|
||||||
|
|
||||||
## shell commands which can be used in build file in the form of macro
|
## shell commands which can be used in build file in the form of macro
|
||||||
@@ -106,7 +111,7 @@ class BuildFile(object):
|
|||||||
# $(RD) remove dir command
|
# $(RD) remove dir command
|
||||||
#
|
#
|
||||||
_SHELL_CMD_ = {
|
_SHELL_CMD_ = {
|
||||||
"nmake" : {
|
WIN32_PLATFORM : {
|
||||||
"CP" : "copy /y",
|
"CP" : "copy /y",
|
||||||
"MV" : "move /y",
|
"MV" : "move /y",
|
||||||
"RM" : "del /f /q",
|
"RM" : "del /f /q",
|
||||||
@@ -114,7 +119,7 @@ class BuildFile(object):
|
|||||||
"RD" : "rmdir /s /q",
|
"RD" : "rmdir /s /q",
|
||||||
},
|
},
|
||||||
|
|
||||||
"gmake" : {
|
POSIX_PLATFORM : {
|
||||||
"CP" : "cp -f",
|
"CP" : "cp -f",
|
||||||
"MV" : "mv -f",
|
"MV" : "mv -f",
|
||||||
"RM" : "rm -f",
|
"RM" : "rm -f",
|
||||||
@@ -125,40 +130,40 @@ class BuildFile(object):
|
|||||||
|
|
||||||
## directory separator
|
## directory separator
|
||||||
_SEP_ = {
|
_SEP_ = {
|
||||||
"nmake" : "\\",
|
WIN32_PLATFORM : "\\",
|
||||||
"gmake" : "/"
|
POSIX_PLATFORM : "/"
|
||||||
}
|
}
|
||||||
|
|
||||||
## directory creation template
|
## directory creation template
|
||||||
_MD_TEMPLATE_ = {
|
_MD_TEMPLATE_ = {
|
||||||
"nmake" : 'if not exist %(dir)s $(MD) %(dir)s',
|
WIN32_PLATFORM : 'if not exist %(dir)s $(MD) %(dir)s',
|
||||||
"gmake" : "$(MD) %(dir)s"
|
POSIX_PLATFORM : "$(MD) %(dir)s"
|
||||||
}
|
}
|
||||||
|
|
||||||
## directory removal template
|
## directory removal template
|
||||||
_RD_TEMPLATE_ = {
|
_RD_TEMPLATE_ = {
|
||||||
"nmake" : 'if exist %(dir)s $(RD) %(dir)s',
|
WIN32_PLATFORM : 'if exist %(dir)s $(RD) %(dir)s',
|
||||||
"gmake" : "$(RD) %(dir)s"
|
POSIX_PLATFORM : "$(RD) %(dir)s"
|
||||||
}
|
}
|
||||||
## cp if exist
|
## cp if exist
|
||||||
_CP_TEMPLATE_ = {
|
_CP_TEMPLATE_ = {
|
||||||
"nmake" : 'if exist %(Src)s $(CP) %(Src)s %(Dst)s',
|
WIN32_PLATFORM : 'if exist %(Src)s $(CP) %(Src)s %(Dst)s',
|
||||||
"gmake" : "test -f %(Src)s && $(CP) %(Src)s %(Dst)s"
|
POSIX_PLATFORM : "test -f %(Src)s && $(CP) %(Src)s %(Dst)s"
|
||||||
}
|
}
|
||||||
|
|
||||||
_CD_TEMPLATE_ = {
|
_CD_TEMPLATE_ = {
|
||||||
"nmake" : 'if exist %(dir)s cd %(dir)s',
|
WIN32_PLATFORM : 'if exist %(dir)s cd %(dir)s',
|
||||||
"gmake" : "test -e %(dir)s && cd %(dir)s"
|
POSIX_PLATFORM : "test -e %(dir)s && cd %(dir)s"
|
||||||
}
|
}
|
||||||
|
|
||||||
_MAKE_TEMPLATE_ = {
|
_MAKE_TEMPLATE_ = {
|
||||||
"nmake" : 'if exist %(file)s "$(MAKE)" $(MAKE_FLAGS) -f %(file)s',
|
WIN32_PLATFORM : 'if exist %(file)s "$(MAKE)" $(MAKE_FLAGS) -f %(file)s',
|
||||||
"gmake" : 'test -e %(file)s && "$(MAKE)" $(MAKE_FLAGS) -f %(file)s'
|
POSIX_PLATFORM : 'test -e %(file)s && "$(MAKE)" $(MAKE_FLAGS) -f %(file)s'
|
||||||
}
|
}
|
||||||
|
|
||||||
_INCLUDE_CMD_ = {
|
_INCLUDE_CMD_ = {
|
||||||
"nmake" : '!INCLUDE',
|
NMAKE_FILETYPE : '!INCLUDE',
|
||||||
"gmake" : "include"
|
GMAKE_FILETYPE : "include"
|
||||||
}
|
}
|
||||||
|
|
||||||
_INC_FLAG_ = {TAB_COMPILER_MSFT : "/I", "GCC" : "-I", "INTEL" : "-I", "RVCT" : "-I", "NASM" : "-I"}
|
_INC_FLAG_ = {TAB_COMPILER_MSFT : "/I", "GCC" : "-I", "INTEL" : "-I", "RVCT" : "-I", "NASM" : "-I"}
|
||||||
@@ -169,22 +174,39 @@ class BuildFile(object):
|
|||||||
#
|
#
|
||||||
def __init__(self, AutoGenObject):
|
def __init__(self, AutoGenObject):
|
||||||
self._AutoGenObject = AutoGenObject
|
self._AutoGenObject = AutoGenObject
|
||||||
self._FileType = gMakeType
|
|
||||||
|
|
||||||
## Create build file
|
MakePath = AutoGenObject.BuildOption.get('MAKE', {}).get('PATH')
|
||||||
|
if not MakePath:
|
||||||
|
self._FileType = ""
|
||||||
|
elif "nmake" in MakePath:
|
||||||
|
self._FileType = NMAKE_FILETYPE
|
||||||
|
else:
|
||||||
|
self._FileType = "gmake"
|
||||||
|
|
||||||
|
if sys.platform == "win32":
|
||||||
|
self._Platform = WIN32_PLATFORM
|
||||||
|
else:
|
||||||
|
self._Platform = POSIX_PLATFORM
|
||||||
|
|
||||||
|
## Create build file.
|
||||||
#
|
#
|
||||||
# @param FileType Type of build file. Only nmake and gmake are supported now.
|
# Only nmake and gmake are supported.
|
||||||
#
|
#
|
||||||
# @retval TRUE The build file is created or re-created successfully
|
# @retval TRUE The build file is created or re-created successfully.
|
||||||
# @retval FALSE The build file exists and is the same as the one to be generated
|
# @retval FALSE The build file exists and is the same as the one to be generated.
|
||||||
#
|
#
|
||||||
def Generate(self, FileType=gMakeType):
|
def Generate(self):
|
||||||
if FileType not in self._FILE_NAME_:
|
|
||||||
EdkLogger.error("build", PARAMETER_INVALID, "Invalid build type [%s]" % FileType,
|
|
||||||
ExtraData="[%s]" % str(self._AutoGenObject))
|
|
||||||
self._FileType = FileType
|
|
||||||
FileContent = self._TEMPLATE_.Replace(self._TemplateDict)
|
FileContent = self._TEMPLATE_.Replace(self._TemplateDict)
|
||||||
FileName = self._FILE_NAME_[FileType]
|
FileName = self.getMakefileName()
|
||||||
|
if not os.path.exists(os.path.join(self._AutoGenObject.MakeFileDir, "deps.txt")):
|
||||||
|
with open(os.path.join(self._AutoGenObject.MakeFileDir, "deps.txt"),"w+") as fd:
|
||||||
|
fd.write("")
|
||||||
|
if not os.path.exists(os.path.join(self._AutoGenObject.MakeFileDir, "dependency")):
|
||||||
|
with open(os.path.join(self._AutoGenObject.MakeFileDir, "dependency"),"w+") as fd:
|
||||||
|
fd.write("")
|
||||||
|
if not os.path.exists(os.path.join(self._AutoGenObject.MakeFileDir, "deps_target")):
|
||||||
|
with open(os.path.join(self._AutoGenObject.MakeFileDir, "deps_target"),"w+") as fd:
|
||||||
|
fd.write("")
|
||||||
return SaveFileOnChange(os.path.join(self._AutoGenObject.MakeFileDir, FileName), FileContent, False)
|
return SaveFileOnChange(os.path.join(self._AutoGenObject.MakeFileDir, FileName), FileContent, False)
|
||||||
|
|
||||||
## Return a list of directory creation command string
|
## Return a list of directory creation command string
|
||||||
@@ -194,7 +216,7 @@ class BuildFile(object):
|
|||||||
# @retval list The directory creation command list
|
# @retval list The directory creation command list
|
||||||
#
|
#
|
||||||
def GetCreateDirectoryCommand(self, DirList):
|
def GetCreateDirectoryCommand(self, DirList):
|
||||||
return [self._MD_TEMPLATE_[self._FileType] % {'dir':Dir} for Dir in DirList]
|
return [self._MD_TEMPLATE_[self._Platform] % {'dir':Dir} for Dir in DirList]
|
||||||
|
|
||||||
## Return a list of directory removal command string
|
## Return a list of directory removal command string
|
||||||
#
|
#
|
||||||
@@ -203,7 +225,7 @@ class BuildFile(object):
|
|||||||
# @retval list The directory removal command list
|
# @retval list The directory removal command list
|
||||||
#
|
#
|
||||||
def GetRemoveDirectoryCommand(self, DirList):
|
def GetRemoveDirectoryCommand(self, DirList):
|
||||||
return [self._RD_TEMPLATE_[self._FileType] % {'dir':Dir} for Dir in DirList]
|
return [self._RD_TEMPLATE_[self._Platform] % {'dir':Dir} for Dir in DirList]
|
||||||
|
|
||||||
def PlaceMacro(self, Path, MacroDefinitions=None):
|
def PlaceMacro(self, Path, MacroDefinitions=None):
|
||||||
if Path.startswith("$("):
|
if Path.startswith("$("):
|
||||||
@@ -304,9 +326,6 @@ MAKE_FILE = ${makefile_path}
|
|||||||
${BEGIN}${file_macro}
|
${BEGIN}${file_macro}
|
||||||
${END}
|
${END}
|
||||||
|
|
||||||
COMMON_DEPS = ${BEGIN}${common_dependency_file} \\
|
|
||||||
${END}
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Overridable Target Macro Definitions
|
# Overridable Target Macro Definitions
|
||||||
#
|
#
|
||||||
@@ -382,6 +401,8 @@ gen_fds:
|
|||||||
\t@"$(MAKE)" $(MAKE_FLAGS) -f $(BUILD_DIR)${separator}${makefile_name} fds
|
\t@"$(MAKE)" $(MAKE_FLAGS) -f $(BUILD_DIR)${separator}${makefile_name} fds
|
||||||
\t@cd $(MODULE_BUILD_DIR)
|
\t@cd $(MODULE_BUILD_DIR)
|
||||||
|
|
||||||
|
${INCLUDETAG}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Individual Object Build Targets
|
# Individual Object Build Targets
|
||||||
#
|
#
|
||||||
@@ -454,11 +475,8 @@ cleanlib:
|
|||||||
# Compose a dict object containing information used to do replacement in template
|
# Compose a dict object containing information used to do replacement in template
|
||||||
@property
|
@property
|
||||||
def _TemplateDict(self):
|
def _TemplateDict(self):
|
||||||
if self._FileType not in self._SEP_:
|
|
||||||
EdkLogger.error("build", PARAMETER_INVALID, "Invalid Makefile type [%s]" % self._FileType,
|
|
||||||
ExtraData="[%s]" % str(self._AutoGenObject))
|
|
||||||
MyAgo = self._AutoGenObject
|
MyAgo = self._AutoGenObject
|
||||||
Separator = self._SEP_[self._FileType]
|
Separator = self._SEP_[self._Platform]
|
||||||
|
|
||||||
# break build if no source files and binary files are found
|
# break build if no source files and binary files are found
|
||||||
if len(MyAgo.SourceFileList) == 0 and len(MyAgo.BinaryFileList) == 0:
|
if len(MyAgo.SourceFileList) == 0 and len(MyAgo.BinaryFileList) == 0:
|
||||||
@@ -515,9 +533,6 @@ cleanlib:
|
|||||||
# Remove duplicated include path, if any
|
# Remove duplicated include path, if any
|
||||||
if Attr == "FLAGS":
|
if Attr == "FLAGS":
|
||||||
Value = RemoveDupOption(Value, IncPrefix, MyAgo.IncludePathList)
|
Value = RemoveDupOption(Value, IncPrefix, MyAgo.IncludePathList)
|
||||||
if self._AutoGenObject.BuildRuleFamily == TAB_COMPILER_MSFT and Tool == 'CC' and '/GM' in Value:
|
|
||||||
Value = Value.replace(' /MP', '')
|
|
||||||
MyAgo.BuildOption[Tool][Attr] = Value
|
|
||||||
if Tool == "OPTROM" and PCI_COMPRESS_Flag:
|
if Tool == "OPTROM" and PCI_COMPRESS_Flag:
|
||||||
ValueList = Value.split()
|
ValueList = Value.split()
|
||||||
if ValueList:
|
if ValueList:
|
||||||
@@ -540,7 +555,7 @@ cleanlib:
|
|||||||
UnexpandMacro = []
|
UnexpandMacro = []
|
||||||
NewStr = []
|
NewStr = []
|
||||||
for Str in StrList:
|
for Str in StrList:
|
||||||
if '$' in Str:
|
if '$' in Str or '-MMD' in Str or '-MF' in Str:
|
||||||
UnexpandMacro.append(Str)
|
UnexpandMacro.append(Str)
|
||||||
else:
|
else:
|
||||||
NewStr.append(Str)
|
NewStr.append(Str)
|
||||||
@@ -590,23 +605,22 @@ cleanlib:
|
|||||||
)
|
)
|
||||||
FileMacroList.append(FileMacro)
|
FileMacroList.append(FileMacro)
|
||||||
# Add support when compiling .nasm source files
|
# Add support when compiling .nasm source files
|
||||||
for File in self.FileCache.keys():
|
|
||||||
if not str(File).endswith('.nasm'):
|
|
||||||
continue
|
|
||||||
IncludePathList = []
|
IncludePathList = []
|
||||||
|
asmsource = [item for item in MyAgo.SourceFileList if item.File.upper().endswith((".NASM",".ASM",".NASMB","S"))]
|
||||||
|
if asmsource:
|
||||||
for P in MyAgo.IncludePathList:
|
for P in MyAgo.IncludePathList:
|
||||||
IncludePath = self._INC_FLAG_['NASM'] + self.PlaceMacro(P, self.Macros)
|
IncludePath = self._INC_FLAG_['NASM'] + self.PlaceMacro(P, self.Macros)
|
||||||
if IncludePath.endswith(os.sep):
|
if IncludePath.endswith(os.sep):
|
||||||
IncludePath = IncludePath.rstrip(os.sep)
|
IncludePath = IncludePath.rstrip(os.sep)
|
||||||
# When compiling .nasm files, need to add a literal backslash at each path
|
# When compiling .nasm files, need to add a literal backslash at each path.
|
||||||
# To specify a literal backslash at the end of the line, precede it with a caret (^)
|
# In nmake makfiles, a trailing literal backslash must be escaped with a caret ('^').
|
||||||
if P == MyAgo.IncludePathList[-1] and os.sep == '\\':
|
# It is otherwise replaced with a space (' '). This is not necessary for GNU makfefiles.
|
||||||
|
if P == MyAgo.IncludePathList[-1] and self._Platform == WIN32_PLATFORM and self._FileType == NMAKE_FILETYPE:
|
||||||
IncludePath = ''.join([IncludePath, '^', os.sep])
|
IncludePath = ''.join([IncludePath, '^', os.sep])
|
||||||
else:
|
else:
|
||||||
IncludePath = os.path.join(IncludePath, '')
|
IncludePath = os.path.join(IncludePath, '')
|
||||||
IncludePathList.append(IncludePath)
|
IncludePathList.append(IncludePath)
|
||||||
FileMacroList.append(self._FILE_MACRO_TEMPLATE.Replace({"macro_name": "NASM_INC", "source_file": IncludePathList}))
|
FileMacroList.append(self._FILE_MACRO_TEMPLATE.Replace({"macro_name": "NASM_INC", "source_file": IncludePathList}))
|
||||||
break
|
|
||||||
|
|
||||||
# Generate macros used to represent files containing list of input files
|
# Generate macros used to represent files containing list of input files
|
||||||
for ListFileMacro in self.ListFileMacros:
|
for ListFileMacro in self.ListFileMacros:
|
||||||
@@ -625,10 +639,10 @@ cleanlib:
|
|||||||
|
|
||||||
BcTargetList = []
|
BcTargetList = []
|
||||||
|
|
||||||
MakefileName = self._FILE_NAME_[self._FileType]
|
MakefileName = self.getMakefileName()
|
||||||
LibraryMakeCommandList = []
|
LibraryMakeCommandList = []
|
||||||
for D in self.LibraryBuildDirectoryList:
|
for D in self.LibraryBuildDirectoryList:
|
||||||
Command = self._MAKE_TEMPLATE_[self._FileType] % {"file":os.path.join(D, MakefileName)}
|
Command = self._MAKE_TEMPLATE_[self._Platform] % {"file":os.path.join(D, MakefileName)}
|
||||||
LibraryMakeCommandList.append(Command)
|
LibraryMakeCommandList.append(Command)
|
||||||
|
|
||||||
package_rel_dir = MyAgo.SourceDir
|
package_rel_dir = MyAgo.SourceDir
|
||||||
@@ -680,8 +694,8 @@ cleanlib:
|
|||||||
"separator" : Separator,
|
"separator" : Separator,
|
||||||
"module_tool_definitions" : ToolsDef,
|
"module_tool_definitions" : ToolsDef,
|
||||||
|
|
||||||
"shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),
|
"shell_command_code" : list(self._SHELL_CMD_[self._Platform].keys()),
|
||||||
"shell_command" : list(self._SHELL_CMD_[self._FileType].values()),
|
"shell_command" : list(self._SHELL_CMD_[self._Platform].values()),
|
||||||
|
|
||||||
"module_entry_point" : ModuleEntryPoint,
|
"module_entry_point" : ModuleEntryPoint,
|
||||||
"image_entry_point" : ImageEntryPoint,
|
"image_entry_point" : ImageEntryPoint,
|
||||||
@@ -696,6 +710,9 @@ cleanlib:
|
|||||||
"file_macro" : FileMacroList,
|
"file_macro" : FileMacroList,
|
||||||
"file_build_target" : self.BuildTargetList,
|
"file_build_target" : self.BuildTargetList,
|
||||||
"backward_compatible_target": BcTargetList,
|
"backward_compatible_target": BcTargetList,
|
||||||
|
"INCLUDETAG" : "\n".join([self._INCLUDE_CMD_[self._FileType] + " " + os.path.join("$(MODULE_BUILD_DIR)","dependency"),
|
||||||
|
self._INCLUDE_CMD_[self._FileType] + " " + os.path.join("$(MODULE_BUILD_DIR)","deps_target")
|
||||||
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
return MakefileTemplateDict
|
return MakefileTemplateDict
|
||||||
@@ -714,8 +731,8 @@ cleanlib:
|
|||||||
if Dst not in self.ResultFileList:
|
if Dst not in self.ResultFileList:
|
||||||
self.ResultFileList.append(Dst)
|
self.ResultFileList.append(Dst)
|
||||||
if '%s :' %(Dst) not in self.BuildTargetList:
|
if '%s :' %(Dst) not in self.BuildTargetList:
|
||||||
self.BuildTargetList.append("%s :" %(Dst))
|
self.BuildTargetList.append("%s : %s" %(Dst,Src))
|
||||||
self.BuildTargetList.append('\t' + self._CP_TEMPLATE_[self._FileType] %{'Src': Src, 'Dst': Dst})
|
self.BuildTargetList.append('\t' + self._CP_TEMPLATE_[self._Platform] %{'Src': Src, 'Dst': Dst})
|
||||||
|
|
||||||
FfsCmdList = Cmd[0]
|
FfsCmdList = Cmd[0]
|
||||||
for index, Str in enumerate(FfsCmdList):
|
for index, Str in enumerate(FfsCmdList):
|
||||||
@@ -903,14 +920,8 @@ cleanlib:
|
|||||||
if Item in SourceFileList:
|
if Item in SourceFileList:
|
||||||
SourceFileList.remove(Item)
|
SourceFileList.remove(Item)
|
||||||
|
|
||||||
FileDependencyDict = self.GetFileDependency(
|
FileDependencyDict = {item:ForceIncludedFile for item in SourceFileList}
|
||||||
SourceFileList,
|
|
||||||
ForceIncludedFile,
|
|
||||||
self._AutoGenObject.IncludePathList + self._AutoGenObject.BuildOptionIncPathList
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if FileDependencyDict:
|
|
||||||
for Dependency in FileDependencyDict.values():
|
for Dependency in FileDependencyDict.values():
|
||||||
self.DependencyHeaderFileSet.update(set(Dependency))
|
self.DependencyHeaderFileSet.update(set(Dependency))
|
||||||
|
|
||||||
@@ -972,42 +983,16 @@ cleanlib:
|
|||||||
ExtraData = "Local Header: " + aFile + " not found in " + self._AutoGenObject.MetaFile.Path
|
ExtraData = "Local Header: " + aFile + " not found in " + self._AutoGenObject.MetaFile.Path
|
||||||
)
|
)
|
||||||
|
|
||||||
DepSet = None
|
|
||||||
for File,Dependency in FileDependencyDict.items():
|
for File,Dependency in FileDependencyDict.items():
|
||||||
if not Dependency:
|
if not Dependency:
|
||||||
FileDependencyDict[File] = ['$(FORCE_REBUILD)']
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
self._AutoGenObject.AutoGenDepSet |= set(Dependency)
|
self._AutoGenObject.AutoGenDepSet |= set(Dependency)
|
||||||
|
|
||||||
# skip non-C files
|
|
||||||
if File.Ext not in [".c", ".C"] or File.Name == "AutoGen.c":
|
|
||||||
continue
|
|
||||||
elif DepSet is None:
|
|
||||||
DepSet = set(Dependency)
|
|
||||||
else:
|
|
||||||
DepSet &= set(Dependency)
|
|
||||||
# in case nothing in SourceFileList
|
|
||||||
if DepSet is None:
|
|
||||||
DepSet = set()
|
|
||||||
#
|
|
||||||
# Extract common files list in the dependency files
|
|
||||||
#
|
|
||||||
for File in DepSet:
|
|
||||||
self.CommonFileDependency.append(self.PlaceMacro(File.Path, self.Macros))
|
|
||||||
|
|
||||||
CmdSumDict = {}
|
CmdSumDict = {}
|
||||||
CmdTargetDict = {}
|
CmdTargetDict = {}
|
||||||
CmdCppDict = {}
|
CmdCppDict = {}
|
||||||
DependencyDict = FileDependencyDict.copy()
|
DependencyDict = FileDependencyDict.copy()
|
||||||
for File in FileDependencyDict:
|
|
||||||
# skip non-C files
|
|
||||||
if File.Ext not in [".c", ".C"] or File.Name == "AutoGen.c":
|
|
||||||
continue
|
|
||||||
NewDepSet = set(FileDependencyDict[File])
|
|
||||||
NewDepSet -= DepSet
|
|
||||||
FileDependencyDict[File] = ["$(COMMON_DEPS)"] + list(NewDepSet)
|
|
||||||
DependencyDict[File] = list(NewDepSet)
|
|
||||||
|
|
||||||
# Convert target description object to target string in makefile
|
# Convert target description object to target string in makefile
|
||||||
if self._AutoGenObject.BuildRuleFamily == TAB_COMPILER_MSFT and TAB_C_CODE_FILE in self._AutoGenObject.Targets:
|
if self._AutoGenObject.BuildRuleFamily == TAB_COMPILER_MSFT and TAB_C_CODE_FILE in self._AutoGenObject.Targets:
|
||||||
@@ -1080,10 +1065,6 @@ cleanlib:
|
|||||||
else:
|
else:
|
||||||
CmdCppDict[item.Target.SubDir] = ['$(MAKE_FILE)', Path]
|
CmdCppDict[item.Target.SubDir] = ['$(MAKE_FILE)', Path]
|
||||||
if CppPath.Path in DependencyDict:
|
if CppPath.Path in DependencyDict:
|
||||||
if '$(FORCE_REBUILD)' in DependencyDict[CppPath.Path]:
|
|
||||||
if '$(FORCE_REBUILD)' not in (self.CommonFileDependency + CmdCppDict[item.Target.SubDir]):
|
|
||||||
CmdCppDict[item.Target.SubDir].append('$(FORCE_REBUILD)')
|
|
||||||
else:
|
|
||||||
for Temp in DependencyDict[CppPath.Path]:
|
for Temp in DependencyDict[CppPath.Path]:
|
||||||
try:
|
try:
|
||||||
Path = self.PlaceMacro(Temp.Path, self.Macros)
|
Path = self.PlaceMacro(Temp.Path, self.Macros)
|
||||||
@@ -1109,7 +1090,7 @@ cleanlib:
|
|||||||
CommandList.pop(Index)
|
CommandList.pop(Index)
|
||||||
if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):
|
if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):
|
||||||
Cpplist = CmdCppDict[T.Target.SubDir]
|
Cpplist = CmdCppDict[T.Target.SubDir]
|
||||||
Cpplist.insert(0, '$(OBJLIST_%d): $(COMMON_DEPS)' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir))
|
Cpplist.insert(0, '$(OBJLIST_%d): ' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir))
|
||||||
T.Commands[Index] = '%s\n\t%s' % (' \\\n\t'.join(Cpplist), CmdTargetDict[CmdSign])
|
T.Commands[Index] = '%s\n\t%s' % (' \\\n\t'.join(Cpplist), CmdTargetDict[CmdSign])
|
||||||
else:
|
else:
|
||||||
T.Commands.pop(Index)
|
T.Commands.pop(Index)
|
||||||
@@ -1252,7 +1233,7 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\
|
|||||||
# Compose a dict object containing information used to do replacement in template
|
# Compose a dict object containing information used to do replacement in template
|
||||||
@property
|
@property
|
||||||
def _TemplateDict(self):
|
def _TemplateDict(self):
|
||||||
Separator = self._SEP_[self._FileType]
|
Separator = self._SEP_[self._Platform]
|
||||||
MyAgo = self._AutoGenObject
|
MyAgo = self._AutoGenObject
|
||||||
if self._FileType not in MyAgo.CustomMakefile:
|
if self._FileType not in MyAgo.CustomMakefile:
|
||||||
EdkLogger.error('build', OPTION_NOT_SUPPORTED, "No custom makefile for %s" % self._FileType,
|
EdkLogger.error('build', OPTION_NOT_SUPPORTED, "No custom makefile for %s" % self._FileType,
|
||||||
@@ -1282,7 +1263,7 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\
|
|||||||
ToolsDef.append("%s_%s = %s" % (Tool, Attr, MyAgo.BuildOption[Tool][Attr]))
|
ToolsDef.append("%s_%s = %s" % (Tool, Attr, MyAgo.BuildOption[Tool][Attr]))
|
||||||
ToolsDef.append("")
|
ToolsDef.append("")
|
||||||
|
|
||||||
MakefileName = self._FILE_NAME_[self._FileType]
|
MakefileName = self.getMakefileName()
|
||||||
MakefileTemplateDict = {
|
MakefileTemplateDict = {
|
||||||
"makefile_header" : self._FILE_HEADER_[self._FileType],
|
"makefile_header" : self._FILE_HEADER_[self._FileType],
|
||||||
"makefile_path" : os.path.join("$(MODULE_BUILD_DIR)", MakefileName),
|
"makefile_path" : os.path.join("$(MODULE_BUILD_DIR)", MakefileName),
|
||||||
@@ -1315,8 +1296,8 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\
|
|||||||
"separator" : Separator,
|
"separator" : Separator,
|
||||||
"module_tool_definitions" : ToolsDef,
|
"module_tool_definitions" : ToolsDef,
|
||||||
|
|
||||||
"shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),
|
"shell_command_code" : list(self._SHELL_CMD_[self._Platform].keys()),
|
||||||
"shell_command" : list(self._SHELL_CMD_[self._FileType].values()),
|
"shell_command" : list(self._SHELL_CMD_[self._Platform].values()),
|
||||||
|
|
||||||
"create_directory_command" : self.GetCreateDirectoryCommand(self.IntermediateDirectoryList),
|
"create_directory_command" : self.GetCreateDirectoryCommand(self.IntermediateDirectoryList),
|
||||||
"custom_makefile_content" : CustomMakefile
|
"custom_makefile_content" : CustomMakefile
|
||||||
@@ -1443,7 +1424,7 @@ cleanlib:
|
|||||||
# Compose a dict object containing information used to do replacement in template
|
# Compose a dict object containing information used to do replacement in template
|
||||||
@property
|
@property
|
||||||
def _TemplateDict(self):
|
def _TemplateDict(self):
|
||||||
Separator = self._SEP_[self._FileType]
|
Separator = self._SEP_[self._Platform]
|
||||||
|
|
||||||
MyAgo = self._AutoGenObject
|
MyAgo = self._AutoGenObject
|
||||||
if "MAKE" not in MyAgo.ToolDefinition or "PATH" not in MyAgo.ToolDefinition["MAKE"]:
|
if "MAKE" not in MyAgo.ToolDefinition or "PATH" not in MyAgo.ToolDefinition["MAKE"]:
|
||||||
@@ -1454,13 +1435,13 @@ cleanlib:
|
|||||||
self.ModuleBuildDirectoryList = self.GetModuleBuildDirectoryList()
|
self.ModuleBuildDirectoryList = self.GetModuleBuildDirectoryList()
|
||||||
self.LibraryBuildDirectoryList = self.GetLibraryBuildDirectoryList()
|
self.LibraryBuildDirectoryList = self.GetLibraryBuildDirectoryList()
|
||||||
|
|
||||||
MakefileName = self._FILE_NAME_[self._FileType]
|
MakefileName = self.getMakefileName()
|
||||||
LibraryMakefileList = []
|
LibraryMakefileList = []
|
||||||
LibraryMakeCommandList = []
|
LibraryMakeCommandList = []
|
||||||
for D in self.LibraryBuildDirectoryList:
|
for D in self.LibraryBuildDirectoryList:
|
||||||
D = self.PlaceMacro(D, {"BUILD_DIR":MyAgo.BuildDir})
|
D = self.PlaceMacro(D, {"BUILD_DIR":MyAgo.BuildDir})
|
||||||
Makefile = os.path.join(D, MakefileName)
|
Makefile = os.path.join(D, MakefileName)
|
||||||
Command = self._MAKE_TEMPLATE_[self._FileType] % {"file":Makefile}
|
Command = self._MAKE_TEMPLATE_[self._Platform] % {"file":Makefile}
|
||||||
LibraryMakefileList.append(Makefile)
|
LibraryMakefileList.append(Makefile)
|
||||||
LibraryMakeCommandList.append(Command)
|
LibraryMakeCommandList.append(Command)
|
||||||
self.LibraryMakeCommandList = LibraryMakeCommandList
|
self.LibraryMakeCommandList = LibraryMakeCommandList
|
||||||
@@ -1470,7 +1451,7 @@ cleanlib:
|
|||||||
for D in self.ModuleBuildDirectoryList:
|
for D in self.ModuleBuildDirectoryList:
|
||||||
D = self.PlaceMacro(D, {"BUILD_DIR":MyAgo.BuildDir})
|
D = self.PlaceMacro(D, {"BUILD_DIR":MyAgo.BuildDir})
|
||||||
Makefile = os.path.join(D, MakefileName)
|
Makefile = os.path.join(D, MakefileName)
|
||||||
Command = self._MAKE_TEMPLATE_[self._FileType] % {"file":Makefile}
|
Command = self._MAKE_TEMPLATE_[self._Platform] % {"file":Makefile}
|
||||||
ModuleMakefileList.append(Makefile)
|
ModuleMakefileList.append(Makefile)
|
||||||
ModuleMakeCommandList.append(Command)
|
ModuleMakeCommandList.append(Command)
|
||||||
|
|
||||||
@@ -1490,8 +1471,8 @@ cleanlib:
|
|||||||
|
|
||||||
"toolchain_tag" : MyAgo.ToolChain,
|
"toolchain_tag" : MyAgo.ToolChain,
|
||||||
"build_target" : MyAgo.BuildTarget,
|
"build_target" : MyAgo.BuildTarget,
|
||||||
"shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),
|
"shell_command_code" : list(self._SHELL_CMD_[self._Platform].keys()),
|
||||||
"shell_command" : list(self._SHELL_CMD_[self._FileType].values()),
|
"shell_command" : list(self._SHELL_CMD_[self._Platform].values()),
|
||||||
"build_architecture_list" : MyAgo.Arch,
|
"build_architecture_list" : MyAgo.Arch,
|
||||||
"architecture" : MyAgo.Arch,
|
"architecture" : MyAgo.Arch,
|
||||||
"separator" : Separator,
|
"separator" : Separator,
|
||||||
@@ -1549,7 +1530,7 @@ class TopLevelMakefile(BuildFile):
|
|||||||
# Compose a dict object containing information used to do replacement in template
|
# Compose a dict object containing information used to do replacement in template
|
||||||
@property
|
@property
|
||||||
def _TemplateDict(self):
|
def _TemplateDict(self):
|
||||||
Separator = self._SEP_[self._FileType]
|
Separator = self._SEP_[self._Platform]
|
||||||
|
|
||||||
# any platform autogen object is ok because we just need common information
|
# any platform autogen object is ok because we just need common information
|
||||||
MyAgo = self._AutoGenObject
|
MyAgo = self._AutoGenObject
|
||||||
@@ -1605,10 +1586,10 @@ class TopLevelMakefile(BuildFile):
|
|||||||
else:
|
else:
|
||||||
ExtraOption += " --pcd " + pcdname + '=' + pcd[3]
|
ExtraOption += " --pcd " + pcdname + '=' + pcd[3]
|
||||||
|
|
||||||
MakefileName = self._FILE_NAME_[self._FileType]
|
MakefileName = self.getMakefileName()
|
||||||
SubBuildCommandList = []
|
SubBuildCommandList = []
|
||||||
for A in MyAgo.ArchList:
|
for A in MyAgo.ArchList:
|
||||||
Command = self._MAKE_TEMPLATE_[self._FileType] % {"file":os.path.join("$(BUILD_DIR)", A, MakefileName)}
|
Command = self._MAKE_TEMPLATE_[self._Platform] % {"file":os.path.join("$(BUILD_DIR)", A, MakefileName)}
|
||||||
SubBuildCommandList.append(Command)
|
SubBuildCommandList.append(Command)
|
||||||
|
|
||||||
MakefileTemplateDict = {
|
MakefileTemplateDict = {
|
||||||
@@ -1623,8 +1604,8 @@ class TopLevelMakefile(BuildFile):
|
|||||||
|
|
||||||
"toolchain_tag" : MyAgo.ToolChain,
|
"toolchain_tag" : MyAgo.ToolChain,
|
||||||
"build_target" : MyAgo.BuildTarget,
|
"build_target" : MyAgo.BuildTarget,
|
||||||
"shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),
|
"shell_command_code" : list(self._SHELL_CMD_[self._Platform].keys()),
|
||||||
"shell_command" : list(self._SHELL_CMD_[self._FileType].values()),
|
"shell_command" : list(self._SHELL_CMD_[self._Platform].values()),
|
||||||
'arch' : list(MyAgo.ArchList),
|
'arch' : list(MyAgo.ArchList),
|
||||||
"build_architecture_list" : ','.join(MyAgo.ArchList),
|
"build_architecture_list" : ','.join(MyAgo.ArchList),
|
||||||
"separator" : Separator,
|
"separator" : Separator,
|
||||||
|
295
BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
Normal file
295
BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
Normal file
@@ -0,0 +1,295 @@
|
|||||||
|
## @file
|
||||||
|
# Build cache intermediate result and state
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
|
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
from Common.caching import cached_property
|
||||||
|
import Common.EdkLogger as EdkLogger
|
||||||
|
import Common.LongFilePathOs as os
|
||||||
|
from Common.BuildToolError import *
|
||||||
|
from Common.Misc import SaveFileOnChange, PathClass
|
||||||
|
from Common.Misc import TemplateString
|
||||||
|
import sys
|
||||||
|
gIsFileMap = {}
|
||||||
|
|
||||||
|
DEP_FILE_TAIL = "# Updated \n"
|
||||||
|
|
||||||
|
class IncludesAutoGen():
|
||||||
|
""" This class is to manage the dependent files witch are used in Makefile to support incremental build.
|
||||||
|
1. C files:
|
||||||
|
1. MSVS.
|
||||||
|
cl.exe has a build option /showIncludes to display include files on stdout. Build tool captures
|
||||||
|
that messages and generate dependency files, .deps files.
|
||||||
|
2. CLANG and GCC
|
||||||
|
-MMD -MF build option are used to generate dependency files by compiler. Build tool updates the
|
||||||
|
.deps files.
|
||||||
|
2. ASL files:
|
||||||
|
1. Trim find out all the included files with asl specific include format and generate .trim.deps file.
|
||||||
|
2. ASL PP use c preprocessor to find out all included files with #include format and generate a .deps file
|
||||||
|
3. build tool updates the .deps file
|
||||||
|
3. ASM files (.asm, .s or .nasm):
|
||||||
|
1. Trim find out all the included files with asl specific include format and generate .trim.deps file.
|
||||||
|
2. ASM PP use c preprocessor to find out all included files with #include format and generate a deps file
|
||||||
|
3. build tool updates the .deps file
|
||||||
|
"""
|
||||||
|
def __init__(self, makefile_folder, ModuleAuto):
|
||||||
|
self.d_folder = makefile_folder
|
||||||
|
self.makefile_folder = makefile_folder
|
||||||
|
self.module_autogen = ModuleAuto
|
||||||
|
self.ToolChainFamily = ModuleAuto.ToolChainFamily
|
||||||
|
self.workspace = ModuleAuto.WorkspaceDir
|
||||||
|
|
||||||
|
def CreateModuleDeps(self):
|
||||||
|
SaveFileOnChange(os.path.join(self.makefile_folder,"deps.txt"),"\n".join(self.DepsCollection),False)
|
||||||
|
|
||||||
|
def CreateDepsInclude(self):
|
||||||
|
deps_file = {'deps_file':self.deps_files}
|
||||||
|
|
||||||
|
MakePath = self.module_autogen.BuildOption.get('MAKE', {}).get('PATH')
|
||||||
|
if not MakePath:
|
||||||
|
EdkLogger.error("build", PARAMETER_MISSING, Message="No Make path available.")
|
||||||
|
elif "nmake" in MakePath:
|
||||||
|
_INCLUDE_DEPS_TEMPLATE = TemplateString('''
|
||||||
|
${BEGIN}
|
||||||
|
!IF EXIST(${deps_file})
|
||||||
|
!INCLUDE ${deps_file}
|
||||||
|
!ENDIF
|
||||||
|
${END}
|
||||||
|
''')
|
||||||
|
else:
|
||||||
|
_INCLUDE_DEPS_TEMPLATE = TemplateString('''
|
||||||
|
${BEGIN}
|
||||||
|
-include ${deps_file}
|
||||||
|
${END}
|
||||||
|
''')
|
||||||
|
|
||||||
|
try:
|
||||||
|
deps_include_str = _INCLUDE_DEPS_TEMPLATE.Replace(deps_file)
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
SaveFileOnChange(os.path.join(self.makefile_folder,"dependency"),deps_include_str,False)
|
||||||
|
|
||||||
|
def CreateDepsTarget(self):
|
||||||
|
SaveFileOnChange(os.path.join(self.makefile_folder,"deps_target"),"\n".join([item +":" for item in self.DepsCollection]),False)
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def deps_files(self):
|
||||||
|
""" Get all .deps file under module build folder. """
|
||||||
|
deps_files = []
|
||||||
|
for root, _, files in os.walk(self.d_folder, topdown=False):
|
||||||
|
for name in files:
|
||||||
|
if not name.endswith(".deps"):
|
||||||
|
continue
|
||||||
|
abspath = os.path.join(root, name)
|
||||||
|
deps_files.append(abspath)
|
||||||
|
return deps_files
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def DepsCollection(self):
|
||||||
|
""" Collect all the dependency files list from all .deps files under a module's build folder """
|
||||||
|
includes = set()
|
||||||
|
targetname = [item[0].Name for item in self.TargetFileList.values()]
|
||||||
|
for abspath in self.deps_files:
|
||||||
|
try:
|
||||||
|
with open(abspath,"r") as fd:
|
||||||
|
lines = fd.readlines()
|
||||||
|
|
||||||
|
firstlineitems = lines[0].split(": ")
|
||||||
|
dependency_file = firstlineitems[1].strip(" \\\n")
|
||||||
|
dependency_file = dependency_file.strip('''"''')
|
||||||
|
if dependency_file:
|
||||||
|
if os.path.normpath(dependency_file +".deps") == abspath:
|
||||||
|
continue
|
||||||
|
filename = os.path.basename(dependency_file).strip()
|
||||||
|
if filename not in self.SourceFileList and filename not in targetname:
|
||||||
|
includes.add(dependency_file.strip())
|
||||||
|
|
||||||
|
for item in lines[1:]:
|
||||||
|
if item == DEP_FILE_TAIL:
|
||||||
|
continue
|
||||||
|
dependency_file = item.strip(" \\\n")
|
||||||
|
dependency_file = dependency_file.strip('''"''')
|
||||||
|
if dependency_file == '':
|
||||||
|
continue
|
||||||
|
if os.path.normpath(dependency_file +".deps") == abspath:
|
||||||
|
continue
|
||||||
|
filename = os.path.basename(dependency_file).strip()
|
||||||
|
if filename in self.SourceFileList:
|
||||||
|
continue
|
||||||
|
if filename in targetname:
|
||||||
|
continue
|
||||||
|
includes.add(dependency_file.strip())
|
||||||
|
except Exception as e:
|
||||||
|
EdkLogger.error("build",FILE_NOT_FOUND, "%s doesn't exist" % abspath, ExtraData=str(e), RaiseError=False)
|
||||||
|
continue
|
||||||
|
rt = sorted(list(set([item.strip(' " \\\n') for item in includes])))
|
||||||
|
return rt
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def SourceFileList(self):
|
||||||
|
""" Get a map of module's source files name to module's source files path """
|
||||||
|
source = {os.path.basename(item.File):item.Path for item in self.module_autogen.SourceFileList}
|
||||||
|
middle_file = {}
|
||||||
|
for afile in source:
|
||||||
|
if afile.upper().endswith(".VFR"):
|
||||||
|
middle_file.update({afile.split(".")[0]+".c":os.path.join(self.module_autogen.DebugDir,afile.split(".")[0]+".c")})
|
||||||
|
if afile.upper().endswith((".S","ASM")):
|
||||||
|
middle_file.update({afile.split(".")[0]+".i":os.path.join(self.module_autogen.OutputDir,afile.split(".")[0]+".i")})
|
||||||
|
if afile.upper().endswith(".ASL"):
|
||||||
|
middle_file.update({afile.split(".")[0]+".i":os.path.join(self.module_autogen.OutputDir,afile.split(".")[0]+".i")})
|
||||||
|
source.update({"AutoGen.c":os.path.join(self.module_autogen.OutputDir,"AutoGen.c")})
|
||||||
|
source.update(middle_file)
|
||||||
|
return source
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def HasNamesakeSourceFile(self):
|
||||||
|
source_base_name = set([os.path.basename(item.File) for item in self.module_autogen.SourceFileList])
|
||||||
|
rt = len(source_base_name) != len(self.module_autogen.SourceFileList)
|
||||||
|
return rt
|
||||||
|
@cached_property
|
||||||
|
def CcPPCommandPathSet(self):
|
||||||
|
rt = set()
|
||||||
|
rt.add(self.module_autogen.BuildOption.get('CC',{}).get('PATH'))
|
||||||
|
rt.add(self.module_autogen.BuildOption.get('ASLCC',{}).get('PATH'))
|
||||||
|
rt.add(self.module_autogen.BuildOption.get('ASLPP',{}).get('PATH'))
|
||||||
|
rt.add(self.module_autogen.BuildOption.get('VFRPP',{}).get('PATH'))
|
||||||
|
rt.add(self.module_autogen.BuildOption.get('PP',{}).get('PATH'))
|
||||||
|
rt.add(self.module_autogen.BuildOption.get('APP',{}).get('PATH'))
|
||||||
|
rt.discard(None)
|
||||||
|
return rt
|
||||||
|
@cached_property
|
||||||
|
def TargetFileList(self):
|
||||||
|
""" Get a map of module's target name to a tuple of module's targets path and whose input file path """
|
||||||
|
targets = {}
|
||||||
|
targets["AutoGen.obj"] = (PathClass(os.path.join(self.module_autogen.OutputDir,"AutoGen.obj")),PathClass(os.path.join(self.module_autogen.DebugDir,"AutoGen.c")))
|
||||||
|
for item in self.module_autogen.Targets.values():
|
||||||
|
for block in item:
|
||||||
|
targets[block.Target.Path] = (block.Target,block.Inputs[0])
|
||||||
|
return targets
|
||||||
|
|
||||||
|
def GetRealTarget(self,source_file_abs):
|
||||||
|
""" Get the final target file based on source file abspath """
|
||||||
|
source_target_map = {item[1].Path:item[0].Path for item in self.TargetFileList.values()}
|
||||||
|
source_name_map = {item[1].File:item[0].Path for item in self.TargetFileList.values()}
|
||||||
|
target_abs = source_target_map.get(source_file_abs)
|
||||||
|
if target_abs is None:
|
||||||
|
if source_file_abs.strip().endswith(".i"):
|
||||||
|
sourcefilename = os.path.basename(source_file_abs.strip())
|
||||||
|
for sourcefile in source_name_map:
|
||||||
|
if sourcefilename.split(".")[0] == sourcefile.split(".")[0]:
|
||||||
|
target_abs = source_name_map[sourcefile]
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
target_abs = source_file_abs
|
||||||
|
else:
|
||||||
|
target_abs = source_file_abs
|
||||||
|
return target_abs
|
||||||
|
|
||||||
|
def CreateDepsFileForMsvc(self, DepList):
|
||||||
|
""" Generate dependency files, .deps file from /showIncludes output message """
|
||||||
|
if not DepList:
|
||||||
|
return
|
||||||
|
ModuleDepDict = {}
|
||||||
|
current_source = ""
|
||||||
|
SourceFileAbsPathMap = self.SourceFileList
|
||||||
|
for line in DepList:
|
||||||
|
line = line.strip()
|
||||||
|
if self.HasNamesakeSourceFile:
|
||||||
|
for cc_cmd in self.CcPPCommandPathSet:
|
||||||
|
if cc_cmd in line:
|
||||||
|
if '''"'''+cc_cmd+'''"''' in line:
|
||||||
|
cc_options = line[len(cc_cmd)+2:].split()
|
||||||
|
else:
|
||||||
|
cc_options = line[len(cc_cmd):].split()
|
||||||
|
SourceFileAbsPathMap = {os.path.basename(item):item for item in cc_options if not item.startswith("/") and os.path.exists(item)}
|
||||||
|
if line in SourceFileAbsPathMap:
|
||||||
|
current_source = line
|
||||||
|
if current_source not in ModuleDepDict:
|
||||||
|
ModuleDepDict[SourceFileAbsPathMap[current_source]] = []
|
||||||
|
elif "Note: including file:" == line.lstrip()[:21]:
|
||||||
|
if not current_source:
|
||||||
|
EdkLogger.error("build",BUILD_ERROR, "Parse /showIncludes output failed. line: %s. \n" % line, RaiseError=False)
|
||||||
|
else:
|
||||||
|
ModuleDepDict[SourceFileAbsPathMap[current_source]].append(line.lstrip()[22:].strip())
|
||||||
|
|
||||||
|
for source_abs in ModuleDepDict:
|
||||||
|
if ModuleDepDict[source_abs]:
|
||||||
|
target_abs = self.GetRealTarget(source_abs)
|
||||||
|
dep_file_name = os.path.basename(source_abs) + ".deps"
|
||||||
|
SaveFileOnChange(os.path.join(os.path.dirname(target_abs),dep_file_name)," \\\n".join([target_abs+":"] + ['''"''' + item +'''"''' for item in ModuleDepDict[source_abs]]),False)
|
||||||
|
|
||||||
|
def UpdateDepsFileforNonMsvc(self):
|
||||||
|
""" Update .deps files.
|
||||||
|
1. Update target path to absolute path.
|
||||||
|
2. Update middle target to final target.
|
||||||
|
"""
|
||||||
|
|
||||||
|
for abspath in self.deps_files:
|
||||||
|
if abspath.endswith(".trim.deps"):
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
newcontent = []
|
||||||
|
with open(abspath,"r") as fd:
|
||||||
|
lines = fd.readlines()
|
||||||
|
if lines[-1] == DEP_FILE_TAIL:
|
||||||
|
continue
|
||||||
|
firstlineitems = lines[0].strip().split(" ")
|
||||||
|
|
||||||
|
if len(firstlineitems) > 2:
|
||||||
|
sourceitem = firstlineitems[1]
|
||||||
|
else:
|
||||||
|
sourceitem = lines[1].strip().split(" ")[0]
|
||||||
|
|
||||||
|
source_abs = self.SourceFileList.get(sourceitem,sourceitem)
|
||||||
|
firstlineitems[0] = self.GetRealTarget(source_abs)
|
||||||
|
p_target = firstlineitems
|
||||||
|
if not p_target[0].strip().endswith(":"):
|
||||||
|
p_target[0] += ": "
|
||||||
|
|
||||||
|
if len(p_target) == 2:
|
||||||
|
p_target[0] += lines[1]
|
||||||
|
newcontent.append(p_target[0])
|
||||||
|
newcontent.extend(lines[2:])
|
||||||
|
else:
|
||||||
|
line1 = " ".join(p_target).strip()
|
||||||
|
line1 += "\n"
|
||||||
|
newcontent.append(line1)
|
||||||
|
newcontent.extend(lines[1:])
|
||||||
|
|
||||||
|
newcontent.append("\n")
|
||||||
|
newcontent.append(DEP_FILE_TAIL)
|
||||||
|
with open(abspath,"w") as fw:
|
||||||
|
fw.write("".join(newcontent))
|
||||||
|
except Exception as e:
|
||||||
|
EdkLogger.error("build",FILE_NOT_FOUND, "%s doesn't exist" % abspath, ExtraData=str(e), RaiseError=False)
|
||||||
|
continue
|
||||||
|
|
||||||
|
def UpdateDepsFileforTrim(self):
|
||||||
|
""" Update .deps file which generated by trim. """
|
||||||
|
|
||||||
|
for abspath in self.deps_files:
|
||||||
|
if not abspath.endswith(".trim.deps"):
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
newcontent = []
|
||||||
|
with open(abspath,"r") as fd:
|
||||||
|
lines = fd.readlines()
|
||||||
|
if lines[-1] == DEP_FILE_TAIL:
|
||||||
|
continue
|
||||||
|
|
||||||
|
source_abs = lines[0].strip().split(" ")[0]
|
||||||
|
targetitem = self.GetRealTarget(source_abs.strip(" :"))
|
||||||
|
|
||||||
|
targetitem += ": "
|
||||||
|
targetitem += lines[1]
|
||||||
|
newcontent.append(targetitem)
|
||||||
|
newcontent.extend(lines[2:])
|
||||||
|
newcontent.append("\n")
|
||||||
|
newcontent.append(DEP_FILE_TAIL)
|
||||||
|
with open(abspath,"w") as fw:
|
||||||
|
fw.write("".join(newcontent))
|
||||||
|
except Exception as e:
|
||||||
|
EdkLogger.error("build",FILE_NOT_FOUND, "%s doesn't exist" % abspath, ExtraData=str(e), RaiseError=False)
|
||||||
|
continue
|
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
|||||||
# Create makefile for MS nmake and GNU make
|
# Create makefile for MS nmake and GNU make
|
||||||
#
|
#
|
||||||
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
||||||
|
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
|
|
||||||
@@ -106,8 +107,9 @@ class PlatformAutoGen(AutoGen):
|
|||||||
self.BuildDatabase = Workspace.BuildDatabase
|
self.BuildDatabase = Workspace.BuildDatabase
|
||||||
self.DscBuildDataObj = Workspace.Platform
|
self.DscBuildDataObj = Workspace.Platform
|
||||||
|
|
||||||
# flag indicating if the makefile/C-code file has been created or not
|
# MakeFileName is used to get the Makefile name and as a flag
|
||||||
self.IsMakeFileCreated = False
|
# indicating whether the file has been created.
|
||||||
|
self.MakeFileName = ""
|
||||||
|
|
||||||
self._DynamicPcdList = None # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
|
self._DynamicPcdList = None # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
|
||||||
self._NonDynamicPcdList = None # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
|
self._NonDynamicPcdList = None # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
|
||||||
@@ -148,7 +150,7 @@ class PlatformAutoGen(AutoGen):
|
|||||||
#
|
#
|
||||||
@cached_class_function
|
@cached_class_function
|
||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
return hash((self.MetaFile, self.Arch))
|
return hash((self.MetaFile, self.Arch,self.ToolChain,self.BuildTarget))
|
||||||
@cached_class_function
|
@cached_class_function
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "%s [%s]" % (self.MetaFile, self.Arch)
|
return "%s [%s]" % (self.MetaFile, self.Arch)
|
||||||
@@ -191,16 +193,15 @@ class PlatformAutoGen(AutoGen):
|
|||||||
self.CreateLibModuelDirs()
|
self.CreateLibModuelDirs()
|
||||||
|
|
||||||
def CreateLibModuelDirs(self):
|
def CreateLibModuelDirs(self):
|
||||||
# no need to create makefile for the platform more than once
|
# No need to create makefile for the platform more than once.
|
||||||
if self.IsMakeFileCreated:
|
if self.MakeFileName:
|
||||||
return
|
return
|
||||||
|
|
||||||
# create library/module build dirs for platform
|
# create library/module build dirs for platform
|
||||||
Makefile = GenMake.PlatformMakefile(self)
|
Makefile = GenMake.PlatformMakefile(self)
|
||||||
self.LibraryBuildDirectoryList = Makefile.GetLibraryBuildDirectoryList()
|
self.LibraryBuildDirectoryList = Makefile.GetLibraryBuildDirectoryList()
|
||||||
self.ModuleBuildDirectoryList = Makefile.GetModuleBuildDirectoryList()
|
self.ModuleBuildDirectoryList = Makefile.GetModuleBuildDirectoryList()
|
||||||
|
self.MakeFileName = Makefile.getMakefileName()
|
||||||
self.IsMakeFileCreated = True
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def AllPcdList(self):
|
def AllPcdList(self):
|
||||||
|
@@ -23,6 +23,7 @@ from Common.StringUtils import NormPath
|
|||||||
from Common.BuildToolError import *
|
from Common.BuildToolError import *
|
||||||
from Common.DataType import *
|
from Common.DataType import *
|
||||||
from Common.Misc import *
|
from Common.Misc import *
|
||||||
|
import json
|
||||||
|
|
||||||
## Regular expression for splitting Dependency Expression string into tokens
|
## Regular expression for splitting Dependency Expression string into tokens
|
||||||
gDepexTokenPattern = re.compile("(\(|\)|\w+| \S+\.inf)")
|
gDepexTokenPattern = re.compile("(\(|\)|\w+| \S+\.inf)")
|
||||||
@@ -127,7 +128,7 @@ class WorkspaceAutoGen(AutoGen):
|
|||||||
|
|
||||||
self.CreateBuildOptionsFile()
|
self.CreateBuildOptionsFile()
|
||||||
self.CreatePcdTokenNumberFile()
|
self.CreatePcdTokenNumberFile()
|
||||||
self.CreateModuleHashInfo()
|
self.GeneratePlatformLevelHash()
|
||||||
|
|
||||||
#
|
#
|
||||||
# Merge Arch
|
# Merge Arch
|
||||||
@@ -165,7 +166,7 @@ class WorkspaceAutoGen(AutoGen):
|
|||||||
if Fdf.CurrentFdName and Fdf.CurrentFdName in Fdf.Profile.FdDict:
|
if Fdf.CurrentFdName and Fdf.CurrentFdName in Fdf.Profile.FdDict:
|
||||||
FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]
|
FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]
|
||||||
for FdRegion in FdDict.RegionList:
|
for FdRegion in FdDict.RegionList:
|
||||||
if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
|
if str(FdRegion.RegionType) == 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
|
||||||
if int(FdRegion.Offset) % 8 != 0:
|
if int(FdRegion.Offset) % 8 != 0:
|
||||||
EdkLogger.error("build", FORMAT_INVALID, 'The VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))
|
EdkLogger.error("build", FORMAT_INVALID, 'The VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))
|
||||||
FdfProfile = Fdf.Profile
|
FdfProfile = Fdf.Profile
|
||||||
@@ -528,12 +529,12 @@ class WorkspaceAutoGen(AutoGen):
|
|||||||
PcdTokenNumber += str(Pa.PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName])
|
PcdTokenNumber += str(Pa.PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName])
|
||||||
SaveFileOnChange(os.path.join(self.BuildDir, 'PcdTokenNumber'), PcdTokenNumber, False)
|
SaveFileOnChange(os.path.join(self.BuildDir, 'PcdTokenNumber'), PcdTokenNumber, False)
|
||||||
|
|
||||||
def CreateModuleHashInfo(self):
|
def GeneratePlatformLevelHash(self):
|
||||||
#
|
#
|
||||||
# Get set of workspace metafiles
|
# Get set of workspace metafiles
|
||||||
#
|
#
|
||||||
AllWorkSpaceMetaFiles = self._GetMetaFiles(self.BuildTarget, self.ToolChain)
|
AllWorkSpaceMetaFiles = self._GetMetaFiles(self.BuildTarget, self.ToolChain)
|
||||||
|
AllWorkSpaceMetaFileList = sorted(AllWorkSpaceMetaFiles, key=lambda x: str(x))
|
||||||
#
|
#
|
||||||
# Retrieve latest modified time of all metafiles
|
# Retrieve latest modified time of all metafiles
|
||||||
#
|
#
|
||||||
@@ -544,16 +545,35 @@ class WorkspaceAutoGen(AutoGen):
|
|||||||
self._SrcTimeStamp = SrcTimeStamp
|
self._SrcTimeStamp = SrcTimeStamp
|
||||||
|
|
||||||
if GlobalData.gUseHashCache:
|
if GlobalData.gUseHashCache:
|
||||||
|
FileList = []
|
||||||
m = hashlib.md5()
|
m = hashlib.md5()
|
||||||
for files in AllWorkSpaceMetaFiles:
|
for file in AllWorkSpaceMetaFileList:
|
||||||
if files.endswith('.dec'):
|
if file.endswith('.dec'):
|
||||||
continue
|
continue
|
||||||
f = open(files, 'rb')
|
f = open(file, 'rb')
|
||||||
Content = f.read()
|
Content = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
m.update(Content)
|
m.update(Content)
|
||||||
SaveFileOnChange(os.path.join(self.BuildDir, 'AutoGen.hash'), m.hexdigest(), False)
|
FileList.append((str(file), hashlib.md5(Content).hexdigest()))
|
||||||
GlobalData.gPlatformHash = m.hexdigest()
|
|
||||||
|
HashDir = path.join(self.BuildDir, "Hash_Platform")
|
||||||
|
HashFile = path.join(HashDir, 'Platform.hash.' + m.hexdigest())
|
||||||
|
SaveFileOnChange(HashFile, m.hexdigest(), False)
|
||||||
|
HashChainFile = path.join(HashDir, 'Platform.hashchain.' + m.hexdigest())
|
||||||
|
GlobalData.gPlatformHashFile = HashChainFile
|
||||||
|
try:
|
||||||
|
with open(HashChainFile, 'w') as f:
|
||||||
|
json.dump(FileList, f, indent=2)
|
||||||
|
except:
|
||||||
|
EdkLogger.quiet("[cache warning]: fail to save hashchain file:%s" % HashChainFile)
|
||||||
|
|
||||||
|
if GlobalData.gBinCacheDest:
|
||||||
|
# Copy platform hash files to cache destination
|
||||||
|
FileDir = path.join(GlobalData.gBinCacheDest, self.OutputDir, self.BuildTarget + "_" + self.ToolChain, "Hash_Platform")
|
||||||
|
CacheFileDir = FileDir
|
||||||
|
CreateDirectory(CacheFileDir)
|
||||||
|
CopyFileOnChange(HashFile, CacheFileDir)
|
||||||
|
CopyFileOnChange(HashChainFile, CacheFileDir)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Write metafile list to build directory
|
# Write metafile list to build directory
|
||||||
@@ -564,7 +584,7 @@ class WorkspaceAutoGen(AutoGen):
|
|||||||
if not os.path.exists(self.BuildDir):
|
if not os.path.exists(self.BuildDir):
|
||||||
os.makedirs(self.BuildDir)
|
os.makedirs(self.BuildDir)
|
||||||
with open(os.path.join(self.BuildDir, 'AutoGen'), 'w+') as file:
|
with open(os.path.join(self.BuildDir, 'AutoGen'), 'w+') as file:
|
||||||
for f in AllWorkSpaceMetaFiles:
|
for f in AllWorkSpaceMetaFileList:
|
||||||
print(f, file=file)
|
print(f, file=file)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -572,15 +592,16 @@ class WorkspaceAutoGen(AutoGen):
|
|||||||
if Pkg.PackageName in GlobalData.gPackageHash:
|
if Pkg.PackageName in GlobalData.gPackageHash:
|
||||||
return
|
return
|
||||||
|
|
||||||
PkgDir = os.path.join(self.BuildDir, Pkg.Arch, Pkg.PackageName)
|
PkgDir = os.path.join(self.BuildDir, Pkg.Arch, "Hash_Pkg", Pkg.PackageName)
|
||||||
CreateDirectory(PkgDir)
|
CreateDirectory(PkgDir)
|
||||||
HashFile = os.path.join(PkgDir, Pkg.PackageName + '.hash')
|
FileList = []
|
||||||
m = hashlib.md5()
|
m = hashlib.md5()
|
||||||
# Get .dec file's hash value
|
# Get .dec file's hash value
|
||||||
f = open(Pkg.MetaFile.Path, 'rb')
|
f = open(Pkg.MetaFile.Path, 'rb')
|
||||||
Content = f.read()
|
Content = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
m.update(Content)
|
m.update(Content)
|
||||||
|
FileList.append((str(Pkg.MetaFile.Path), hashlib.md5(Content).hexdigest()))
|
||||||
# Get include files hash value
|
# Get include files hash value
|
||||||
if Pkg.Includes:
|
if Pkg.Includes:
|
||||||
for inc in sorted(Pkg.Includes, key=lambda x: str(x)):
|
for inc in sorted(Pkg.Includes, key=lambda x: str(x)):
|
||||||
@@ -591,9 +612,28 @@ class WorkspaceAutoGen(AutoGen):
|
|||||||
Content = f.read()
|
Content = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
m.update(Content)
|
m.update(Content)
|
||||||
SaveFileOnChange(HashFile, m.hexdigest(), False)
|
FileList.append((str(File_Path), hashlib.md5(Content).hexdigest()))
|
||||||
GlobalData.gPackageHash[Pkg.PackageName] = m.hexdigest()
|
GlobalData.gPackageHash[Pkg.PackageName] = m.hexdigest()
|
||||||
|
|
||||||
|
HashDir = PkgDir
|
||||||
|
HashFile = path.join(HashDir, Pkg.PackageName + '.hash.' + m.hexdigest())
|
||||||
|
SaveFileOnChange(HashFile, m.hexdigest(), False)
|
||||||
|
HashChainFile = path.join(HashDir, Pkg.PackageName + '.hashchain.' + m.hexdigest())
|
||||||
|
GlobalData.gPackageHashFile[(Pkg.PackageName, Pkg.Arch)] = HashChainFile
|
||||||
|
try:
|
||||||
|
with open(HashChainFile, 'w') as f:
|
||||||
|
json.dump(FileList, f, indent=2)
|
||||||
|
except:
|
||||||
|
EdkLogger.quiet("[cache warning]: fail to save hashchain file:%s" % HashChainFile)
|
||||||
|
|
||||||
|
if GlobalData.gBinCacheDest:
|
||||||
|
# Copy Pkg hash files to cache destination dir
|
||||||
|
FileDir = path.join(GlobalData.gBinCacheDest, self.OutputDir, self.BuildTarget + "_" + self.ToolChain, Pkg.Arch, "Hash_Pkg", Pkg.PackageName)
|
||||||
|
CacheFileDir = FileDir
|
||||||
|
CreateDirectory(CacheFileDir)
|
||||||
|
CopyFileOnChange(HashFile, CacheFileDir)
|
||||||
|
CopyFileOnChange(HashChainFile, CacheFileDir)
|
||||||
|
|
||||||
def _GetMetaFiles(self, Target, Toolchain):
|
def _GetMetaFiles(self, Target, Toolchain):
|
||||||
AllWorkSpaceMetaFiles = set()
|
AllWorkSpaceMetaFiles = set()
|
||||||
#
|
#
|
||||||
|
@@ -31,6 +31,7 @@ import json
|
|||||||
from Common.Uefi.Capsule.UefiCapsuleHeader import UefiCapsuleHeaderClass
|
from Common.Uefi.Capsule.UefiCapsuleHeader import UefiCapsuleHeaderClass
|
||||||
from Common.Uefi.Capsule.FmpCapsuleHeader import FmpCapsuleHeaderClass
|
from Common.Uefi.Capsule.FmpCapsuleHeader import FmpCapsuleHeaderClass
|
||||||
from Common.Uefi.Capsule.FmpAuthHeader import FmpAuthHeaderClass
|
from Common.Uefi.Capsule.FmpAuthHeader import FmpAuthHeaderClass
|
||||||
|
from Common.Uefi.Capsule.CapsuleDependency import CapsuleDependencyClass
|
||||||
from Common.Edk2.Capsule.FmpPayloadHeader import FmpPayloadHeaderClass
|
from Common.Edk2.Capsule.FmpPayloadHeader import FmpPayloadHeaderClass
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -306,6 +307,7 @@ if __name__ == '__main__':
|
|||||||
OpenSslOtherPublicCertFile = ConvertJsonValue (Config, 'OpenSslOtherPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
OpenSslOtherPublicCertFile = ConvertJsonValue (Config, 'OpenSslOtherPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
OpenSslTrustedPublicCertFile = ConvertJsonValue (Config, 'OpenSslTrustedPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
OpenSslTrustedPublicCertFile = ConvertJsonValue (Config, 'OpenSslTrustedPublicCertFile', os.path.expandvars, Required = False, Default = None, Open = True)
|
||||||
SigningToolPath = ConvertJsonValue (Config, 'SigningToolPath', os.path.expandvars, Required = False, Default = None)
|
SigningToolPath = ConvertJsonValue (Config, 'SigningToolPath', os.path.expandvars, Required = False, Default = None)
|
||||||
|
DepexExp = ConvertJsonValue (Config, 'Dependencies', str, Required = False, Default = None)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Read binary input file
|
# Read binary input file
|
||||||
@@ -330,7 +332,8 @@ if __name__ == '__main__':
|
|||||||
OpenSslSignerPrivateCertFile,
|
OpenSslSignerPrivateCertFile,
|
||||||
OpenSslOtherPublicCertFile,
|
OpenSslOtherPublicCertFile,
|
||||||
OpenSslTrustedPublicCertFile,
|
OpenSslTrustedPublicCertFile,
|
||||||
SigningToolPath
|
SigningToolPath,
|
||||||
|
DepexExp
|
||||||
))
|
))
|
||||||
|
|
||||||
def GenerateOutputJson (PayloadJsonDescriptorList):
|
def GenerateOutputJson (PayloadJsonDescriptorList):
|
||||||
@@ -348,7 +351,8 @@ if __name__ == '__main__':
|
|||||||
"OpenSslSignerPrivateCertFile": str(PayloadDescriptor.OpenSslSignerPrivateCertFile),
|
"OpenSslSignerPrivateCertFile": str(PayloadDescriptor.OpenSslSignerPrivateCertFile),
|
||||||
"OpenSslOtherPublicCertFile": str(PayloadDescriptor.OpenSslOtherPublicCertFile),
|
"OpenSslOtherPublicCertFile": str(PayloadDescriptor.OpenSslOtherPublicCertFile),
|
||||||
"OpenSslTrustedPublicCertFile": str(PayloadDescriptor.OpenSslTrustedPublicCertFile),
|
"OpenSslTrustedPublicCertFile": str(PayloadDescriptor.OpenSslTrustedPublicCertFile),
|
||||||
"SigningToolPath": str(PayloadDescriptor.SigningToolPath)
|
"SigningToolPath": str(PayloadDescriptor.SigningToolPath),
|
||||||
|
"Dependencies" : str(PayloadDescriptor.DepexExp)
|
||||||
}for PayloadDescriptor in PayloadJsonDescriptorList
|
}for PayloadDescriptor in PayloadJsonDescriptorList
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -424,7 +428,8 @@ if __name__ == '__main__':
|
|||||||
OpenSslSignerPrivateCertFile = None,
|
OpenSslSignerPrivateCertFile = None,
|
||||||
OpenSslOtherPublicCertFile = None,
|
OpenSslOtherPublicCertFile = None,
|
||||||
OpenSslTrustedPublicCertFile = None,
|
OpenSslTrustedPublicCertFile = None,
|
||||||
SigningToolPath = None
|
SigningToolPath = None,
|
||||||
|
DepexExp = None
|
||||||
):
|
):
|
||||||
self.Payload = Payload
|
self.Payload = Payload
|
||||||
self.Guid = Guid
|
self.Guid = Guid
|
||||||
@@ -438,6 +443,7 @@ if __name__ == '__main__':
|
|||||||
self.OpenSslOtherPublicCertFile = OpenSslOtherPublicCertFile
|
self.OpenSslOtherPublicCertFile = OpenSslOtherPublicCertFile
|
||||||
self.OpenSslTrustedPublicCertFile = OpenSslTrustedPublicCertFile
|
self.OpenSslTrustedPublicCertFile = OpenSslTrustedPublicCertFile
|
||||||
self.SigningToolPath = SigningToolPath
|
self.SigningToolPath = SigningToolPath
|
||||||
|
self.DepexExp = DepexExp
|
||||||
|
|
||||||
self.UseSignTool = self.SignToolPfxFile is not None
|
self.UseSignTool = self.SignToolPfxFile is not None
|
||||||
self.UseOpenSsl = (self.OpenSslSignerPrivateCertFile is not None and
|
self.UseOpenSsl = (self.OpenSslSignerPrivateCertFile is not None and
|
||||||
@@ -446,6 +452,7 @@ if __name__ == '__main__':
|
|||||||
self.AnyOpenSsl = (self.OpenSslSignerPrivateCertFile is not None or
|
self.AnyOpenSsl = (self.OpenSslSignerPrivateCertFile is not None or
|
||||||
self.OpenSslOtherPublicCertFile is not None or
|
self.OpenSslOtherPublicCertFile is not None or
|
||||||
self.OpenSslTrustedPublicCertFile is not None)
|
self.OpenSslTrustedPublicCertFile is not None)
|
||||||
|
self.UseDependency = self.DepexExp is not None
|
||||||
|
|
||||||
def Validate(self, args):
|
def Validate(self, args):
|
||||||
if self.UseSignTool and self.AnyOpenSsl:
|
if self.UseSignTool and self.AnyOpenSsl:
|
||||||
@@ -544,7 +551,8 @@ if __name__ == '__main__':
|
|||||||
args.OpenSslSignerPrivateCertFile,
|
args.OpenSslSignerPrivateCertFile,
|
||||||
args.OpenSslOtherPublicCertFile,
|
args.OpenSslOtherPublicCertFile,
|
||||||
args.OpenSslTrustedPublicCertFile,
|
args.OpenSslTrustedPublicCertFile,
|
||||||
args.SigningToolPath
|
args.SigningToolPath,
|
||||||
|
None
|
||||||
))
|
))
|
||||||
for SinglePayloadDescriptor in PayloadDescriptorList:
|
for SinglePayloadDescriptor in PayloadDescriptorList:
|
||||||
try:
|
try:
|
||||||
@@ -564,6 +572,12 @@ if __name__ == '__main__':
|
|||||||
except:
|
except:
|
||||||
print ('GenerateCapsule: error: can not encode FMP Payload Header')
|
print ('GenerateCapsule: error: can not encode FMP Payload Header')
|
||||||
sys.exit (1)
|
sys.exit (1)
|
||||||
|
if SinglePayloadDescriptor.UseDependency:
|
||||||
|
CapsuleDependency.Payload = Result
|
||||||
|
CapsuleDependency.DepexExp = SinglePayloadDescriptor.DepexExp
|
||||||
|
Result = CapsuleDependency.Encode ()
|
||||||
|
if args.Verbose:
|
||||||
|
CapsuleDependency.DumpInfo ()
|
||||||
if SinglePayloadDescriptor.UseOpenSsl or SinglePayloadDescriptor.UseSignTool:
|
if SinglePayloadDescriptor.UseOpenSsl or SinglePayloadDescriptor.UseSignTool:
|
||||||
#
|
#
|
||||||
# Sign image with 64-bit MonotonicCount appended to end of image
|
# Sign image with 64-bit MonotonicCount appended to end of image
|
||||||
@@ -657,7 +671,8 @@ if __name__ == '__main__':
|
|||||||
args.OpenSslSignerPrivateCertFile,
|
args.OpenSslSignerPrivateCertFile,
|
||||||
args.OpenSslOtherPublicCertFile,
|
args.OpenSslOtherPublicCertFile,
|
||||||
args.OpenSslTrustedPublicCertFile,
|
args.OpenSslTrustedPublicCertFile,
|
||||||
args.SigningToolPath
|
args.SigningToolPath,
|
||||||
|
None
|
||||||
))
|
))
|
||||||
#
|
#
|
||||||
# Perform additional verification on payload descriptors
|
# Perform additional verification on payload descriptors
|
||||||
@@ -700,7 +715,8 @@ if __name__ == '__main__':
|
|||||||
PayloadDescriptorList[Index].OpenSslSignerPrivateCertFile,
|
PayloadDescriptorList[Index].OpenSslSignerPrivateCertFile,
|
||||||
PayloadDescriptorList[Index].OpenSslOtherPublicCertFile,
|
PayloadDescriptorList[Index].OpenSslOtherPublicCertFile,
|
||||||
PayloadDescriptorList[Index].OpenSslTrustedPublicCertFile,
|
PayloadDescriptorList[Index].OpenSslTrustedPublicCertFile,
|
||||||
PayloadDescriptorList[Index].SigningToolPath
|
PayloadDescriptorList[Index].SigningToolPath,
|
||||||
|
None
|
||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
PayloadDescriptorList[0].Payload = FmpCapsuleHeader.GetFmpCapsuleImageHeader (0).Payload
|
PayloadDescriptorList[0].Payload = FmpCapsuleHeader.GetFmpCapsuleImageHeader (0).Payload
|
||||||
@@ -718,6 +734,7 @@ if __name__ == '__main__':
|
|||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
|
None,
|
||||||
None
|
None
|
||||||
))
|
))
|
||||||
GUID = FmpCapsuleHeader.GetFmpCapsuleImageHeader (Index).UpdateImageTypeId
|
GUID = FmpCapsuleHeader.GetFmpCapsuleImageHeader (Index).UpdateImageTypeId
|
||||||
@@ -736,7 +753,8 @@ if __name__ == '__main__':
|
|||||||
PayloadDescriptorList[Index].OpenSslSignerPrivateCertFile,
|
PayloadDescriptorList[Index].OpenSslSignerPrivateCertFile,
|
||||||
PayloadDescriptorList[Index].OpenSslOtherPublicCertFile,
|
PayloadDescriptorList[Index].OpenSslOtherPublicCertFile,
|
||||||
PayloadDescriptorList[Index].OpenSslTrustedPublicCertFile,
|
PayloadDescriptorList[Index].OpenSslTrustedPublicCertFile,
|
||||||
PayloadDescriptorList[Index].SigningToolPath
|
PayloadDescriptorList[Index].SigningToolPath,
|
||||||
|
None
|
||||||
))
|
))
|
||||||
JsonIndex = 0
|
JsonIndex = 0
|
||||||
for SinglePayloadDescriptor in PayloadDescriptorList:
|
for SinglePayloadDescriptor in PayloadDescriptorList:
|
||||||
@@ -782,6 +800,23 @@ if __name__ == '__main__':
|
|||||||
if args.Verbose:
|
if args.Verbose:
|
||||||
print ('--------')
|
print ('--------')
|
||||||
print ('No EFI_FIRMWARE_IMAGE_AUTHENTICATION')
|
print ('No EFI_FIRMWARE_IMAGE_AUTHENTICATION')
|
||||||
|
|
||||||
|
PayloadSignature = struct.unpack ('<I', SinglePayloadDescriptor.Payload[0:4])
|
||||||
|
if PayloadSignature != FmpPayloadHeader.Signature:
|
||||||
|
SinglePayloadDescriptor.UseDependency = True
|
||||||
|
try:
|
||||||
|
SinglePayloadDescriptor.Payload = CapsuleDependency.Decode (SinglePayloadDescriptor.Payload)
|
||||||
|
PayloadJsonDescriptorList[JsonIndex].DepexExp = CapsuleDependency.DepexExp
|
||||||
|
if args.Verbose:
|
||||||
|
print ('--------')
|
||||||
|
CapsuleDependency.DumpInfo ()
|
||||||
|
except Exception as Msg:
|
||||||
|
print ('GenerateCapsule: error: invalid dependency expression')
|
||||||
|
else:
|
||||||
|
if args.Verbose:
|
||||||
|
print ('--------')
|
||||||
|
print ('No EFI_FIRMWARE_IMAGE_DEP')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
SinglePayloadDescriptor.Payload = FmpPayloadHeader.Decode (SinglePayloadDescriptor.Payload)
|
SinglePayloadDescriptor.Payload = FmpPayloadHeader.Decode (SinglePayloadDescriptor.Payload)
|
||||||
PayloadJsonDescriptorList[JsonIndex].FwVersion = FmpPayloadHeader.FwVersion
|
PayloadJsonDescriptorList[JsonIndex].FwVersion = FmpPayloadHeader.FwVersion
|
||||||
@@ -852,6 +887,18 @@ if __name__ == '__main__':
|
|||||||
except:
|
except:
|
||||||
print ('--------')
|
print ('--------')
|
||||||
print ('No EFI_FIRMWARE_IMAGE_AUTHENTICATION')
|
print ('No EFI_FIRMWARE_IMAGE_AUTHENTICATION')
|
||||||
|
|
||||||
|
PayloadSignature = struct.unpack ('<I', Result[0:4])
|
||||||
|
if PayloadSignature != FmpPayloadHeader.Signature:
|
||||||
|
try:
|
||||||
|
Result = CapsuleDependency.Decode (Result)
|
||||||
|
print ('--------')
|
||||||
|
CapsuleDependency.DumpInfo ()
|
||||||
|
except:
|
||||||
|
print ('GenerateCapsule: error: invalid dependency expression')
|
||||||
|
else:
|
||||||
|
print ('--------')
|
||||||
|
print ('No EFI_FIRMWARE_IMAGE_DEP')
|
||||||
try:
|
try:
|
||||||
Result = FmpPayloadHeader.Decode (Result)
|
Result = FmpPayloadHeader.Decode (Result)
|
||||||
print ('--------')
|
print ('--------')
|
||||||
@@ -973,6 +1020,7 @@ if __name__ == '__main__':
|
|||||||
FmpCapsuleHeader = FmpCapsuleHeaderClass ()
|
FmpCapsuleHeader = FmpCapsuleHeaderClass ()
|
||||||
FmpAuthHeader = FmpAuthHeaderClass ()
|
FmpAuthHeader = FmpAuthHeaderClass ()
|
||||||
FmpPayloadHeader = FmpPayloadHeaderClass ()
|
FmpPayloadHeader = FmpPayloadHeaderClass ()
|
||||||
|
CapsuleDependency = CapsuleDependencyClass ()
|
||||||
|
|
||||||
EmbeddedDriverDescriptorList = []
|
EmbeddedDriverDescriptorList = []
|
||||||
PayloadDescriptorList = []
|
PayloadDescriptorList = []
|
||||||
|
@@ -70,7 +70,7 @@ gAutoGenPhase = False
|
|||||||
# The Conf dir outside the workspace dir
|
# The Conf dir outside the workspace dir
|
||||||
#
|
#
|
||||||
gConfDirectory = ''
|
gConfDirectory = ''
|
||||||
|
gCmdConfDir = ''
|
||||||
gBuildDirectory = ''
|
gBuildDirectory = ''
|
||||||
#
|
#
|
||||||
# The relative default database file path
|
# The relative default database file path
|
||||||
@@ -104,29 +104,20 @@ gUseHashCache = None
|
|||||||
gBinCacheDest = None
|
gBinCacheDest = None
|
||||||
gBinCacheSource = None
|
gBinCacheSource = None
|
||||||
gPlatformHash = None
|
gPlatformHash = None
|
||||||
gPackageHash = {}
|
gPlatformHashFile = None
|
||||||
gModuleHash = {}
|
gPackageHash = None
|
||||||
|
gPackageHashFile = None
|
||||||
|
gModuleHashFile = None
|
||||||
|
gCMakeHashFile = None
|
||||||
|
gHashChainStatus = None
|
||||||
|
gModulePreMakeCacheStatus = None
|
||||||
|
gModuleMakeCacheStatus = None
|
||||||
|
gFileHashDict = None
|
||||||
|
gModuleAllCacheStatus = None
|
||||||
|
gModuleCacheHit = None
|
||||||
|
|
||||||
gEnableGenfdsMultiThread = True
|
gEnableGenfdsMultiThread = True
|
||||||
gSikpAutoGenCache = set()
|
gSikpAutoGenCache = set()
|
||||||
|
|
||||||
# Dictionary for tracking Module build status as success or failure
|
|
||||||
# Top Dict: Key: Arch Type Value: Dictionary
|
|
||||||
# Second Dict: Key: AutoGen Obj Value: 'SUCCESS'\'FAIL'\'FAIL_METAFILE'
|
|
||||||
gModuleBuildTracking = dict()
|
|
||||||
|
|
||||||
# Dictionary of booleans that dictate whether a module or
|
|
||||||
# library can be skiped
|
|
||||||
# Top Dict: Key: Arch Type Value: Dictionary
|
|
||||||
# Second Dict: Key: Module\Library Name Value: True\False
|
|
||||||
gBuildHashSkipTracking = dict()
|
|
||||||
|
|
||||||
# Common dictionary to share module cache intermediate result and state
|
|
||||||
gCacheIR = None
|
|
||||||
# Common lock for the module cache intermediate data
|
|
||||||
cache_lock = None
|
|
||||||
# Common lock for the file access in multiple process AutoGens
|
# Common lock for the file access in multiple process AutoGens
|
||||||
file_lock = None
|
file_lock = None
|
||||||
# Common dictionary to share platform libraries' constant Pcd
|
|
||||||
libConstPcd = None
|
|
||||||
# Common dictionary to share platform libraries' reference info
|
|
||||||
Refes = None
|
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
from Common.buildoptions import BuildOption,BuildTarget
|
|
||||||
import Common.GlobalData as GlobalData
|
import Common.GlobalData as GlobalData
|
||||||
import Common.LongFilePathOs as os
|
import Common.LongFilePathOs as os
|
||||||
from . import EdkLogger
|
from . import EdkLogger
|
||||||
@@ -144,11 +144,31 @@ class TargetTxtClassObject(object):
|
|||||||
#
|
#
|
||||||
# @retval Target An instance of TargetTxtClassObject() with loaded target.txt
|
# @retval Target An instance of TargetTxtClassObject() with loaded target.txt
|
||||||
#
|
#
|
||||||
def TargetTxtDict():
|
|
||||||
|
class TargetTxtDict():
|
||||||
|
|
||||||
|
def __new__(cls, *args, **kw):
|
||||||
|
if not hasattr(cls, '_instance'):
|
||||||
|
orig = super(TargetTxtDict, cls)
|
||||||
|
cls._instance = orig.__new__(cls, *args, **kw)
|
||||||
|
return cls._instance
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
if not hasattr(self, 'Target'):
|
||||||
|
self.TxtTarget = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def Target(self):
|
||||||
|
if not self.TxtTarget:
|
||||||
|
self._GetTarget()
|
||||||
|
return self.TxtTarget
|
||||||
|
|
||||||
|
def _GetTarget(self):
|
||||||
Target = TargetTxtClassObject()
|
Target = TargetTxtClassObject()
|
||||||
if BuildOption.ConfDirectory:
|
ConfDirectory = GlobalData.gCmdConfDir
|
||||||
|
if ConfDirectory:
|
||||||
# Get alternate Conf location, if it is absolute, then just use the absolute directory name
|
# Get alternate Conf location, if it is absolute, then just use the absolute directory name
|
||||||
ConfDirectoryPath = os.path.normpath(BuildOption.ConfDirectory)
|
ConfDirectoryPath = os.path.normpath(ConfDirectory)
|
||||||
|
|
||||||
if not os.path.isabs(ConfDirectoryPath):
|
if not os.path.isabs(ConfDirectoryPath):
|
||||||
# Since alternate directory name is not absolute, the alternate directory is located within the WORKSPACE
|
# Since alternate directory name is not absolute, the alternate directory is located within the WORKSPACE
|
||||||
@@ -164,9 +184,7 @@ def TargetTxtDict():
|
|||||||
targettxt = os.path.normpath(os.path.join(ConfDirectoryPath, gDefaultTargetTxtFile))
|
targettxt = os.path.normpath(os.path.join(ConfDirectoryPath, gDefaultTargetTxtFile))
|
||||||
if os.path.exists(targettxt):
|
if os.path.exists(targettxt):
|
||||||
Target.LoadTargetTxtFile(targettxt)
|
Target.LoadTargetTxtFile(targettxt)
|
||||||
return Target
|
self.TxtTarget = Target
|
||||||
|
|
||||||
TargetTxt = TargetTxtDict()
|
|
||||||
|
|
||||||
##
|
##
|
||||||
#
|
#
|
||||||
|
@@ -14,7 +14,7 @@ import re
|
|||||||
from . import EdkLogger
|
from . import EdkLogger
|
||||||
|
|
||||||
from .BuildToolError import *
|
from .BuildToolError import *
|
||||||
from Common.TargetTxtClassObject import TargetTxt
|
from Common.TargetTxtClassObject import TargetTxtDict
|
||||||
from Common.LongFilePathSupport import OpenLongFilePath as open
|
from Common.LongFilePathSupport import OpenLongFilePath as open
|
||||||
from Common.Misc import PathClass
|
from Common.Misc import PathClass
|
||||||
from Common.StringUtils import NormPath
|
from Common.StringUtils import NormPath
|
||||||
@@ -262,20 +262,40 @@ class ToolDefClassObject(object):
|
|||||||
#
|
#
|
||||||
# @retval ToolDef An instance of ToolDefClassObject() with loaded tools_def.txt
|
# @retval ToolDef An instance of ToolDefClassObject() with loaded tools_def.txt
|
||||||
#
|
#
|
||||||
def ToolDefDict(ConfDir):
|
|
||||||
Target = TargetTxt
|
|
||||||
|
class ToolDefDict():
|
||||||
|
|
||||||
|
def __new__(cls, ConfDir, *args, **kw):
|
||||||
|
if not hasattr(cls, '_instance'):
|
||||||
|
orig = super(ToolDefDict, cls)
|
||||||
|
cls._instance = orig.__new__(cls, *args, **kw)
|
||||||
|
return cls._instance
|
||||||
|
|
||||||
|
def __init__(self, ConfDir):
|
||||||
|
self.ConfDir = ConfDir
|
||||||
|
if not hasattr(self, 'ToolDef'):
|
||||||
|
self._ToolDef = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ToolDef(self):
|
||||||
|
if not self._ToolDef:
|
||||||
|
self._GetToolDef()
|
||||||
|
return self._ToolDef
|
||||||
|
|
||||||
|
def _GetToolDef(self):
|
||||||
|
TargetObj = TargetTxtDict()
|
||||||
|
Target = TargetObj.Target
|
||||||
ToolDef = ToolDefClassObject()
|
ToolDef = ToolDefClassObject()
|
||||||
if TAB_TAT_DEFINES_TOOL_CHAIN_CONF in Target.TargetTxtDictionary:
|
if TAB_TAT_DEFINES_TOOL_CHAIN_CONF in Target.TargetTxtDictionary:
|
||||||
ToolsDefFile = Target.TargetTxtDictionary[TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
|
ToolsDefFile = Target.TargetTxtDictionary[TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
|
||||||
if ToolsDefFile:
|
if ToolsDefFile:
|
||||||
ToolDef.LoadToolDefFile(os.path.normpath(ToolsDefFile))
|
ToolDef.LoadToolDefFile(os.path.normpath(ToolsDefFile))
|
||||||
else:
|
else:
|
||||||
ToolDef.LoadToolDefFile(os.path.normpath(os.path.join(ConfDir, gDefaultToolsDefFile)))
|
ToolDef.LoadToolDefFile(os.path.normpath(os.path.join(self.ConfDir, gDefaultToolsDefFile)))
|
||||||
else:
|
else:
|
||||||
ToolDef.LoadToolDefFile(os.path.normpath(os.path.join(ConfDir, gDefaultToolsDefFile)))
|
ToolDef.LoadToolDefFile(os.path.normpath(os.path.join(self.ConfDir, gDefaultToolsDefFile)))
|
||||||
return ToolDef
|
self._ToolDef = ToolDef
|
||||||
|
|
||||||
ToolDef = ToolDefDict((os.path.join(os.getenv("WORKSPACE"),"Conf")))
|
|
||||||
|
|
||||||
##
|
##
|
||||||
#
|
#
|
||||||
|
409
BaseTools/Source/Python/Common/Uefi/Capsule/CapsuleDependency.py
Normal file
409
BaseTools/Source/Python/Common/Uefi/Capsule/CapsuleDependency.py
Normal file
@@ -0,0 +1,409 @@
|
|||||||
|
## @file
|
||||||
|
# Module that encodes and decodes a capsule dependency.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
import struct
|
||||||
|
import json
|
||||||
|
import sys
|
||||||
|
import uuid
|
||||||
|
import re
|
||||||
|
|
||||||
|
'''
|
||||||
|
CapsuleDependency
|
||||||
|
'''
|
||||||
|
|
||||||
|
class OpConvert (object):
|
||||||
|
def __init__ (self):
|
||||||
|
# Opcode: (OperandSize, PackSize, PackFmt, EncodeConvert, DecodeConvert)
|
||||||
|
self._DepexOperations = {0x00: (16, 16, 's', self.Str2Guid, self.Guid2Str),
|
||||||
|
0x01: (4, 1, 'I', self.Str2Uint, self.Uint2Str),
|
||||||
|
0x02: (1, 0, 's', self.Str2Utf8, self.Byte2Str),
|
||||||
|
}
|
||||||
|
|
||||||
|
def Str2Uint (self, Data):
|
||||||
|
try:
|
||||||
|
Value = int (Data, 16)
|
||||||
|
except:
|
||||||
|
Message = '{Data} is not a valid integer value.'.format (Data = Data)
|
||||||
|
raise ValueError (Message)
|
||||||
|
if Value < 0 or Value > 0xFFFFFFFF:
|
||||||
|
Message = '{Data} is not an UINT32.'.format (Data = Data)
|
||||||
|
raise ValueError (Message)
|
||||||
|
return Value
|
||||||
|
|
||||||
|
def Uint2Str (self, Data):
|
||||||
|
if Data < 0 or Data > 0xFFFFFFFF:
|
||||||
|
Message = '{Data} is not an UINT32.'.format (Data = Data)
|
||||||
|
raise ValueError (Message)
|
||||||
|
return "0x{Data:08x}".format (Data = Data)
|
||||||
|
|
||||||
|
def Str2Guid (self, Data):
|
||||||
|
try:
|
||||||
|
Guid = uuid.UUID (Data)
|
||||||
|
except:
|
||||||
|
Message = '{Data} is not a valid registry format GUID value.'.format (Data = Data)
|
||||||
|
raise ValueError (Message)
|
||||||
|
return Guid.bytes_le
|
||||||
|
|
||||||
|
def Guid2Str (self, Data):
|
||||||
|
try:
|
||||||
|
Guid = uuid.UUID (bytes_le = Data)
|
||||||
|
except:
|
||||||
|
Message = '{Data} is not a valid binary format GUID value.'.format (Data = Data)
|
||||||
|
raise ValueError (Message)
|
||||||
|
return str (Guid).upper ()
|
||||||
|
|
||||||
|
def Str2Utf8 (self, Data):
|
||||||
|
if isinstance (Data, str):
|
||||||
|
return Data.encode ('utf-8')
|
||||||
|
else:
|
||||||
|
Message = '{Data} is not a valid string.'.format (Data = Data)
|
||||||
|
raise ValueError (Message)
|
||||||
|
|
||||||
|
def Byte2Str (self, Data):
|
||||||
|
if isinstance (Data, bytes):
|
||||||
|
if Data[-1:] == b'\x00':
|
||||||
|
return str (Data[:-1], 'utf-8')
|
||||||
|
else:
|
||||||
|
return str (Data, 'utf-8')
|
||||||
|
else:
|
||||||
|
Message = '{Data} is not a valid binary string.'.format (Data = Data)
|
||||||
|
raise ValueError (Message)
|
||||||
|
|
||||||
|
def OpEncode (self, Opcode, Operand = None):
|
||||||
|
BinTemp = struct.pack ('<b', Opcode)
|
||||||
|
if Opcode <= 0x02 and Operand != None:
|
||||||
|
OperandSize, PackSize, PackFmt, EncodeConvert, DecodeConvert = self._DepexOperations[Opcode]
|
||||||
|
Value = EncodeConvert (Operand)
|
||||||
|
if Opcode == 0x02:
|
||||||
|
PackSize = len (Value) + 1
|
||||||
|
BinTemp += struct.pack ('<{PackSize}{PackFmt}'.format (PackSize = PackSize, PackFmt = PackFmt), Value)
|
||||||
|
return BinTemp
|
||||||
|
|
||||||
|
def OpDecode (self, Buffer):
|
||||||
|
Opcode = struct.unpack ('<b', Buffer[0:1])[0]
|
||||||
|
if Opcode <= 0x02:
|
||||||
|
OperandSize, PackSize, PackFmt, EncodeConvert, DecodeConvert = self._DepexOperations[Opcode]
|
||||||
|
if Opcode == 0x02:
|
||||||
|
try:
|
||||||
|
PackSize = Buffer[1:].index (b'\x00') + 1
|
||||||
|
OperandSize = PackSize
|
||||||
|
except:
|
||||||
|
Message = 'CapsuleDependency: OpConvert: error: decode failed with wrong opcode/string.'
|
||||||
|
raise ValueError (Message)
|
||||||
|
try:
|
||||||
|
Operand = DecodeConvert (struct.unpack ('<{PackSize}{PackFmt}'.format (PackSize = PackSize, PackFmt = PackFmt), Buffer[1:1+OperandSize])[0])
|
||||||
|
except:
|
||||||
|
Message = 'CapsuleDependency: OpConvert: error: decode failed with unpack failure.'
|
||||||
|
raise ValueError (Message)
|
||||||
|
else:
|
||||||
|
Operand = None
|
||||||
|
OperandSize = 0
|
||||||
|
return (Opcode, Operand, OperandSize)
|
||||||
|
|
||||||
|
class CapsuleDependencyClass (object):
|
||||||
|
# //**************************************************************
|
||||||
|
# // Image Attribute - Dependency
|
||||||
|
# //**************************************************************
|
||||||
|
# typedef struct {
|
||||||
|
# UINT8 Dependencies[];
|
||||||
|
# } EFI_FIRMWARE_IMAGE_DEP
|
||||||
|
|
||||||
|
# {expression operator : [precedence, opcode, type (1:unary/2:binocular)]}
|
||||||
|
_opReference = {'&&': [2, 0x03, 2],
|
||||||
|
'||': [1, 0x04, 2],
|
||||||
|
'~': [5, 0x05, 1],
|
||||||
|
'==': [3, 0x08, 2],
|
||||||
|
'>': [4, 0x09, 2],
|
||||||
|
'>=': [4, 0x0A, 2],
|
||||||
|
'<': [4, 0x0B, 2],
|
||||||
|
'<=': [4, 0x0C, 2],
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__ (self):
|
||||||
|
self.Payload = b''
|
||||||
|
self._DepexExp = None
|
||||||
|
self._DepexList = []
|
||||||
|
self._DepexDump = []
|
||||||
|
self.Depex = b''
|
||||||
|
self._Valid = False
|
||||||
|
self._DepexSize = 0
|
||||||
|
self._opReferenceReverse = {v[1] : k for k, v in self._opReference.items ()}
|
||||||
|
self.OpConverter = OpConvert ()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def DepexExp (self):
|
||||||
|
return self._DepexExp
|
||||||
|
|
||||||
|
@DepexExp.setter
|
||||||
|
def DepexExp (self, DepexExp = ''):
|
||||||
|
if isinstance (DepexExp, str):
|
||||||
|
DepexExp = re.sub (r'\n',r' ',DepexExp)
|
||||||
|
DepexExp = re.sub (r'\(',r' ( ',DepexExp)
|
||||||
|
DepexExp = re.sub (r'\)',r' ) ',DepexExp)
|
||||||
|
DepexExp = re.sub (r'~',r' ~ ',DepexExp)
|
||||||
|
self._DepexList = re.findall(r"[^\s\"\']+|\"[^\"]*\"|\'[^\']*\'",DepexExp)
|
||||||
|
self._DepexExp = " ".join(self._DepexList)
|
||||||
|
|
||||||
|
else:
|
||||||
|
Msg = 'Input Depex Expression is not valid string.'
|
||||||
|
raise ValueError (Msg)
|
||||||
|
|
||||||
|
def IsValidOperator (self, op):
|
||||||
|
return op in self._opReference.keys ()
|
||||||
|
|
||||||
|
def IsValidUnaryOperator (self, op):
|
||||||
|
return op in self._opReference.keys () and self._opReference[op][2] == 1
|
||||||
|
|
||||||
|
def IsValidBinocularOperator (self, op):
|
||||||
|
return op in self._opReference.keys () and self._opReference[op][2] == 2
|
||||||
|
|
||||||
|
def IsValidGuid (self, operand):
|
||||||
|
try:
|
||||||
|
uuid.UUID (operand)
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
def IsValidVersion (self, operand):
|
||||||
|
try:
|
||||||
|
Value = int (operand, 16)
|
||||||
|
if Value < 0 or Value > 0xFFFFFFFF:
|
||||||
|
return False
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
def IsValidBoolean (self, operand):
|
||||||
|
try:
|
||||||
|
return operand.upper () in ['TRUE', 'FALSE']
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def IsValidOperand (self, operand):
|
||||||
|
return self.IsValidVersion (operand) or self.IsValidGuid (operand) or self.IsValidBoolean (operand)
|
||||||
|
|
||||||
|
def IsValidString (self, operand):
|
||||||
|
return operand[0] == "\"" and operand[-1] == "\"" and len(operand) >= 2
|
||||||
|
|
||||||
|
# Check if priority of current operater is greater than pervious op
|
||||||
|
def PriorityNotGreater (self, prevOp, currOp):
|
||||||
|
return self._opReference[currOp][0] <= self._opReference[prevOp][0]
|
||||||
|
|
||||||
|
def ValidateDepex (self):
|
||||||
|
OpList = self._DepexList
|
||||||
|
|
||||||
|
i = 0
|
||||||
|
while i < len (OpList):
|
||||||
|
Op = OpList[i]
|
||||||
|
|
||||||
|
if Op == 'DECLARE':
|
||||||
|
i += 1
|
||||||
|
if i >= len (OpList):
|
||||||
|
Msg = 'No more Operand after {Op}.'.format (Op = OpList[i-1])
|
||||||
|
raise IndexError (Msg)
|
||||||
|
# Check valid string
|
||||||
|
if not self.IsValidString(OpList[i]):
|
||||||
|
Msg = '{Operand} after {Op} is not a valid expression input.'.format (Operand = OpList[i], Op = OpList[i-1])
|
||||||
|
raise ValueError (Msg)
|
||||||
|
|
||||||
|
elif Op == '(':
|
||||||
|
# Expression cannot end with (
|
||||||
|
if i == len (OpList) - 1:
|
||||||
|
Msg = 'Expression cannot end with \'(\''
|
||||||
|
raise ValueError (Msg)
|
||||||
|
# The previous op after '(' cannot be a binocular operator
|
||||||
|
if self.IsValidBinocularOperator (OpList[i+1]) :
|
||||||
|
Msg = '{Op} after \'(\' is not a valid expression input.'.format (Op = OpList[i+1])
|
||||||
|
raise ValueError (Msg)
|
||||||
|
|
||||||
|
elif Op == ')':
|
||||||
|
# Expression cannot start with )
|
||||||
|
if i == 0:
|
||||||
|
Msg = 'Expression cannot start with \')\''
|
||||||
|
raise ValueError (Msg)
|
||||||
|
# The previous op before ')' cannot be an operator
|
||||||
|
if self.IsValidOperator (OpList[i-1]):
|
||||||
|
Msg = '{Op} before \')\' is not a valid expression input.'.format (Op = OpList[i-1])
|
||||||
|
raise ValueError (Msg)
|
||||||
|
# The next op after ')' cannot be operand or unary operator
|
||||||
|
if (i + 1) < len (OpList) and (self.IsValidOperand (OpList[i+1]) or self.IsValidUnaryOperator (OpList[i+1])):
|
||||||
|
Msg = '{Op} after \')\' is not a valid expression input.'.format (Op = OpList[i+1])
|
||||||
|
raise ValueError (Msg)
|
||||||
|
|
||||||
|
elif self.IsValidOperand (Op):
|
||||||
|
# The next expression of operand cannot be operand or unary operator
|
||||||
|
if (i + 1) < len (OpList) and (self.IsValidOperand (OpList[i+1]) or self.IsValidUnaryOperator (OpList[i+1])):
|
||||||
|
Msg = '{Op} after {PrevOp} is not a valid expression input.'.format (Op = OpList[i+1], PrevOp = Op)
|
||||||
|
raise ValueError (Msg)
|
||||||
|
|
||||||
|
elif self.IsValidOperator (Op):
|
||||||
|
# The next op of operator cannot binocular operator
|
||||||
|
if (i + 1) < len (OpList) and self.IsValidBinocularOperator (OpList[i+1]):
|
||||||
|
Msg = '{Op} after {PrevOp} is not a valid expression input.'.format (Op = OpList[i+1], PrevOp = Op)
|
||||||
|
raise ValueError (Msg)
|
||||||
|
# The first op can not be binocular operator
|
||||||
|
if i == 0 and self.IsValidBinocularOperator (Op):
|
||||||
|
Msg = 'Expression cannot start with an operator {Op}.'.format (Op = Op)
|
||||||
|
raise ValueError (Msg)
|
||||||
|
# The last op can not be operator
|
||||||
|
if i == len (OpList) - 1:
|
||||||
|
Msg = 'Expression cannot ended with an operator {Op}.'.format (Op = Op)
|
||||||
|
raise ValueError (Msg)
|
||||||
|
# The next op of unary operator cannot be guid / version
|
||||||
|
if self.IsValidUnaryOperator (Op) and (self.IsValidGuid (OpList[i+1]) or self.IsValidVersion (OpList[i+1])):
|
||||||
|
Msg = '{Op} after {PrevOp} is not a valid expression input.'.format (Op = OpList[i+1], PrevOp = Op)
|
||||||
|
raise ValueError (Msg)
|
||||||
|
|
||||||
|
else:
|
||||||
|
Msg = '{Op} is not a valid expression input.'.format (Op = Op)
|
||||||
|
raise ValueError (Msg)
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
def Encode (self):
|
||||||
|
# initialize
|
||||||
|
self.Depex = b''
|
||||||
|
self._DepexDump = []
|
||||||
|
OperandStack = []
|
||||||
|
OpeartorStack = []
|
||||||
|
OpList = self._DepexList
|
||||||
|
|
||||||
|
self.ValidateDepex ()
|
||||||
|
|
||||||
|
# convert
|
||||||
|
i = 0
|
||||||
|
while i < len (OpList):
|
||||||
|
Op = OpList[i]
|
||||||
|
if Op == 'DECLARE':
|
||||||
|
# This declare next expression value is a VERSION_STRING
|
||||||
|
i += 1
|
||||||
|
self.Depex += self.OpConverter.OpEncode (0x02, OpList[i][1:-1])
|
||||||
|
|
||||||
|
elif Op == '(':
|
||||||
|
OpeartorStack.append (Op)
|
||||||
|
|
||||||
|
elif Op == ')':
|
||||||
|
while (OpeartorStack and OpeartorStack[-1] != '('):
|
||||||
|
Operator = OpeartorStack.pop ()
|
||||||
|
self.Depex += self.OpConverter.OpEncode (self._opReference[Operator][1])
|
||||||
|
try:
|
||||||
|
OpeartorStack.pop () # pop out '('
|
||||||
|
except:
|
||||||
|
Msg = 'Pop out \'(\' failed, too many \')\''
|
||||||
|
raise ValueError (Msg)
|
||||||
|
|
||||||
|
elif self.IsValidGuid (Op):
|
||||||
|
if not OperandStack:
|
||||||
|
OperandStack.append (self.OpConverter.OpEncode (0x00, Op))
|
||||||
|
else:
|
||||||
|
# accroding to uefi spec 2.8, the guid/version operands is a reversed order in firmware comparison.
|
||||||
|
self.Depex += self.OpConverter.OpEncode (0x00, Op)
|
||||||
|
self.Depex += OperandStack.pop ()
|
||||||
|
|
||||||
|
elif self.IsValidVersion (Op):
|
||||||
|
if not OperandStack:
|
||||||
|
OperandStack.append (self.OpConverter.OpEncode (0x01, Op))
|
||||||
|
else:
|
||||||
|
# accroding to uefi spec 2.8, the guid/version operands is a reversed order in firmware comparison.
|
||||||
|
self.Depex += self.OpConverter.OpEncode (0x01, Op)
|
||||||
|
self.Depex += OperandStack.pop ()
|
||||||
|
|
||||||
|
elif self.IsValidBoolean (Op):
|
||||||
|
if Op.upper () == 'FALSE':
|
||||||
|
self.Depex += self.OpConverter.OpEncode (0x07)
|
||||||
|
elif Op.upper () == 'TRUE':
|
||||||
|
self.Depex += self.OpConverter.OpEncode (0x06)
|
||||||
|
|
||||||
|
elif self.IsValidOperator (Op):
|
||||||
|
while (OpeartorStack and OpeartorStack[-1] != '(' and self.PriorityNotGreater (OpeartorStack[-1], Op)):
|
||||||
|
Operator = OpeartorStack.pop ()
|
||||||
|
self.Depex += self.OpConverter.OpEncode (self._opReference[Operator][1])
|
||||||
|
OpeartorStack.append (Op)
|
||||||
|
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
while OpeartorStack:
|
||||||
|
Operator = OpeartorStack.pop ()
|
||||||
|
if Operator == '(':
|
||||||
|
Msg = 'Too many \'(\'.'
|
||||||
|
raise ValueError (Msg)
|
||||||
|
self.Depex += self.OpConverter.OpEncode (self._opReference[Operator][1])
|
||||||
|
self.Depex += self.OpConverter.OpEncode (0x0D)
|
||||||
|
|
||||||
|
self._Valid = True
|
||||||
|
self._DepexSize = len (self.Depex)
|
||||||
|
return self.Depex + self.Payload
|
||||||
|
|
||||||
|
def Decode (self, Buffer):
|
||||||
|
# initialize
|
||||||
|
self.Depex = Buffer
|
||||||
|
OperandStack = []
|
||||||
|
DepexLen = 0
|
||||||
|
|
||||||
|
while True:
|
||||||
|
Opcode, Operand, OperandSize = self.OpConverter.OpDecode (Buffer[DepexLen:])
|
||||||
|
DepexLen += OperandSize + 1
|
||||||
|
|
||||||
|
if Opcode == 0x0D:
|
||||||
|
break
|
||||||
|
|
||||||
|
elif Opcode == 0x02:
|
||||||
|
if not OperandStack:
|
||||||
|
OperandStack.append ('DECLARE \"{String}\"'.format (String = Operand))
|
||||||
|
else:
|
||||||
|
PrevOperand = OperandStack.pop ()
|
||||||
|
OperandStack.append ('{Operand} DECLARE \"{String}\"'.format (Operand = PrevOperand, String = Operand))
|
||||||
|
|
||||||
|
elif Opcode in [0x00, 0x01]:
|
||||||
|
OperandStack.append (Operand)
|
||||||
|
|
||||||
|
elif Opcode == 0x06:
|
||||||
|
OperandStack.append ('TRUE')
|
||||||
|
|
||||||
|
elif Opcode == 0x07:
|
||||||
|
OperandStack.append ('FALSE')
|
||||||
|
|
||||||
|
elif self.IsValidOperator (self._opReferenceReverse[Opcode]):
|
||||||
|
Operator = self._opReferenceReverse[Opcode]
|
||||||
|
if self.IsValidUnaryOperator (self._opReferenceReverse[Opcode]) and len (OperandStack) >= 1:
|
||||||
|
Oprand = OperandStack.pop ()
|
||||||
|
OperandStack.append (' ( {Operator} {Oprand} )'.format (Operator = Operator, Oprand = Oprand))
|
||||||
|
elif self.IsValidBinocularOperator (self._opReferenceReverse[Opcode]) and len (OperandStack) >= 2:
|
||||||
|
Oprand1 = OperandStack.pop ()
|
||||||
|
Oprand2 = OperandStack.pop ()
|
||||||
|
OperandStack.append (' ( {Oprand1} {Operator} {Oprand2} )'.format (Operator = Operator, Oprand1 = Oprand1, Oprand2 = Oprand2))
|
||||||
|
else:
|
||||||
|
Msg = 'No enough Operands for {Opcode:02X}.'.format (Opcode = Opcode)
|
||||||
|
raise ValueError (Msg)
|
||||||
|
|
||||||
|
else:
|
||||||
|
Msg = '{Opcode:02X} is not a valid OpCode.'.format (Opcode = Opcode)
|
||||||
|
raise ValueError (Msg)
|
||||||
|
|
||||||
|
self.DepexExp = OperandStack[0].strip (' ')
|
||||||
|
self.Payload = Buffer[DepexLen:]
|
||||||
|
self._Valid = True
|
||||||
|
self._DepexSize = DepexLen
|
||||||
|
return self.Payload
|
||||||
|
|
||||||
|
|
||||||
|
def DumpInfo (self):
|
||||||
|
DepexLen = 0
|
||||||
|
Opcode = None
|
||||||
|
Buffer = self.Depex
|
||||||
|
|
||||||
|
if self._Valid == True:
|
||||||
|
print ('EFI_FIRMWARE_IMAGE_DEP.Dependencies = {')
|
||||||
|
while Opcode != 0x0D:
|
||||||
|
Opcode, Operand, OperandSize = self.OpConverter.OpDecode (Buffer[DepexLen:])
|
||||||
|
DepexLen += OperandSize + 1
|
||||||
|
if Operand:
|
||||||
|
print (' {Opcode:02X}, {Operand},'.format (Opcode = Opcode, Operand = Operand))
|
||||||
|
else:
|
||||||
|
print (' {Opcode:02X},'.format (Opcode = Opcode))
|
||||||
|
print ('}')
|
||||||
|
|
||||||
|
print ('sizeof (EFI_FIRMWARE_IMAGE_DEP.Dependencies) = {Size:08X}'.format (Size = self._DepexSize))
|
||||||
|
print ('sizeof (Payload) = {Size:08X}'.format (Size = len (self.Payload)))
|
@@ -1,93 +0,0 @@
|
|||||||
## @file
|
|
||||||
# build a platform or a module
|
|
||||||
#
|
|
||||||
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
|
|
||||||
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
|
|
||||||
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
#
|
|
||||||
|
|
||||||
# Version and Copyright
|
|
||||||
from Common.BuildVersion import gBUILD_VERSION
|
|
||||||
from optparse import OptionParser
|
|
||||||
VersionNumber = "0.60" + ' ' + gBUILD_VERSION
|
|
||||||
__version__ = "%prog Version " + VersionNumber
|
|
||||||
__copyright__ = "Copyright (c) 2007 - 2018, Intel Corporation All rights reserved."
|
|
||||||
|
|
||||||
gParamCheck = []
|
|
||||||
def SingleCheckCallback(option, opt_str, value, parser):
|
|
||||||
if option not in gParamCheck:
|
|
||||||
setattr(parser.values, option.dest, value)
|
|
||||||
gParamCheck.append(option)
|
|
||||||
else:
|
|
||||||
parser.error("Option %s only allows one instance in command line!" % option)
|
|
||||||
|
|
||||||
def MyOptionParser():
|
|
||||||
Parser = OptionParser(description=__copyright__, version=__version__, prog="build.exe", usage="%prog [options] [all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run]")
|
|
||||||
Parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32', 'X64', 'EBC', 'ARM', 'AARCH64'], dest="TargetArch",
|
|
||||||
help="ARCHS is one of list: IA32, X64, ARM, AARCH64 or EBC, which overrides target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option.")
|
|
||||||
Parser.add_option("-p", "--platform", action="callback", type="string", dest="PlatformFile", callback=SingleCheckCallback,
|
|
||||||
help="Build the platform specified by the DSC file name argument, overriding target.txt's ACTIVE_PLATFORM definition.")
|
|
||||||
Parser.add_option("-m", "--module", action="callback", type="string", dest="ModuleFile", callback=SingleCheckCallback,
|
|
||||||
help="Build the module specified by the INF file name argument.")
|
|
||||||
Parser.add_option("-b", "--buildtarget", type="string", dest="BuildTarget", help="Using the TARGET to build the platform, overriding target.txt's TARGET definition.",
|
|
||||||
action="append")
|
|
||||||
Parser.add_option("-t", "--tagname", action="append", type="string", dest="ToolChain",
|
|
||||||
help="Using the Tool Chain Tagname to build the platform, overriding target.txt's TOOL_CHAIN_TAG definition.")
|
|
||||||
Parser.add_option("-x", "--sku-id", action="callback", type="string", dest="SkuId", callback=SingleCheckCallback,
|
|
||||||
help="Using this name of SKU ID to build the platform, overriding SKUID_IDENTIFIER in DSC file.")
|
|
||||||
|
|
||||||
Parser.add_option("-n", action="callback", type="int", dest="ThreadNumber", callback=SingleCheckCallback,
|
|
||||||
help="Build the platform using multi-threaded compiler. The value overrides target.txt's MAX_CONCURRENT_THREAD_NUMBER. When value is set to 0, tool automatically detect number of "\
|
|
||||||
"processor threads, set value to 1 means disable multi-thread build, and set value to more than 1 means user specify the threads number to build.")
|
|
||||||
|
|
||||||
Parser.add_option("-f", "--fdf", action="callback", type="string", dest="FdfFile", callback=SingleCheckCallback,
|
|
||||||
help="The name of the FDF file to use, which overrides the setting in the DSC file.")
|
|
||||||
Parser.add_option("-r", "--rom-image", action="append", type="string", dest="RomImage", default=[],
|
|
||||||
help="The name of FD to be generated. The name must be from [FD] section in FDF file.")
|
|
||||||
Parser.add_option("-i", "--fv-image", action="append", type="string", dest="FvImage", default=[],
|
|
||||||
help="The name of FV to be generated. The name must be from [FV] section in FDF file.")
|
|
||||||
Parser.add_option("-C", "--capsule-image", action="append", type="string", dest="CapName", default=[],
|
|
||||||
help="The name of Capsule to be generated. The name must be from [Capsule] section in FDF file.")
|
|
||||||
Parser.add_option("-u", "--skip-autogen", action="store_true", dest="SkipAutoGen", help="Skip AutoGen step.")
|
|
||||||
Parser.add_option("-e", "--re-parse", action="store_true", dest="Reparse", help="Re-parse all meta-data files.")
|
|
||||||
|
|
||||||
Parser.add_option("-c", "--case-insensitive", action="store_true", dest="CaseInsensitive", default=False, help="Don't check case of file name.")
|
|
||||||
|
|
||||||
Parser.add_option("-w", "--warning-as-error", action="store_true", dest="WarningAsError", help="Treat warning in tools as error.")
|
|
||||||
Parser.add_option("-j", "--log", action="store", dest="LogFile", help="Put log in specified file as well as on console.")
|
|
||||||
|
|
||||||
Parser.add_option("-s", "--silent", action="store_true", type=None, dest="SilentMode",
|
|
||||||
help="Make use of silent mode of (n)make.")
|
|
||||||
Parser.add_option("-q", "--quiet", action="store_true", type=None, help="Disable all messages except FATAL ERRORS.")
|
|
||||||
Parser.add_option("-v", "--verbose", action="store_true", type=None, help="Turn on verbose output with informational messages printed, "\
|
|
||||||
"including library instances selected, final dependency expression, "\
|
|
||||||
"and warning messages, etc.")
|
|
||||||
Parser.add_option("-d", "--debug", action="store", type="int", help="Enable debug messages at specified level.")
|
|
||||||
Parser.add_option("-D", "--define", action="append", type="string", dest="Macros", help="Macro: \"Name [= Value]\".")
|
|
||||||
|
|
||||||
Parser.add_option("-y", "--report-file", action="store", dest="ReportFile", help="Create/overwrite the report to the specified filename.")
|
|
||||||
Parser.add_option("-Y", "--report-type", action="append", type="choice", choices=['PCD', 'LIBRARY', 'FLASH', 'DEPEX', 'BUILD_FLAGS', 'FIXED_ADDRESS', 'HASH', 'EXECUTION_ORDER'], dest="ReportType", default=[],
|
|
||||||
help="Flags that control the type of build report to generate. Must be one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS, HASH, EXECUTION_ORDER]. "\
|
|
||||||
"To specify more than one flag, repeat this option on the command line and the default flag set is [PCD, LIBRARY, FLASH, DEPEX, HASH, BUILD_FLAGS, FIXED_ADDRESS]")
|
|
||||||
Parser.add_option("-F", "--flag", action="store", type="string", dest="Flag",
|
|
||||||
help="Specify the specific option to parse EDK UNI file. Must be one of: [-c, -s]. -c is for EDK framework UNI file, and -s is for EDK UEFI UNI file. "\
|
|
||||||
"This option can also be specified by setting *_*_*_BUILD_FLAGS in [BuildOptions] section of platform DSC. If they are both specified, this value "\
|
|
||||||
"will override the setting in [BuildOptions] section of platform DSC.")
|
|
||||||
Parser.add_option("-N", "--no-cache", action="store_true", dest="DisableCache", default=False, help="Disable build cache mechanism")
|
|
||||||
Parser.add_option("--conf", action="store", type="string", dest="ConfDirectory", help="Specify the customized Conf directory.")
|
|
||||||
Parser.add_option("--check-usage", action="store_true", dest="CheckUsage", default=False, help="Check usage content of entries listed in INF file.")
|
|
||||||
Parser.add_option("--ignore-sources", action="store_true", dest="IgnoreSources", default=False, help="Focus to a binary build and ignore all source files")
|
|
||||||
Parser.add_option("--pcd", action="append", dest="OptionPcd", help="Set PCD value by command line. Format: \"PcdName=Value\" ")
|
|
||||||
Parser.add_option("-l", "--cmd-len", action="store", type="int", dest="CommandLength", help="Specify the maximum line length of build command. Default is 4096.")
|
|
||||||
Parser.add_option("--hash", action="store_true", dest="UseHashCache", default=False, help="Enable hash-based caching during build process.")
|
|
||||||
Parser.add_option("--binary-destination", action="store", type="string", dest="BinCacheDest", help="Generate a cache of binary files in the specified directory.")
|
|
||||||
Parser.add_option("--binary-source", action="store", type="string", dest="BinCacheSource", help="Consume a cache of binary files from the specified directory.")
|
|
||||||
Parser.add_option("--genfds-multi-thread", action="store_true", dest="GenfdsMultiThread", default=True, help="Enable GenFds multi thread to generate ffs file.")
|
|
||||||
Parser.add_option("--no-genfds-multi-thread", action="store_true", dest="NoGenfdsMultiThread", default=False, help="Disable GenFds multi thread to generate ffs file.")
|
|
||||||
Parser.add_option("--disable-include-path-check", action="store_true", dest="DisableIncludePathCheck", default=False, help="Disable the include path check for outside of package.")
|
|
||||||
(Opt, Args) = Parser.parse_args()
|
|
||||||
return (Opt, Args)
|
|
||||||
|
|
||||||
BuildOption, BuildTarget = MyOptionParser()
|
|
@@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# This file is used to define checkpoints used by ECC tool
|
# This file is used to define checkpoints used by ECC tool
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
@@ -1469,13 +1469,14 @@ class Check(object):
|
|||||||
EdkLogger.quiet("Checking naming convention of variable name ...")
|
EdkLogger.quiet("Checking naming convention of variable name ...")
|
||||||
Pattern = re.compile(r'^[A-Zgm]+\S*[a-z]\S*$')
|
Pattern = re.compile(r'^[A-Zgm]+\S*[a-z]\S*$')
|
||||||
|
|
||||||
SqlCommand = """select ID, Name from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)
|
SqlCommand = """select ID, Name, Modifier from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)
|
||||||
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||||
for Record in RecordSet:
|
for Record in RecordSet:
|
||||||
Var = Record[1]
|
Var = Record[1]
|
||||||
|
Modifier = Record[2]
|
||||||
if Var.startswith('CONST'):
|
if Var.startswith('CONST'):
|
||||||
Var = Var[5:].lstrip()
|
Var = Var[5:].lstrip()
|
||||||
if not Pattern.match(Var):
|
if not Pattern.match(Var) and not (Modifier.endswith('*') and Var.startswith('p')):
|
||||||
if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Record[1]):
|
if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Record[1]):
|
||||||
EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, OtherMsg="The variable name [%s] does not follow the rules" % (Record[1]), BelongsToTable=FileTable, BelongsToItem=Record[0])
|
EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, OtherMsg="The variable name [%s] does not follow the rules" % (Record[1]), BelongsToTable=FileTable, BelongsToItem=Record[0])
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# This file is used to parse meta files
|
# This file is used to parse meta files
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ import Common.LongFilePathOs as os
|
|||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import copy
|
import copy
|
||||||
|
from hashlib import md5
|
||||||
import Common.EdkLogger as EdkLogger
|
import Common.EdkLogger as EdkLogger
|
||||||
import Common.GlobalData as GlobalData
|
import Common.GlobalData as GlobalData
|
||||||
import Ecc.EccGlobalData as EccGlobalData
|
import Ecc.EccGlobalData as EccGlobalData
|
||||||
@@ -1498,6 +1498,10 @@ class DecParser(MetaFileParser):
|
|||||||
self.TblFile = EccGlobalData.gDb.TblFile
|
self.TblFile = EccGlobalData.gDb.TblFile
|
||||||
self.FileID = -1
|
self.FileID = -1
|
||||||
|
|
||||||
|
self._CurrentStructurePcdName = ""
|
||||||
|
self._include_flag = False
|
||||||
|
self._package_flag = False
|
||||||
|
|
||||||
## Parser starter
|
## Parser starter
|
||||||
def Start(self):
|
def Start(self):
|
||||||
Content = ''
|
Content = ''
|
||||||
@@ -1692,6 +1696,62 @@ class DecParser(MetaFileParser):
|
|||||||
File=self.MetaFile, Line=self._LineIndex+1)
|
File=self.MetaFile, Line=self._LineIndex+1)
|
||||||
self._ValueList[0] = ''
|
self._ValueList[0] = ''
|
||||||
|
|
||||||
|
def ParsePcdName(self,namelist):
|
||||||
|
if "[" in namelist[1]:
|
||||||
|
pcdname = namelist[1][:namelist[1].index("[")]
|
||||||
|
arrayindex = namelist[1][namelist[1].index("["):]
|
||||||
|
namelist[1] = pcdname
|
||||||
|
if len(namelist) == 2:
|
||||||
|
namelist.append(arrayindex)
|
||||||
|
else:
|
||||||
|
namelist[2] = ".".join((arrayindex,namelist[2]))
|
||||||
|
return namelist
|
||||||
|
|
||||||
|
def StructPcdParser(self):
|
||||||
|
self._ValueList[0] = self._CurrentStructurePcdName
|
||||||
|
|
||||||
|
if "|" not in self._CurrentLine:
|
||||||
|
if "<HeaderFiles>" == self._CurrentLine:
|
||||||
|
self._include_flag = True
|
||||||
|
self._package_flag = False
|
||||||
|
self._ValueList = None
|
||||||
|
return
|
||||||
|
if "<Packages>" == self._CurrentLine:
|
||||||
|
self._package_flag = True
|
||||||
|
self._ValueList = None
|
||||||
|
self._include_flag = False
|
||||||
|
return
|
||||||
|
|
||||||
|
if self._include_flag:
|
||||||
|
self._ValueList[1] = "<HeaderFiles>_" + md5(self._CurrentLine.encode('utf-8')).hexdigest()
|
||||||
|
self._ValueList[2] = self._CurrentLine
|
||||||
|
if self._package_flag and "}" != self._CurrentLine:
|
||||||
|
self._ValueList[1] = "<Packages>_" + md5(self._CurrentLine.encode('utf-8')).hexdigest()
|
||||||
|
self._ValueList[2] = self._CurrentLine
|
||||||
|
if self._CurrentLine == "}":
|
||||||
|
self._package_flag = False
|
||||||
|
self._include_flag = False
|
||||||
|
self._ValueList = None
|
||||||
|
else:
|
||||||
|
PcdTockens = self._CurrentLine.split(TAB_VALUE_SPLIT)
|
||||||
|
PcdNames = self.ParsePcdName(PcdTockens[0].split(TAB_SPLIT))
|
||||||
|
if len(PcdNames) == 2:
|
||||||
|
if PcdNames[1].strip().endswith("]"):
|
||||||
|
PcdName = PcdNames[1][:PcdNames[1].index('[')]
|
||||||
|
Index = PcdNames[1][PcdNames[1].index('['):]
|
||||||
|
self._ValueList[0] = TAB_SPLIT.join((PcdNames[0], PcdName))
|
||||||
|
self._ValueList[1] = Index
|
||||||
|
self._ValueList[2] = PcdTockens[1]
|
||||||
|
else:
|
||||||
|
self._CurrentStructurePcdName = ""
|
||||||
|
else:
|
||||||
|
if self._CurrentStructurePcdName != TAB_SPLIT.join(PcdNames[:2]):
|
||||||
|
EdkLogger.error('Parser', FORMAT_INVALID, "Pcd Name does not match: %s and %s " % (
|
||||||
|
self._CurrentStructurePcdName, TAB_SPLIT.join(PcdNames[:2])),
|
||||||
|
File=self.MetaFile, Line=self._LineIndex + 1)
|
||||||
|
self._ValueList[1] = TAB_SPLIT.join(PcdNames[2:])
|
||||||
|
self._ValueList[2] = PcdTockens[1]
|
||||||
|
|
||||||
## PCD sections parser
|
## PCD sections parser
|
||||||
#
|
#
|
||||||
# [PcdsFixedAtBuild]
|
# [PcdsFixedAtBuild]
|
||||||
@@ -1702,6 +1762,9 @@ class DecParser(MetaFileParser):
|
|||||||
#
|
#
|
||||||
@ParseMacro
|
@ParseMacro
|
||||||
def _PcdParser(self):
|
def _PcdParser(self):
|
||||||
|
if self._CurrentStructurePcdName:
|
||||||
|
self.StructPcdParser()
|
||||||
|
return
|
||||||
TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
|
TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
|
||||||
self._ValueList[0:1] = GetSplitValueList(TokenList[0], TAB_SPLIT)
|
self._ValueList[0:1] = GetSplitValueList(TokenList[0], TAB_SPLIT)
|
||||||
# check PCD information
|
# check PCD information
|
||||||
@@ -1759,6 +1822,10 @@ class DecParser(MetaFileParser):
|
|||||||
if not IsValid:
|
if not IsValid:
|
||||||
EdkLogger.error('Parser', FORMAT_INVALID, Cause, ExtraData=self._CurrentLine,
|
EdkLogger.error('Parser', FORMAT_INVALID, Cause, ExtraData=self._CurrentLine,
|
||||||
File=self.MetaFile, Line=self._LineIndex+1)
|
File=self.MetaFile, Line=self._LineIndex+1)
|
||||||
|
if Cause == "StructurePcd":
|
||||||
|
self._CurrentStructurePcdName = TAB_SPLIT.join(self._ValueList[0:2])
|
||||||
|
self._ValueList[0] = self._CurrentStructurePcdName
|
||||||
|
self._ValueList[1] = ValueList[1].strip()
|
||||||
|
|
||||||
if EccGlobalData.gConfig.UniCheckPCDInfo == '1' or EccGlobalData.gConfig.UniCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
if EccGlobalData.gConfig.UniCheckPCDInfo == '1' or EccGlobalData.gConfig.UniCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||||
# check Description, Prompt information
|
# check Description, Prompt information
|
||||||
|
@@ -20,7 +20,7 @@ from linecache import getlines
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
import Common.LongFilePathOs as os
|
import Common.LongFilePathOs as os
|
||||||
from Common.TargetTxtClassObject import TargetTxt
|
from Common.TargetTxtClassObject import TargetTxtDict
|
||||||
from Common.DataType import *
|
from Common.DataType import *
|
||||||
import Common.GlobalData as GlobalData
|
import Common.GlobalData as GlobalData
|
||||||
from Common import EdkLogger
|
from Common import EdkLogger
|
||||||
@@ -210,6 +210,8 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
|
|||||||
BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt"))
|
BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt"))
|
||||||
if os.path.isfile(BuildConfigurationFile) == True:
|
if os.path.isfile(BuildConfigurationFile) == True:
|
||||||
# if no build target given in command line, get it from target.txt
|
# if no build target given in command line, get it from target.txt
|
||||||
|
TargetObj = TargetTxtDict()
|
||||||
|
TargetTxt = TargetObj.Target
|
||||||
if not GenFdsGlobalVariable.TargetName:
|
if not GenFdsGlobalVariable.TargetName:
|
||||||
BuildTargetList = TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_TARGET]
|
BuildTargetList = TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_TARGET]
|
||||||
if len(BuildTargetList) != 1:
|
if len(BuildTargetList) != 1:
|
||||||
|
@@ -23,9 +23,9 @@ from Common.BuildToolError import COMMAND_FAILURE,GENFDS_ERROR
|
|||||||
from Common import EdkLogger
|
from Common import EdkLogger
|
||||||
from Common.Misc import SaveFileOnChange
|
from Common.Misc import SaveFileOnChange
|
||||||
|
|
||||||
from Common.TargetTxtClassObject import TargetTxt
|
from Common.TargetTxtClassObject import TargetTxtDict
|
||||||
from Common.ToolDefClassObject import ToolDef
|
from Common.ToolDefClassObject import ToolDefDict
|
||||||
from AutoGen.BuildEngine import BuildRuleObj
|
from AutoGen.BuildEngine import ToolBuildRule
|
||||||
import Common.DataType as DataType
|
import Common.DataType as DataType
|
||||||
from Common.Misc import PathClass
|
from Common.Misc import PathClass
|
||||||
from Common.LongFilePathSupport import OpenLongFilePath as open
|
from Common.LongFilePathSupport import OpenLongFilePath as open
|
||||||
@@ -96,12 +96,15 @@ class GenFdsGlobalVariable:
|
|||||||
def _LoadBuildRule():
|
def _LoadBuildRule():
|
||||||
if GenFdsGlobalVariable.__BuildRuleDatabase:
|
if GenFdsGlobalVariable.__BuildRuleDatabase:
|
||||||
return GenFdsGlobalVariable.__BuildRuleDatabase
|
return GenFdsGlobalVariable.__BuildRuleDatabase
|
||||||
GenFdsGlobalVariable.__BuildRuleDatabase = BuildRuleObj
|
BuildRule = ToolBuildRule()
|
||||||
ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
|
GenFdsGlobalVariable.__BuildRuleDatabase = BuildRule.ToolBuildRule
|
||||||
|
TargetObj = TargetTxtDict()
|
||||||
|
ToolDefinitionFile = TargetObj.Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
|
||||||
if ToolDefinitionFile == '':
|
if ToolDefinitionFile == '':
|
||||||
ToolDefinitionFile = "Conf/tools_def.txt"
|
ToolDefinitionFile = "Conf/tools_def.txt"
|
||||||
if os.path.isfile(ToolDefinitionFile):
|
if os.path.isfile(ToolDefinitionFile):
|
||||||
ToolDefinition = ToolDef.ToolsDefTxtDatabase
|
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
|
||||||
|
ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase
|
||||||
if DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY in ToolDefinition \
|
if DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY in ToolDefinition \
|
||||||
and GenFdsGlobalVariable.ToolChainTag in ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY] \
|
and GenFdsGlobalVariable.ToolChainTag in ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY] \
|
||||||
and ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobalVariable.ToolChainTag]:
|
and ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobalVariable.ToolChainTag]:
|
||||||
@@ -830,6 +833,8 @@ class GenFdsGlobalVariable:
|
|||||||
# @param NameGuid The Guid name
|
# @param NameGuid The Guid name
|
||||||
#
|
#
|
||||||
def FindExtendTool(KeyStringList, CurrentArchList, NameGuid):
|
def FindExtendTool(KeyStringList, CurrentArchList, NameGuid):
|
||||||
|
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
|
||||||
|
ToolDef = ToolDefObj.ToolDef
|
||||||
ToolDb = ToolDef.ToolsDefTxtDatabase
|
ToolDb = ToolDef.ToolsDefTxtDatabase
|
||||||
# if user not specify filter, try to deduce it from global data.
|
# if user not specify filter, try to deduce it from global data.
|
||||||
if KeyStringList is None or KeyStringList == []:
|
if KeyStringList is None or KeyStringList == []:
|
||||||
|
@@ -56,6 +56,10 @@ gAslIncludePattern = re.compile("^(\s*)[iI]nclude\s*\(\"?([^\"\(\)]+)\"\)", re.M
|
|||||||
gAslCIncludePattern = re.compile(r'^(\s*)#include\s*[<"]\s*([-\\/\w.]+)\s*([>"])', re.MULTILINE)
|
gAslCIncludePattern = re.compile(r'^(\s*)#include\s*[<"]\s*([-\\/\w.]+)\s*([>"])', re.MULTILINE)
|
||||||
## Patterns used to convert EDK conventions to EDK2 ECP conventions
|
## Patterns used to convert EDK conventions to EDK2 ECP conventions
|
||||||
|
|
||||||
|
## Regular expression for finding header file inclusions
|
||||||
|
gIncludePattern = re.compile(r"^[ \t]*[%]?[ \t]*include(?:[ \t]*(?:\\(?:\r\n|\r|\n))*[ \t]*)*(?:\(?[\"<]?[ \t]*)([-\w.\\/() \t]+)(?:[ \t]*[\">]?\)?)", re.MULTILINE | re.UNICODE | re.IGNORECASE)
|
||||||
|
|
||||||
|
|
||||||
## file cache to avoid circular include in ASL file
|
## file cache to avoid circular include in ASL file
|
||||||
gIncludedAslFile = []
|
gIncludedAslFile = []
|
||||||
|
|
||||||
@@ -253,9 +257,10 @@ def TrimPreprocessedVfr(Source, Target):
|
|||||||
# first for the included file; otherwise, only the path specified
|
# first for the included file; otherwise, only the path specified
|
||||||
# in the IncludePathList will be searched.
|
# in the IncludePathList will be searched.
|
||||||
#
|
#
|
||||||
def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
|
def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None, IncludeFileList = None, filetype=None):
|
||||||
NewFileContent = []
|
NewFileContent = []
|
||||||
|
if IncludeFileList is None:
|
||||||
|
IncludeFileList = []
|
||||||
try:
|
try:
|
||||||
#
|
#
|
||||||
# Search LocalSearchPath first if it is specified.
|
# Search LocalSearchPath first if it is specified.
|
||||||
@@ -288,9 +293,10 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
|
|||||||
ExtraData= "%s -> %s" % (" -> ".join(gIncludedAslFile), IncludeFile))
|
ExtraData= "%s -> %s" % (" -> ".join(gIncludedAslFile), IncludeFile))
|
||||||
return []
|
return []
|
||||||
gIncludedAslFile.append(IncludeFile)
|
gIncludedAslFile.append(IncludeFile)
|
||||||
|
IncludeFileList.append(IncludeFile.strip())
|
||||||
for Line in F:
|
for Line in F:
|
||||||
LocalSearchPath = None
|
LocalSearchPath = None
|
||||||
|
if filetype == "ASL":
|
||||||
Result = gAslIncludePattern.findall(Line)
|
Result = gAslIncludePattern.findall(Line)
|
||||||
if len(Result) == 0:
|
if len(Result) == 0:
|
||||||
Result = gAslCIncludePattern.findall(Line)
|
Result = gAslCIncludePattern.findall(Line)
|
||||||
@@ -304,7 +310,19 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
|
|||||||
LocalSearchPath = os.path.dirname(IncludeFile)
|
LocalSearchPath = os.path.dirname(IncludeFile)
|
||||||
CurrentIndent = Indent + Result[0][0]
|
CurrentIndent = Indent + Result[0][0]
|
||||||
IncludedFile = Result[0][1]
|
IncludedFile = Result[0][1]
|
||||||
NewFileContent.extend(DoInclude(IncludedFile, CurrentIndent, IncludePathList, LocalSearchPath))
|
NewFileContent.extend(DoInclude(IncludedFile, CurrentIndent, IncludePathList, LocalSearchPath,IncludeFileList,filetype))
|
||||||
|
NewFileContent.append("\n")
|
||||||
|
elif filetype == "ASM":
|
||||||
|
Result = gIncludePattern.findall(Line)
|
||||||
|
if len(Result) == 0:
|
||||||
|
NewFileContent.append("%s%s" % (Indent, Line))
|
||||||
|
continue
|
||||||
|
|
||||||
|
IncludedFile = Result[0]
|
||||||
|
|
||||||
|
IncludedFile = IncludedFile.strip()
|
||||||
|
IncludedFile = os.path.normpath(IncludedFile)
|
||||||
|
NewFileContent.extend(DoInclude(IncludedFile, '', IncludePathList, LocalSearchPath,IncludeFileList,filetype))
|
||||||
NewFileContent.append("\n")
|
NewFileContent.append("\n")
|
||||||
|
|
||||||
gIncludedAslFile.pop()
|
gIncludedAslFile.pop()
|
||||||
@@ -320,7 +338,7 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
|
|||||||
# @param Target File to store the trimmed content
|
# @param Target File to store the trimmed content
|
||||||
# @param IncludePathFile The file to log the external include path
|
# @param IncludePathFile The file to log the external include path
|
||||||
#
|
#
|
||||||
def TrimAslFile(Source, Target, IncludePathFile):
|
def TrimAslFile(Source, Target, IncludePathFile,AslDeps = False):
|
||||||
CreateDirectory(os.path.dirname(Target))
|
CreateDirectory(os.path.dirname(Target))
|
||||||
|
|
||||||
SourceDir = os.path.dirname(Source)
|
SourceDir = os.path.dirname(Source)
|
||||||
@@ -349,8 +367,11 @@ def TrimAslFile(Source, Target, IncludePathFile):
|
|||||||
EdkLogger.warn("Trim", "Invalid include line in include list file.", IncludePathFile, LineNum)
|
EdkLogger.warn("Trim", "Invalid include line in include list file.", IncludePathFile, LineNum)
|
||||||
except:
|
except:
|
||||||
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=IncludePathFile)
|
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=IncludePathFile)
|
||||||
|
AslIncludes = []
|
||||||
Lines = DoInclude(Source, '', IncludePathList)
|
Lines = DoInclude(Source, '', IncludePathList,IncludeFileList=AslIncludes,filetype='ASL')
|
||||||
|
AslIncludes = [item for item in AslIncludes if item !=Source]
|
||||||
|
if AslDeps and AslIncludes:
|
||||||
|
SaveFileOnChange(os.path.join(os.path.dirname(Target),os.path.basename(Source))+".trim.deps", " \\\n".join([Source+":"] +AslIncludes),False)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Undef MIN and MAX to avoid collision in ASL source code
|
# Undef MIN and MAX to avoid collision in ASL source code
|
||||||
@@ -364,6 +385,54 @@ def TrimAslFile(Source, Target, IncludePathFile):
|
|||||||
except:
|
except:
|
||||||
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
|
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
|
||||||
|
|
||||||
|
## Trim ASM file
|
||||||
|
#
|
||||||
|
# Output ASM include statement with the content the included file
|
||||||
|
#
|
||||||
|
# @param Source File to be trimmed
|
||||||
|
# @param Target File to store the trimmed content
|
||||||
|
# @param IncludePathFile The file to log the external include path
|
||||||
|
#
|
||||||
|
def TrimAsmFile(Source, Target, IncludePathFile):
|
||||||
|
CreateDirectory(os.path.dirname(Target))
|
||||||
|
|
||||||
|
SourceDir = os.path.dirname(Source)
|
||||||
|
if SourceDir == '':
|
||||||
|
SourceDir = '.'
|
||||||
|
|
||||||
|
#
|
||||||
|
# Add source directory as the first search directory
|
||||||
|
#
|
||||||
|
IncludePathList = [SourceDir]
|
||||||
|
#
|
||||||
|
# If additional include path file is specified, append them all
|
||||||
|
# to the search directory list.
|
||||||
|
#
|
||||||
|
if IncludePathFile:
|
||||||
|
try:
|
||||||
|
LineNum = 0
|
||||||
|
with open(IncludePathFile, 'r') as File:
|
||||||
|
FileLines = File.readlines()
|
||||||
|
for Line in FileLines:
|
||||||
|
LineNum += 1
|
||||||
|
if Line.startswith("/I") or Line.startswith ("-I"):
|
||||||
|
IncludePathList.append(Line[2:].strip())
|
||||||
|
else:
|
||||||
|
EdkLogger.warn("Trim", "Invalid include line in include list file.", IncludePathFile, LineNum)
|
||||||
|
except:
|
||||||
|
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=IncludePathFile)
|
||||||
|
AsmIncludes = []
|
||||||
|
Lines = DoInclude(Source, '', IncludePathList,IncludeFileList=AsmIncludes,filetype='ASM')
|
||||||
|
AsmIncludes = [item for item in AsmIncludes if item != Source]
|
||||||
|
if AsmIncludes:
|
||||||
|
SaveFileOnChange(os.path.join(os.path.dirname(Target),os.path.basename(Source))+".trim.deps", " \\\n".join([Source+":"] +AsmIncludes),False)
|
||||||
|
# save all lines trimmed
|
||||||
|
try:
|
||||||
|
with open(Target, 'w') as File:
|
||||||
|
File.writelines(Lines)
|
||||||
|
except:
|
||||||
|
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
|
||||||
|
|
||||||
def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):
|
def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):
|
||||||
VfrNameList = []
|
VfrNameList = []
|
||||||
if os.path.isdir(DebugDir):
|
if os.path.isdir(DebugDir):
|
||||||
@@ -440,8 +509,12 @@ def Options():
|
|||||||
help="The input file is preprocessed VFR file"),
|
help="The input file is preprocessed VFR file"),
|
||||||
make_option("--Vfr-Uni-Offset", dest="FileType", const="VfrOffsetBin", action="store_const",
|
make_option("--Vfr-Uni-Offset", dest="FileType", const="VfrOffsetBin", action="store_const",
|
||||||
help="The input file is EFI image"),
|
help="The input file is EFI image"),
|
||||||
|
make_option("--asl-deps", dest="AslDeps", const="True", action="store_const",
|
||||||
|
help="Generate Asl dependent files."),
|
||||||
make_option("-a", "--asl-file", dest="FileType", const="Asl", action="store_const",
|
make_option("-a", "--asl-file", dest="FileType", const="Asl", action="store_const",
|
||||||
help="The input file is ASL file"),
|
help="The input file is ASL file"),
|
||||||
|
make_option( "--asm-file", dest="FileType", const="Asm", action="store_const",
|
||||||
|
help="The input file is asm file"),
|
||||||
make_option("-c", "--convert-hex", dest="ConvertHex", action="store_true",
|
make_option("-c", "--convert-hex", dest="ConvertHex", action="store_true",
|
||||||
help="Convert standard hex format (0xabcd) to MASM format (abcdh)"),
|
help="Convert standard hex format (0xabcd) to MASM format (abcdh)"),
|
||||||
|
|
||||||
@@ -515,9 +588,11 @@ def Main():
|
|||||||
elif CommandOptions.FileType == "Asl":
|
elif CommandOptions.FileType == "Asl":
|
||||||
if CommandOptions.OutputFile is None:
|
if CommandOptions.OutputFile is None:
|
||||||
CommandOptions.OutputFile = os.path.splitext(InputFile)[0] + '.iii'
|
CommandOptions.OutputFile = os.path.splitext(InputFile)[0] + '.iii'
|
||||||
TrimAslFile(InputFile, CommandOptions.OutputFile, CommandOptions.IncludePathFile)
|
TrimAslFile(InputFile, CommandOptions.OutputFile, CommandOptions.IncludePathFile,CommandOptions.AslDeps)
|
||||||
elif CommandOptions.FileType == "VfrOffsetBin":
|
elif CommandOptions.FileType == "VfrOffsetBin":
|
||||||
GenerateVfrBinSec(CommandOptions.ModuleName, CommandOptions.DebugDir, CommandOptions.OutputFile)
|
GenerateVfrBinSec(CommandOptions.ModuleName, CommandOptions.DebugDir, CommandOptions.OutputFile)
|
||||||
|
elif CommandOptions.FileType == "Asm":
|
||||||
|
TrimAsmFile(InputFile, CommandOptions.OutputFile, CommandOptions.IncludePathFile)
|
||||||
else :
|
else :
|
||||||
if CommandOptions.OutputFile is None:
|
if CommandOptions.OutputFile is None:
|
||||||
CommandOptions.OutputFile = os.path.splitext(InputFile)[0] + '.iii'
|
CommandOptions.OutputFile = os.path.splitext(InputFile)[0] + '.iii'
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# This file is used to create a database used by build tool
|
# This file is used to create a database used by build tool
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
@@ -19,8 +19,8 @@ from Common.Misc import *
|
|||||||
from types import *
|
from types import *
|
||||||
from Common.Expression import *
|
from Common.Expression import *
|
||||||
from CommonDataClass.CommonClass import SkuInfoClass
|
from CommonDataClass.CommonClass import SkuInfoClass
|
||||||
from Common.TargetTxtClassObject import TargetTxt
|
from Common.TargetTxtClassObject import TargetTxtDict
|
||||||
from Common.ToolDefClassObject import ToolDef
|
from Common.ToolDefClassObject import ToolDefDict
|
||||||
from .MetaDataTable import *
|
from .MetaDataTable import *
|
||||||
from .MetaFileTable import *
|
from .MetaFileTable import *
|
||||||
from .MetaFileParser import *
|
from .MetaFileParser import *
|
||||||
@@ -91,9 +91,6 @@ WindowsCFLAGS = 'CFLAGS = $(CFLAGS) /wd4200 /wd4034 /wd4101 '
|
|||||||
LinuxCFLAGS = 'BUILD_CFLAGS += -Wno-pointer-to-int-cast -Wno-unused-variable '
|
LinuxCFLAGS = 'BUILD_CFLAGS += -Wno-pointer-to-int-cast -Wno-unused-variable '
|
||||||
PcdMakefileEnd = '''
|
PcdMakefileEnd = '''
|
||||||
!INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.common
|
!INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.common
|
||||||
|
|
||||||
LIBS = $(LIB_PATH)\Common.lib
|
|
||||||
|
|
||||||
!INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.app
|
!INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.app
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@@ -2637,10 +2634,10 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
|
|
||||||
MakeApp = PcdMakefileHeader
|
MakeApp = PcdMakefileHeader
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
MakeApp = MakeApp + 'APPFILE = %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s\%s.obj\n' % (self.OutputPath, PcdValueInitName) + 'INC = '
|
MakeApp = MakeApp + 'APPFILE = %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon"))) + 'INC = '
|
||||||
else:
|
else:
|
||||||
MakeApp = MakeApp + PcdGccMakefile
|
MakeApp = MakeApp + PcdGccMakefile
|
||||||
MakeApp = MakeApp + 'APPFILE = %s/%s\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s/%s.o\n' % (self.OutputPath, PcdValueInitName) + \
|
MakeApp = MakeApp + 'APPFILE = %s/%s\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName, os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon"))) + \
|
||||||
'include $(MAKEROOT)/Makefiles/app.makefile\n' + 'INCLUDE +='
|
'include $(MAKEROOT)/Makefiles/app.makefile\n' + 'INCLUDE +='
|
||||||
|
|
||||||
IncSearchList = []
|
IncSearchList = []
|
||||||
@@ -2667,6 +2664,22 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
for pkg in PcdDependDEC:
|
for pkg in PcdDependDEC:
|
||||||
if pkg in PlatformInc:
|
if pkg in PlatformInc:
|
||||||
for inc in PlatformInc[pkg]:
|
for inc in PlatformInc[pkg]:
|
||||||
|
#
|
||||||
|
# Get list of files in potential -I include path
|
||||||
|
#
|
||||||
|
FileList = os.listdir (str(inc))
|
||||||
|
#
|
||||||
|
# Skip -I include path if one of the include files required
|
||||||
|
# by PcdValueInit.c are present in the include paths from
|
||||||
|
# the DEC file. PcdValueInit.c must use the standard include
|
||||||
|
# files from the host compiler.
|
||||||
|
#
|
||||||
|
if 'stdio.h' in FileList:
|
||||||
|
continue
|
||||||
|
if 'stdlib.h' in FileList:
|
||||||
|
continue
|
||||||
|
if 'string.h' in FileList:
|
||||||
|
continue
|
||||||
MakeApp += '-I' + str(inc) + ' '
|
MakeApp += '-I' + str(inc) + ' '
|
||||||
IncSearchList.append(inc)
|
IncSearchList.append(inc)
|
||||||
MakeApp = MakeApp + '\n'
|
MakeApp = MakeApp + '\n'
|
||||||
@@ -2723,8 +2736,8 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
IncludeFileFullPaths.append(os.path.normpath(includefullpath))
|
IncludeFileFullPaths.append(os.path.normpath(includefullpath))
|
||||||
break
|
break
|
||||||
SearchPathList = []
|
SearchPathList = []
|
||||||
SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWorkspace, "BaseTools/Source/C/Include")))
|
SearchPathList.append(os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "BaseTools/Source/C/Include")))
|
||||||
SearchPathList.append(os.path.normpath(mws.join(GlobalData.gWorkspace, "BaseTools/Source/C/Common")))
|
SearchPathList.append(os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "BaseTools/Source/C/Common")))
|
||||||
SearchPathList.extend(str(item) for item in IncSearchList)
|
SearchPathList.extend(str(item) for item in IncSearchList)
|
||||||
IncFileList = GetDependencyList(IncludeFileFullPaths, SearchPathList)
|
IncFileList = GetDependencyList(IncludeFileFullPaths, SearchPathList)
|
||||||
for include_file in IncFileList:
|
for include_file in IncFileList:
|
||||||
@@ -2752,6 +2765,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
returncode, StdOut, StdErr = DscBuildData.ExecuteCommand (MakeCommand)
|
returncode, StdOut, StdErr = DscBuildData.ExecuteCommand (MakeCommand)
|
||||||
Messages = StdErr
|
Messages = StdErr
|
||||||
|
|
||||||
|
EdkLogger.verbose ('%s\n%s\n%s' % (MakeCommand, StdOut, StdErr))
|
||||||
Messages = Messages.split('\n')
|
Messages = Messages.split('\n')
|
||||||
MessageGroup = []
|
MessageGroup = []
|
||||||
if returncode != 0:
|
if returncode != 0:
|
||||||
@@ -2761,6 +2775,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
File.close()
|
File.close()
|
||||||
for Message in Messages:
|
for Message in Messages:
|
||||||
if " error" in Message or "warning" in Message:
|
if " error" in Message or "warning" in Message:
|
||||||
|
try:
|
||||||
FileInfo = Message.strip().split('(')
|
FileInfo = Message.strip().split('(')
|
||||||
if len (FileInfo) > 1:
|
if len (FileInfo) > 1:
|
||||||
FileName = FileInfo [0]
|
FileName = FileInfo [0]
|
||||||
@@ -2771,6 +2786,10 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
continue
|
continue
|
||||||
FileName = FileInfo [0]
|
FileName = FileInfo [0]
|
||||||
FileLine = FileInfo [1]
|
FileLine = FileInfo [1]
|
||||||
|
except:
|
||||||
|
continue
|
||||||
|
if "PcdValueInit.c" not in FileName:
|
||||||
|
continue
|
||||||
if FileLine.isdigit():
|
if FileLine.isdigit():
|
||||||
error_line = FileData[int (FileLine) - 1]
|
error_line = FileData[int (FileLine) - 1]
|
||||||
if r"//" in error_line:
|
if r"//" in error_line:
|
||||||
@@ -2796,13 +2815,14 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
if MessageGroup:
|
if MessageGroup:
|
||||||
EdkLogger.error("build", PCD_STRUCTURE_PCD_ERROR, "\n".join(MessageGroup) )
|
EdkLogger.error("build", PCD_STRUCTURE_PCD_ERROR, "\n".join(MessageGroup) )
|
||||||
else:
|
else:
|
||||||
EdkLogger.error('Build', COMMAND_FAILURE, 'Can not execute command: %s' % MakeCommand)
|
EdkLogger.error('Build', COMMAND_FAILURE, 'Can not execute command: %s\n%s\n%s' % (MakeCommand, StdOut, StdErr))
|
||||||
|
|
||||||
if DscBuildData.NeedUpdateOutput(OutputValueFile, Dest_PcdValueInitExe, InputValueFile):
|
if DscBuildData.NeedUpdateOutput(OutputValueFile, Dest_PcdValueInitExe, InputValueFile):
|
||||||
Command = Dest_PcdValueInitExe + ' -i %s -o %s' % (InputValueFile, OutputValueFile)
|
Command = Dest_PcdValueInitExe + ' -i %s -o %s' % (InputValueFile, OutputValueFile)
|
||||||
returncode, StdOut, StdErr = DscBuildData.ExecuteCommand (Command)
|
returncode, StdOut, StdErr = DscBuildData.ExecuteCommand (Command)
|
||||||
|
EdkLogger.verbose ('%s\n%s\n%s' % (Command, StdOut, StdErr))
|
||||||
if returncode != 0:
|
if returncode != 0:
|
||||||
EdkLogger.warn('Build', COMMAND_FAILURE, 'Can not collect output from command: %s' % Command)
|
EdkLogger.warn('Build', COMMAND_FAILURE, 'Can not collect output from command: %s\n%s\n' % (Command, StdOut, StdErr))
|
||||||
|
|
||||||
File = open (OutputValueFile, 'r')
|
File = open (OutputValueFile, 'r')
|
||||||
FileBuffer = File.readlines()
|
FileBuffer = File.readlines()
|
||||||
@@ -3296,6 +3316,8 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
@property
|
@property
|
||||||
def ToolChainFamily(self):
|
def ToolChainFamily(self):
|
||||||
self._ToolChainFamily = TAB_COMPILER_MSFT
|
self._ToolChainFamily = TAB_COMPILER_MSFT
|
||||||
|
TargetObj = TargetTxtDict()
|
||||||
|
TargetTxt = TargetObj.Target
|
||||||
BuildConfigurationFile = os.path.normpath(os.path.join(GlobalData.gConfDirectory, "target.txt"))
|
BuildConfigurationFile = os.path.normpath(os.path.join(GlobalData.gConfDirectory, "target.txt"))
|
||||||
if os.path.isfile(BuildConfigurationFile) == True:
|
if os.path.isfile(BuildConfigurationFile) == True:
|
||||||
ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
|
ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
|
||||||
@@ -3303,7 +3325,8 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
ToolDefinitionFile = "tools_def.txt"
|
ToolDefinitionFile = "tools_def.txt"
|
||||||
ToolDefinitionFile = os.path.normpath(mws.join(self.WorkspaceDir, 'Conf', ToolDefinitionFile))
|
ToolDefinitionFile = os.path.normpath(mws.join(self.WorkspaceDir, 'Conf', ToolDefinitionFile))
|
||||||
if os.path.isfile(ToolDefinitionFile) == True:
|
if os.path.isfile(ToolDefinitionFile) == True:
|
||||||
ToolDefinition = ToolDef.ToolsDefTxtDatabase
|
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
|
||||||
|
ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase
|
||||||
if TAB_TOD_DEFINES_FAMILY not in ToolDefinition \
|
if TAB_TOD_DEFINES_FAMILY not in ToolDefinition \
|
||||||
or self._Toolchain not in ToolDefinition[TAB_TOD_DEFINES_FAMILY] \
|
or self._Toolchain not in ToolDefinition[TAB_TOD_DEFINES_FAMILY] \
|
||||||
or not ToolDefinition[TAB_TOD_DEFINES_FAMILY][self._Toolchain]:
|
or not ToolDefinition[TAB_TOD_DEFINES_FAMILY][self._Toolchain]:
|
||||||
|
@@ -1612,6 +1612,7 @@ class DscParser(MetaFileParser):
|
|||||||
# First search the include file under the same directory as DSC file
|
# First search the include file under the same directory as DSC file
|
||||||
#
|
#
|
||||||
IncludedFile1 = PathClass(IncludedFile, self.MetaFile.Dir)
|
IncludedFile1 = PathClass(IncludedFile, self.MetaFile.Dir)
|
||||||
|
if self._Enabled:
|
||||||
ErrorCode, ErrorInfo1 = IncludedFile1.Validate()
|
ErrorCode, ErrorInfo1 = IncludedFile1.Validate()
|
||||||
if ErrorCode != 0:
|
if ErrorCode != 0:
|
||||||
#
|
#
|
||||||
|
@@ -2042,7 +2042,7 @@ class FdReport(object):
|
|||||||
self.VPDBaseAddress = 0
|
self.VPDBaseAddress = 0
|
||||||
self.VPDSize = 0
|
self.VPDSize = 0
|
||||||
for index, FdRegion in enumerate(Fd.RegionList):
|
for index, FdRegion in enumerate(Fd.RegionList):
|
||||||
if str(FdRegion.RegionType) is 'FILE' and Wa.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
|
if str(FdRegion.RegionType) == 'FILE' and Wa.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
|
||||||
self.VPDBaseAddress = self.FdRegionList[index].BaseAddress
|
self.VPDBaseAddress = self.FdRegionList[index].BaseAddress
|
||||||
self.VPDSize = self.FdRegionList[index].Size
|
self.VPDSize = self.FdRegionList[index].Size
|
||||||
break
|
break
|
||||||
|
@@ -2,8 +2,9 @@
|
|||||||
# build a platform or a module
|
# build a platform or a module
|
||||||
#
|
#
|
||||||
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
|
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
|
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
|
||||||
|
# Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
@@ -24,9 +25,9 @@ import traceback
|
|||||||
import multiprocessing
|
import multiprocessing
|
||||||
from threading import Thread,Event,BoundedSemaphore
|
from threading import Thread,Event,BoundedSemaphore
|
||||||
import threading
|
import threading
|
||||||
from subprocess import Popen,PIPE
|
from subprocess import Popen,PIPE, STDOUT
|
||||||
from collections import OrderedDict, defaultdict
|
from collections import OrderedDict, defaultdict
|
||||||
from Common.buildoptions import BuildOption,BuildTarget
|
|
||||||
from AutoGen.PlatformAutoGen import PlatformAutoGen
|
from AutoGen.PlatformAutoGen import PlatformAutoGen
|
||||||
from AutoGen.ModuleAutoGen import ModuleAutoGen
|
from AutoGen.ModuleAutoGen import ModuleAutoGen
|
||||||
from AutoGen.WorkspaceAutoGen import WorkspaceAutoGen
|
from AutoGen.WorkspaceAutoGen import WorkspaceAutoGen
|
||||||
@@ -35,8 +36,9 @@ from AutoGen.AutoGenWorker import AutoGenWorkerInProcess,AutoGenManager,\
|
|||||||
from AutoGen import GenMake
|
from AutoGen import GenMake
|
||||||
from Common import Misc as Utils
|
from Common import Misc as Utils
|
||||||
|
|
||||||
from Common.TargetTxtClassObject import TargetTxt
|
from Common.TargetTxtClassObject import TargetTxtDict
|
||||||
from Common.ToolDefClassObject import ToolDef
|
from Common.ToolDefClassObject import ToolDefDict
|
||||||
|
from buildoptions import MyOptionParser
|
||||||
from Common.Misc import PathClass,SaveFileOnChange,RemoveDirectory
|
from Common.Misc import PathClass,SaveFileOnChange,RemoveDirectory
|
||||||
from Common.StringUtils import NormPath
|
from Common.StringUtils import NormPath
|
||||||
from Common.MultipleWorkspace import MultipleWorkspace as mws
|
from Common.MultipleWorkspace import MultipleWorkspace as mws
|
||||||
@@ -57,7 +59,8 @@ from multiprocessing import Manager
|
|||||||
from AutoGen.DataPipe import MemoryDataPipe
|
from AutoGen.DataPipe import MemoryDataPipe
|
||||||
from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo, PlatformInfo
|
from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo, PlatformInfo
|
||||||
from GenFds.FdfParser import FdfParser
|
from GenFds.FdfParser import FdfParser
|
||||||
|
from AutoGen.IncludesAutoGen import IncludesAutoGen
|
||||||
|
from GenFds.GenFds import resetFdsGlobalVariable
|
||||||
|
|
||||||
## standard targets of build command
|
## standard targets of build command
|
||||||
gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
|
gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
|
||||||
@@ -175,18 +178,31 @@ def NormFile(FilePath, Workspace):
|
|||||||
# @param To The stream message put on
|
# @param To The stream message put on
|
||||||
# @param ExitFlag The flag used to indicate stopping reading
|
# @param ExitFlag The flag used to indicate stopping reading
|
||||||
#
|
#
|
||||||
def ReadMessage(From, To, ExitFlag):
|
def ReadMessage(From, To, ExitFlag,MemTo=None):
|
||||||
while True:
|
while True:
|
||||||
# read one line a time
|
# read one line a time
|
||||||
Line = From.readline()
|
Line = From.readline()
|
||||||
# empty string means "end"
|
# empty string means "end"
|
||||||
if Line is not None and Line != b"":
|
if Line is not None and Line != b"":
|
||||||
To(Line.rstrip().decode(encoding='utf-8', errors='ignore'))
|
LineStr = Line.rstrip().decode(encoding='utf-8', errors='ignore')
|
||||||
|
if MemTo is not None:
|
||||||
|
if "Note: including file:" == LineStr.lstrip()[:21]:
|
||||||
|
MemTo.append(LineStr)
|
||||||
|
else:
|
||||||
|
To(LineStr)
|
||||||
|
MemTo.append(LineStr)
|
||||||
|
else:
|
||||||
|
To(LineStr)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
if ExitFlag.isSet():
|
if ExitFlag.isSet():
|
||||||
break
|
break
|
||||||
|
|
||||||
|
class MakeSubProc(Popen):
|
||||||
|
def __init__(self,*args, **argv):
|
||||||
|
super(MakeSubProc,self).__init__(*args, **argv)
|
||||||
|
self.ProcOut = []
|
||||||
|
|
||||||
## Launch an external program
|
## Launch an external program
|
||||||
#
|
#
|
||||||
# This method will call subprocess.Popen to execute an external program with
|
# This method will call subprocess.Popen to execute an external program with
|
||||||
@@ -197,7 +213,7 @@ def ReadMessage(From, To, ExitFlag):
|
|||||||
# @param Command A list or string containing the call of the program
|
# @param Command A list or string containing the call of the program
|
||||||
# @param WorkingDir The directory in which the program will be running
|
# @param WorkingDir The directory in which the program will be running
|
||||||
#
|
#
|
||||||
def LaunchCommand(Command, WorkingDir):
|
def LaunchCommand(Command, WorkingDir,ModuleAuto = None):
|
||||||
BeginTime = time.time()
|
BeginTime = time.time()
|
||||||
# if working directory doesn't exist, Popen() will raise an exception
|
# if working directory doesn't exist, Popen() will raise an exception
|
||||||
if not os.path.isdir(WorkingDir):
|
if not os.path.isdir(WorkingDir):
|
||||||
@@ -216,22 +232,17 @@ def LaunchCommand(Command, WorkingDir):
|
|||||||
EndOfProcedure = None
|
EndOfProcedure = None
|
||||||
try:
|
try:
|
||||||
# launch the command
|
# launch the command
|
||||||
Proc = Popen(Command, stdout=PIPE, stderr=PIPE, env=os.environ, cwd=WorkingDir, bufsize=-1, shell=True)
|
Proc = MakeSubProc(Command, stdout=PIPE, stderr=STDOUT, env=os.environ, cwd=WorkingDir, bufsize=-1, shell=True)
|
||||||
|
|
||||||
# launch two threads to read the STDOUT and STDERR
|
# launch two threads to read the STDOUT and STDERR
|
||||||
EndOfProcedure = Event()
|
EndOfProcedure = Event()
|
||||||
EndOfProcedure.clear()
|
EndOfProcedure.clear()
|
||||||
if Proc.stdout:
|
if Proc.stdout:
|
||||||
StdOutThread = Thread(target=ReadMessage, args=(Proc.stdout, EdkLogger.info, EndOfProcedure))
|
StdOutThread = Thread(target=ReadMessage, args=(Proc.stdout, EdkLogger.info, EndOfProcedure,Proc.ProcOut))
|
||||||
StdOutThread.setName("STDOUT-Redirector")
|
StdOutThread.setName("STDOUT-Redirector")
|
||||||
StdOutThread.setDaemon(False)
|
StdOutThread.setDaemon(False)
|
||||||
StdOutThread.start()
|
StdOutThread.start()
|
||||||
|
|
||||||
if Proc.stderr:
|
|
||||||
StdErrThread = Thread(target=ReadMessage, args=(Proc.stderr, EdkLogger.quiet, EndOfProcedure))
|
|
||||||
StdErrThread.setName("STDERR-Redirector")
|
|
||||||
StdErrThread.setDaemon(False)
|
|
||||||
StdErrThread.start()
|
|
||||||
|
|
||||||
# waiting for program exit
|
# waiting for program exit
|
||||||
Proc.wait()
|
Proc.wait()
|
||||||
@@ -247,8 +258,6 @@ def LaunchCommand(Command, WorkingDir):
|
|||||||
|
|
||||||
if Proc.stdout:
|
if Proc.stdout:
|
||||||
StdOutThread.join()
|
StdOutThread.join()
|
||||||
if Proc.stderr:
|
|
||||||
StdErrThread.join()
|
|
||||||
|
|
||||||
# check the return code of the program
|
# check the return code of the program
|
||||||
if Proc.returncode != 0:
|
if Proc.returncode != 0:
|
||||||
@@ -263,6 +272,16 @@ def LaunchCommand(Command, WorkingDir):
|
|||||||
EdkLogger.info(RespContent)
|
EdkLogger.info(RespContent)
|
||||||
|
|
||||||
EdkLogger.error("build", COMMAND_FAILURE, ExtraData="%s [%s]" % (Command, WorkingDir))
|
EdkLogger.error("build", COMMAND_FAILURE, ExtraData="%s [%s]" % (Command, WorkingDir))
|
||||||
|
if ModuleAuto:
|
||||||
|
iau = IncludesAutoGen(WorkingDir,ModuleAuto)
|
||||||
|
if ModuleAuto.ToolChainFamily == TAB_COMPILER_MSFT:
|
||||||
|
iau.CreateDepsFileForMsvc(Proc.ProcOut)
|
||||||
|
else:
|
||||||
|
iau.UpdateDepsFileforNonMsvc()
|
||||||
|
iau.UpdateDepsFileforTrim()
|
||||||
|
iau.CreateModuleDeps()
|
||||||
|
iau.CreateDepsInclude()
|
||||||
|
iau.CreateDepsTarget()
|
||||||
return "%dms" % (int(round((time.time() - BeginTime) * 1000)))
|
return "%dms" % (int(round((time.time() - BeginTime) * 1000)))
|
||||||
|
|
||||||
## The smallest unit that can be built in multi-thread build mode
|
## The smallest unit that can be built in multi-thread build mode
|
||||||
@@ -598,7 +617,7 @@ class BuildTask:
|
|||||||
#
|
#
|
||||||
def AddDependency(self, Dependency):
|
def AddDependency(self, Dependency):
|
||||||
for Dep in Dependency:
|
for Dep in Dependency:
|
||||||
if not Dep.BuildObject.IsBinaryModule and not Dep.BuildObject.CanSkipbyCache(GlobalData.gCacheIR):
|
if not Dep.BuildObject.IsBinaryModule and not Dep.BuildObject.CanSkipbyCache(GlobalData.gModuleCacheHit):
|
||||||
self.DependencyList.append(BuildTask.New(Dep)) # BuildTask list
|
self.DependencyList.append(BuildTask.New(Dep)) # BuildTask list
|
||||||
|
|
||||||
## The thread wrapper of LaunchCommand function
|
## The thread wrapper of LaunchCommand function
|
||||||
@@ -608,13 +627,16 @@ class BuildTask:
|
|||||||
#
|
#
|
||||||
def _CommandThread(self, Command, WorkingDir):
|
def _CommandThread(self, Command, WorkingDir):
|
||||||
try:
|
try:
|
||||||
self.BuildItem.BuildObject.BuildTime = LaunchCommand(Command, WorkingDir)
|
self.BuildItem.BuildObject.BuildTime = LaunchCommand(Command, WorkingDir,self.BuildItem.BuildObject)
|
||||||
self.CompleteFlag = True
|
self.CompleteFlag = True
|
||||||
|
|
||||||
# Run hash operation post dependency, to account for libs
|
# Run hash operation post dependency to account for libs
|
||||||
if GlobalData.gUseHashCache and self.BuildItem.BuildObject.IsLibrary:
|
# Run if --hash or --binary-destination
|
||||||
HashFile = path.join(self.BuildItem.BuildObject.BuildDir, self.BuildItem.BuildObject.Name + ".hash")
|
if GlobalData.gUseHashCache and not GlobalData.gBinCacheSource:
|
||||||
SaveFileOnChange(HashFile, self.BuildItem.BuildObject.GenModuleHash(), True)
|
self.BuildItem.BuildObject.GenModuleHash()
|
||||||
|
if GlobalData.gBinCacheDest:
|
||||||
|
self.BuildItem.BuildObject.GenCMakeHash()
|
||||||
|
|
||||||
except:
|
except:
|
||||||
#
|
#
|
||||||
# TRICK: hide the output of threads left running, so that the user can
|
# TRICK: hide the output of threads left running, so that the user can
|
||||||
@@ -631,14 +653,6 @@ class BuildTask:
|
|||||||
BuildTask._ErrorMessage = "%s broken\n %s [%s]" % \
|
BuildTask._ErrorMessage = "%s broken\n %s [%s]" % \
|
||||||
(threading.currentThread().getName(), Command, WorkingDir)
|
(threading.currentThread().getName(), Command, WorkingDir)
|
||||||
|
|
||||||
# Set the value used by hash invalidation flow in GlobalData.gModuleBuildTracking to 'SUCCESS'
|
|
||||||
# If Module or Lib is being tracked, it did not fail header check test, and built successfully
|
|
||||||
if (self.BuildItem.BuildObject in GlobalData.gModuleBuildTracking and
|
|
||||||
GlobalData.gModuleBuildTracking[self.BuildItem.BuildObject] != 'FAIL_METAFILE' and
|
|
||||||
not BuildTask._ErrorFlag.isSet()
|
|
||||||
):
|
|
||||||
GlobalData.gModuleBuildTracking[self.BuildItem.BuildObject] = 'SUCCESS'
|
|
||||||
|
|
||||||
# indicate there's a thread is available for another build task
|
# indicate there's a thread is available for another build task
|
||||||
BuildTask._RunningQueueLock.acquire()
|
BuildTask._RunningQueueLock.acquire()
|
||||||
BuildTask._RunningQueue.pop(self.BuildItem)
|
BuildTask._RunningQueue.pop(self.BuildItem)
|
||||||
@@ -720,11 +734,14 @@ class Build():
|
|||||||
self.ConfDirectory = BuildOptions.ConfDirectory
|
self.ConfDirectory = BuildOptions.ConfDirectory
|
||||||
self.SpawnMode = True
|
self.SpawnMode = True
|
||||||
self.BuildReport = BuildReport(BuildOptions.ReportFile, BuildOptions.ReportType)
|
self.BuildReport = BuildReport(BuildOptions.ReportFile, BuildOptions.ReportType)
|
||||||
self.TargetTxt = TargetTxt
|
|
||||||
self.ToolDef = ToolDef
|
|
||||||
self.AutoGenTime = 0
|
self.AutoGenTime = 0
|
||||||
self.MakeTime = 0
|
self.MakeTime = 0
|
||||||
self.GenFdsTime = 0
|
self.GenFdsTime = 0
|
||||||
|
self.MakeFileName = ""
|
||||||
|
TargetObj = TargetTxtDict()
|
||||||
|
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"),"Conf")))
|
||||||
|
self.TargetTxt = TargetObj.Target
|
||||||
|
self.ToolDef = ToolDefObj.ToolDef
|
||||||
GlobalData.BuildOptionPcd = BuildOptions.OptionPcd if BuildOptions.OptionPcd else []
|
GlobalData.BuildOptionPcd = BuildOptions.OptionPcd if BuildOptions.OptionPcd else []
|
||||||
#Set global flag for build mode
|
#Set global flag for build mode
|
||||||
GlobalData.gIgnoreSource = BuildOptions.IgnoreSources
|
GlobalData.gIgnoreSource = BuildOptions.IgnoreSources
|
||||||
@@ -805,19 +822,30 @@ class Build():
|
|||||||
EdkLogger.quiet("%-16s = %s" % ("POSTBUILD", self.Postbuild))
|
EdkLogger.quiet("%-16s = %s" % ("POSTBUILD", self.Postbuild))
|
||||||
if self.Prebuild:
|
if self.Prebuild:
|
||||||
self.LaunchPrebuild()
|
self.LaunchPrebuild()
|
||||||
self.TargetTxt = TargetTxt
|
TargetObj = TargetTxtDict()
|
||||||
self.ToolDef = ToolDef
|
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
|
||||||
|
self.TargetTxt = TargetObj.Target
|
||||||
|
self.ToolDef = ToolDefObj.ToolDef
|
||||||
if not (self.LaunchPrebuildFlag and os.path.exists(self.PlatformBuildPath)):
|
if not (self.LaunchPrebuildFlag and os.path.exists(self.PlatformBuildPath)):
|
||||||
self.InitBuild()
|
self.InitBuild()
|
||||||
|
|
||||||
self.AutoGenMgr = None
|
self.AutoGenMgr = None
|
||||||
EdkLogger.info("")
|
EdkLogger.info("")
|
||||||
os.chdir(self.WorkspaceDir)
|
os.chdir(self.WorkspaceDir)
|
||||||
GlobalData.gCacheIR = Manager().dict()
|
|
||||||
self.log_q = log_q
|
self.log_q = log_q
|
||||||
GlobalData.file_lock = mp.Lock()
|
GlobalData.file_lock = mp.Lock()
|
||||||
GlobalData.cache_lock = mp.Lock()
|
# Init cache data for local only
|
||||||
def StartAutoGen(self,mqueue, DataPipe,SkipAutoGen,PcdMaList,share_data):
|
GlobalData.gPackageHashFile = dict()
|
||||||
|
GlobalData.gModulePreMakeCacheStatus = dict()
|
||||||
|
GlobalData.gModuleMakeCacheStatus = dict()
|
||||||
|
GlobalData.gHashChainStatus = dict()
|
||||||
|
GlobalData.gCMakeHashFile = dict()
|
||||||
|
GlobalData.gModuleHashFile = dict()
|
||||||
|
GlobalData.gFileHashDict = dict()
|
||||||
|
GlobalData.gModuleAllCacheStatus = set()
|
||||||
|
GlobalData.gModuleCacheHit = set()
|
||||||
|
|
||||||
|
def StartAutoGen(self,mqueue, DataPipe,SkipAutoGen,PcdMaList,cqueue):
|
||||||
try:
|
try:
|
||||||
if SkipAutoGen:
|
if SkipAutoGen:
|
||||||
return True,0
|
return True,0
|
||||||
@@ -827,29 +855,27 @@ class Build():
|
|||||||
if FfsCmd is None:
|
if FfsCmd is None:
|
||||||
FfsCmd = {}
|
FfsCmd = {}
|
||||||
GlobalData.FfsCmd = FfsCmd
|
GlobalData.FfsCmd = FfsCmd
|
||||||
GlobalData.libConstPcd = DataPipe.Get("LibConstPcd")
|
auto_workers = [AutoGenWorkerInProcess(mqueue,DataPipe.dump_file,feedback_q,GlobalData.file_lock,cqueue,self.log_q,error_event) for _ in range(self.ThreadNumber)]
|
||||||
GlobalData.Refes = DataPipe.Get("REFS")
|
|
||||||
auto_workers = [AutoGenWorkerInProcess(mqueue,DataPipe.dump_file,feedback_q,GlobalData.file_lock,GlobalData.cache_lock,share_data,self.log_q,error_event) for _ in range(self.ThreadNumber)]
|
|
||||||
self.AutoGenMgr = AutoGenManager(auto_workers,feedback_q,error_event)
|
self.AutoGenMgr = AutoGenManager(auto_workers,feedback_q,error_event)
|
||||||
self.AutoGenMgr.start()
|
self.AutoGenMgr.start()
|
||||||
for w in auto_workers:
|
for w in auto_workers:
|
||||||
w.start()
|
w.start()
|
||||||
if PcdMaList is not None:
|
if PcdMaList is not None:
|
||||||
for PcdMa in PcdMaList:
|
for PcdMa in PcdMaList:
|
||||||
if GlobalData.gBinCacheSource and self.Target in [None, "", "all"]:
|
# SourceFileList calling sequence impact the makefile string sequence.
|
||||||
PcdMa.GenModuleFilesHash(share_data)
|
# Create cached SourceFileList here to unify its calling sequence for both
|
||||||
PcdMa.GenPreMakefileHash(share_data)
|
# CanSkipbyPreMakeCache and CreateCodeFile/CreateMakeFile.
|
||||||
if PcdMa.CanSkipbyPreMakefileCache(share_data):
|
RetVal = PcdMa.SourceFileList
|
||||||
continue
|
# Force cache miss for PCD driver
|
||||||
|
if GlobalData.gUseHashCache and not GlobalData.gBinCacheDest and self.Target in [None, "", "all"]:
|
||||||
|
cqueue.put((PcdMa.MetaFile.Path, PcdMa.Arch, "PreMakeCache", False))
|
||||||
|
|
||||||
PcdMa.CreateCodeFile(False)
|
PcdMa.CreateCodeFile(False)
|
||||||
PcdMa.CreateMakeFile(False,GenFfsList = DataPipe.Get("FfsCommand").get((PcdMa.MetaFile.Path, PcdMa.Arch),[]))
|
PcdMa.CreateMakeFile(False,GenFfsList = DataPipe.Get("FfsCommand").get((PcdMa.MetaFile.Path, PcdMa.Arch),[]))
|
||||||
|
|
||||||
|
# Force cache miss for PCD driver
|
||||||
if GlobalData.gBinCacheSource and self.Target in [None, "", "all"]:
|
if GlobalData.gBinCacheSource and self.Target in [None, "", "all"]:
|
||||||
PcdMa.GenMakeHeaderFilesHash(share_data)
|
cqueue.put((PcdMa.MetaFile.Path, PcdMa.Arch, "MakeCache", False))
|
||||||
PcdMa.GenMakeHash(share_data)
|
|
||||||
if PcdMa.CanSkipbyMakeCache(share_data):
|
|
||||||
continue
|
|
||||||
|
|
||||||
self.AutoGenMgr.join()
|
self.AutoGenMgr.join()
|
||||||
rt = self.AutoGenMgr.Status
|
rt = self.AutoGenMgr.Status
|
||||||
@@ -1160,38 +1186,6 @@ class Build():
|
|||||||
EdkLogger.error("Postbuild", POSTBUILD_ERROR, 'Postbuild process is not success!')
|
EdkLogger.error("Postbuild", POSTBUILD_ERROR, 'Postbuild process is not success!')
|
||||||
EdkLogger.info("\n- Postbuild Done -\n")
|
EdkLogger.info("\n- Postbuild Done -\n")
|
||||||
|
|
||||||
## Error handling for hash feature
|
|
||||||
#
|
|
||||||
# On BuildTask error, iterate through the Module Build tracking
|
|
||||||
# dictionary to determine wheather a module failed to build. Invalidate
|
|
||||||
# the hash associated with that module by removing it from storage.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
def invalidateHash(self):
|
|
||||||
# Only for hashing feature
|
|
||||||
if not GlobalData.gUseHashCache:
|
|
||||||
return
|
|
||||||
|
|
||||||
# GlobalData.gModuleBuildTracking contains only modules or libs that cannot be skipped by hash
|
|
||||||
for Ma in GlobalData.gModuleBuildTracking:
|
|
||||||
# Skip invalidating for Successful Module/Lib builds
|
|
||||||
if GlobalData.gModuleBuildTracking[Ma] == 'SUCCESS':
|
|
||||||
continue
|
|
||||||
|
|
||||||
# The module failed to build, failed to start building, or failed the header check test from this point on
|
|
||||||
|
|
||||||
# Remove .hash from build
|
|
||||||
ModuleHashFile = os.path.join(Ma.BuildDir, Ma.Name + ".hash")
|
|
||||||
if os.path.exists(ModuleHashFile):
|
|
||||||
os.remove(ModuleHashFile)
|
|
||||||
|
|
||||||
# Remove .hash file from cache
|
|
||||||
if GlobalData.gBinCacheDest:
|
|
||||||
FileDir = os.path.join(GlobalData.gBinCacheDest, Ma.PlatformInfo.OutputDir, Ma.BuildTarget + "_" + Ma.ToolChain, Ma.Arch, Ma.SourceDir, Ma.MetaFile.BaseName)
|
|
||||||
HashFile = os.path.join(FileDir, Ma.Name + '.hash')
|
|
||||||
if os.path.exists(HashFile):
|
|
||||||
os.remove(HashFile)
|
|
||||||
|
|
||||||
## Build a module or platform
|
## Build a module or platform
|
||||||
#
|
#
|
||||||
# Create autogen code and makefile for a module or platform, and the launch
|
# Create autogen code and makefile for a module or platform, and the launch
|
||||||
@@ -1229,7 +1223,8 @@ class Build():
|
|||||||
self.Progress.Start("Generating makefile and code")
|
self.Progress.Start("Generating makefile and code")
|
||||||
data_pipe_file = os.path.join(AutoGenObject.BuildDir, "GlobalVar_%s_%s.bin" % (str(AutoGenObject.Guid),AutoGenObject.Arch))
|
data_pipe_file = os.path.join(AutoGenObject.BuildDir, "GlobalVar_%s_%s.bin" % (str(AutoGenObject.Guid),AutoGenObject.Arch))
|
||||||
AutoGenObject.DataPipe.dump(data_pipe_file)
|
AutoGenObject.DataPipe.dump(data_pipe_file)
|
||||||
autogen_rt,errorcode = self.StartAutoGen(mqueue, AutoGenObject.DataPipe, self.SkipAutoGen, PcdMaList, GlobalData.gCacheIR)
|
cqueue = mp.Queue()
|
||||||
|
autogen_rt,errorcode = self.StartAutoGen(mqueue, AutoGenObject.DataPipe, self.SkipAutoGen, PcdMaList, cqueue)
|
||||||
AutoGenIdFile = os.path.join(GlobalData.gConfDirectory,".AutoGenIdFile.txt")
|
AutoGenIdFile = os.path.join(GlobalData.gConfDirectory,".AutoGenIdFile.txt")
|
||||||
with open(AutoGenIdFile,"w") as fw:
|
with open(AutoGenIdFile,"w") as fw:
|
||||||
fw.write("Arch=%s\n" % "|".join((AutoGenObject.Workspace.ArchList)))
|
fw.write("Arch=%s\n" % "|".join((AutoGenObject.Workspace.ArchList)))
|
||||||
@@ -1258,8 +1253,6 @@ class Build():
|
|||||||
(AutoGenObject.BuildTarget, AutoGenObject.ToolChain, AutoGenObject.Arch),
|
(AutoGenObject.BuildTarget, AutoGenObject.ToolChain, AutoGenObject.Arch),
|
||||||
ExtraData=str(AutoGenObject))
|
ExtraData=str(AutoGenObject))
|
||||||
|
|
||||||
makefile = GenMake.BuildFile(AutoGenObject)._FILE_NAME_[GenMake.gMakeType]
|
|
||||||
|
|
||||||
# run
|
# run
|
||||||
if Target == 'run':
|
if Target == 'run':
|
||||||
return True
|
return True
|
||||||
@@ -1270,35 +1263,56 @@ class Build():
|
|||||||
LaunchCommand(BuildCommand, AutoGenObject.MakeFileDir)
|
LaunchCommand(BuildCommand, AutoGenObject.MakeFileDir)
|
||||||
self.CreateAsBuiltInf()
|
self.CreateAsBuiltInf()
|
||||||
if GlobalData.gBinCacheDest:
|
if GlobalData.gBinCacheDest:
|
||||||
self.UpdateBuildCache()
|
self.GenDestCache()
|
||||||
|
elif GlobalData.gUseHashCache and not GlobalData.gBinCacheSource:
|
||||||
|
# Only for --hash
|
||||||
|
# Update PreMakeCacheChain files
|
||||||
|
self.GenLocalPreMakeCache()
|
||||||
self.BuildModules = []
|
self.BuildModules = []
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# build library
|
# build library
|
||||||
if Target == 'libraries':
|
if Target == 'libraries':
|
||||||
for Lib in AutoGenObject.LibraryBuildDirectoryList:
|
DirList = []
|
||||||
NewBuildCommand = BuildCommand + ['-f', os.path.normpath(os.path.join(Lib, makefile)), 'pbuild']
|
for Lib in AutoGenObject.LibraryAutoGenList:
|
||||||
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir)
|
if not Lib.IsBinaryModule:
|
||||||
|
DirList.append((os.path.join(AutoGenObject.BuildDir, Lib.BuildDir),Lib))
|
||||||
|
for Lib, LibAutoGen in DirList:
|
||||||
|
NewBuildCommand = BuildCommand + ['-f', os.path.normpath(os.path.join(Lib, self.MakeFileName)), 'pbuild']
|
||||||
|
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir,LibAutoGen)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# build module
|
# build module
|
||||||
if Target == 'modules':
|
if Target == 'modules':
|
||||||
for Lib in AutoGenObject.LibraryBuildDirectoryList:
|
DirList = []
|
||||||
NewBuildCommand = BuildCommand + ['-f', os.path.normpath(os.path.join(Lib, makefile)), 'pbuild']
|
for Lib in AutoGenObject.LibraryAutoGenList:
|
||||||
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir)
|
if not Lib.IsBinaryModule:
|
||||||
for Mod in AutoGenObject.ModuleBuildDirectoryList:
|
DirList.append((os.path.join(AutoGenObject.BuildDir, Lib.BuildDir),Lib))
|
||||||
NewBuildCommand = BuildCommand + ['-f', os.path.normpath(os.path.join(Mod, makefile)), 'pbuild']
|
for Lib, LibAutoGen in DirList:
|
||||||
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir)
|
NewBuildCommand = BuildCommand + ['-f', os.path.normpath(os.path.join(Lib, self.MakeFileName)), 'pbuild']
|
||||||
|
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir,LibAutoGen)
|
||||||
|
|
||||||
|
DirList = []
|
||||||
|
for ModuleAutoGen in AutoGenObject.ModuleAutoGenList:
|
||||||
|
if not ModuleAutoGen.IsBinaryModule:
|
||||||
|
DirList.append((os.path.join(AutoGenObject.BuildDir, ModuleAutoGen.BuildDir),ModuleAutoGen))
|
||||||
|
for Mod,ModAutoGen in DirList:
|
||||||
|
NewBuildCommand = BuildCommand + ['-f', os.path.normpath(os.path.join(Mod, self.MakeFileName)), 'pbuild']
|
||||||
|
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir,ModAutoGen)
|
||||||
self.CreateAsBuiltInf()
|
self.CreateAsBuiltInf()
|
||||||
if GlobalData.gBinCacheDest:
|
if GlobalData.gBinCacheDest:
|
||||||
self.UpdateBuildCache()
|
self.GenDestCache()
|
||||||
|
elif GlobalData.gUseHashCache and not GlobalData.gBinCacheSource:
|
||||||
|
# Only for --hash
|
||||||
|
# Update PreMakeCacheChain files
|
||||||
|
self.GenLocalPreMakeCache()
|
||||||
self.BuildModules = []
|
self.BuildModules = []
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# cleanlib
|
# cleanlib
|
||||||
if Target == 'cleanlib':
|
if Target == 'cleanlib':
|
||||||
for Lib in AutoGenObject.LibraryBuildDirectoryList:
|
for Lib in AutoGenObject.LibraryBuildDirectoryList:
|
||||||
LibMakefile = os.path.normpath(os.path.join(Lib, makefile))
|
LibMakefile = os.path.normpath(os.path.join(Lib, self.MakeFileName))
|
||||||
if os.path.exists(LibMakefile):
|
if os.path.exists(LibMakefile):
|
||||||
NewBuildCommand = BuildCommand + ['-f', LibMakefile, 'cleanall']
|
NewBuildCommand = BuildCommand + ['-f', LibMakefile, 'cleanall']
|
||||||
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir)
|
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir)
|
||||||
@@ -1307,12 +1321,12 @@ class Build():
|
|||||||
# clean
|
# clean
|
||||||
if Target == 'clean':
|
if Target == 'clean':
|
||||||
for Mod in AutoGenObject.ModuleBuildDirectoryList:
|
for Mod in AutoGenObject.ModuleBuildDirectoryList:
|
||||||
ModMakefile = os.path.normpath(os.path.join(Mod, makefile))
|
ModMakefile = os.path.normpath(os.path.join(Mod, self.MakeFileName))
|
||||||
if os.path.exists(ModMakefile):
|
if os.path.exists(ModMakefile):
|
||||||
NewBuildCommand = BuildCommand + ['-f', ModMakefile, 'cleanall']
|
NewBuildCommand = BuildCommand + ['-f', ModMakefile, 'cleanall']
|
||||||
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir)
|
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir)
|
||||||
for Lib in AutoGenObject.LibraryBuildDirectoryList:
|
for Lib in AutoGenObject.LibraryBuildDirectoryList:
|
||||||
LibMakefile = os.path.normpath(os.path.join(Lib, makefile))
|
LibMakefile = os.path.normpath(os.path.join(Lib, self.MakeFileName))
|
||||||
if os.path.exists(LibMakefile):
|
if os.path.exists(LibMakefile):
|
||||||
NewBuildCommand = BuildCommand + ['-f', LibMakefile, 'cleanall']
|
NewBuildCommand = BuildCommand + ['-f', LibMakefile, 'cleanall']
|
||||||
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir)
|
LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir)
|
||||||
@@ -1387,7 +1401,11 @@ class Build():
|
|||||||
AutoGenObject.BuildTime = LaunchCommand(BuildCommand, AutoGenObject.MakeFileDir)
|
AutoGenObject.BuildTime = LaunchCommand(BuildCommand, AutoGenObject.MakeFileDir)
|
||||||
self.CreateAsBuiltInf()
|
self.CreateAsBuiltInf()
|
||||||
if GlobalData.gBinCacheDest:
|
if GlobalData.gBinCacheDest:
|
||||||
self.UpdateBuildCache()
|
self.GenDestCache()
|
||||||
|
elif GlobalData.gUseHashCache and not GlobalData.gBinCacheSource:
|
||||||
|
# Only for --hash
|
||||||
|
# Update PreMakeCacheChain files
|
||||||
|
self.GenLocalPreMakeCache()
|
||||||
self.BuildModules = []
|
self.BuildModules = []
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -1835,13 +1853,7 @@ class Build():
|
|||||||
if GlobalData.gEnableGenfdsMultiThread and self.Fdf:
|
if GlobalData.gEnableGenfdsMultiThread and self.Fdf:
|
||||||
CmdListDict = self._GenFfsCmd(Wa.ArchList)
|
CmdListDict = self._GenFfsCmd(Wa.ArchList)
|
||||||
|
|
||||||
# Add Platform and Package level hash in share_data for module hash calculation later
|
|
||||||
if GlobalData.gBinCacheSource or GlobalData.gBinCacheDest:
|
|
||||||
GlobalData.gCacheIR[('PlatformHash')] = GlobalData.gPlatformHash
|
|
||||||
for PkgName in GlobalData.gPackageHash.keys():
|
|
||||||
GlobalData.gCacheIR[(PkgName, 'PackageHash')] = GlobalData.gPackageHash[PkgName]
|
|
||||||
GlobalData.file_lock = mp.Lock()
|
GlobalData.file_lock = mp.Lock()
|
||||||
GlobalData.cache_lock = mp.Lock()
|
|
||||||
GlobalData.FfsCmd = CmdListDict
|
GlobalData.FfsCmd = CmdListDict
|
||||||
|
|
||||||
self.Progress.Stop("done!")
|
self.Progress.Stop("done!")
|
||||||
@@ -1853,8 +1865,6 @@ class Build():
|
|||||||
AutoGenStart = time.time()
|
AutoGenStart = time.time()
|
||||||
GlobalData.gGlobalDefines['ARCH'] = Arch
|
GlobalData.gGlobalDefines['ARCH'] = Arch
|
||||||
Pa = PlatformAutoGen(Wa, self.PlatformFile, BuildTarget, ToolChain, Arch)
|
Pa = PlatformAutoGen(Wa, self.PlatformFile, BuildTarget, ToolChain, Arch)
|
||||||
GlobalData.libConstPcd = Pa.DataPipe.Get("LibConstPcd")
|
|
||||||
GlobalData.Refes = Pa.DataPipe.Get("REFS")
|
|
||||||
for Module in Pa.Platform.Modules:
|
for Module in Pa.Platform.Modules:
|
||||||
if self.ModuleFile.Dir == Module.Dir and self.ModuleFile.Name == Module.Name:
|
if self.ModuleFile.Dir == Module.Dir and self.ModuleFile.Name == Module.Name:
|
||||||
Ma = ModuleAutoGen(Wa, Module, BuildTarget, ToolChain, Arch, self.PlatformFile,Pa.DataPipe)
|
Ma = ModuleAutoGen(Wa, Module, BuildTarget, ToolChain, Arch, self.PlatformFile,Pa.DataPipe)
|
||||||
@@ -1865,13 +1875,11 @@ class Build():
|
|||||||
Ma.Workspace = Wa
|
Ma.Workspace = Wa
|
||||||
MaList.append(Ma)
|
MaList.append(Ma)
|
||||||
|
|
||||||
if GlobalData.gBinCacheSource and self.Target in [None, "", "all"]:
|
if GlobalData.gUseHashCache and not GlobalData.gBinCacheDest and self.Target in [None, "", "all"]:
|
||||||
Ma.GenModuleFilesHash(GlobalData.gCacheIR)
|
if Ma.CanSkipbyPreMakeCache():
|
||||||
Ma.GenPreMakefileHash(GlobalData.gCacheIR)
|
|
||||||
if Ma.CanSkipbyPreMakefileCache(GlobalData.gCacheIR):
|
|
||||||
self.HashSkipModules.append(Ma)
|
|
||||||
EdkLogger.quiet("cache hit: %s[%s]" % (Ma.MetaFile.Path, Ma.Arch))
|
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
self.PreMakeCacheMiss.add(Ma)
|
||||||
|
|
||||||
# Not to auto-gen for targets 'clean', 'cleanlib', 'cleanall', 'run', 'fds'
|
# Not to auto-gen for targets 'clean', 'cleanlib', 'cleanall', 'run', 'fds'
|
||||||
if self.Target not in ['clean', 'cleanlib', 'cleanall', 'run', 'fds']:
|
if self.Target not in ['clean', 'cleanlib', 'cleanall', 'run', 'fds']:
|
||||||
@@ -1894,19 +1902,12 @@ class Build():
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
if GlobalData.gBinCacheSource and self.Target in [None, "", "all"]:
|
if GlobalData.gBinCacheSource and self.Target in [None, "", "all"]:
|
||||||
Ma.GenMakeHeaderFilesHash(GlobalData.gCacheIR)
|
if Ma.CanSkipbyMakeCache():
|
||||||
Ma.GenMakeHash(GlobalData.gCacheIR)
|
|
||||||
if Ma.CanSkipbyMakeCache(GlobalData.gCacheIR):
|
|
||||||
self.HashSkipModules.append(Ma)
|
|
||||||
EdkLogger.quiet("cache hit: %s[%s]" % (Ma.MetaFile.Path, Ma.Arch))
|
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
EdkLogger.quiet("cache miss: %s[%s]" % (Ma.MetaFile.Path, Ma.Arch))
|
self.MakeCacheMiss.add(Ma)
|
||||||
Ma.PrintFirstMakeCacheMissFile(GlobalData.gCacheIR)
|
|
||||||
|
|
||||||
self.BuildModules.append(Ma)
|
self.BuildModules.append(Ma)
|
||||||
# Initialize all modules in tracking to 'FAIL'
|
|
||||||
GlobalData.gModuleBuildTracking[Ma] = 'FAIL'
|
|
||||||
self.AutoGenTime += int(round((time.time() - AutoGenStart)))
|
self.AutoGenTime += int(round((time.time() - AutoGenStart)))
|
||||||
MakeStart = time.time()
|
MakeStart = time.time()
|
||||||
for Ma in self.BuildModules:
|
for Ma in self.BuildModules:
|
||||||
@@ -1917,7 +1918,6 @@ class Build():
|
|||||||
# we need a full version of makefile for platform
|
# we need a full version of makefile for platform
|
||||||
ExitFlag.set()
|
ExitFlag.set()
|
||||||
BuildTask.WaitForComplete()
|
BuildTask.WaitForComplete()
|
||||||
self.invalidateHash()
|
|
||||||
Pa.CreateMakeFile(False)
|
Pa.CreateMakeFile(False)
|
||||||
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
||||||
# Start task scheduler
|
# Start task scheduler
|
||||||
@@ -1927,7 +1927,6 @@ class Build():
|
|||||||
# in case there's an interruption. we need a full version of makefile for platform
|
# in case there's an interruption. we need a full version of makefile for platform
|
||||||
Pa.CreateMakeFile(False)
|
Pa.CreateMakeFile(False)
|
||||||
if BuildTask.HasError():
|
if BuildTask.HasError():
|
||||||
self.invalidateHash()
|
|
||||||
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
||||||
self.MakeTime += int(round((time.time() - MakeStart)))
|
self.MakeTime += int(round((time.time() - MakeStart)))
|
||||||
|
|
||||||
@@ -1936,11 +1935,14 @@ class Build():
|
|||||||
BuildTask.WaitForComplete()
|
BuildTask.WaitForComplete()
|
||||||
self.CreateAsBuiltInf()
|
self.CreateAsBuiltInf()
|
||||||
if GlobalData.gBinCacheDest:
|
if GlobalData.gBinCacheDest:
|
||||||
self.UpdateBuildCache()
|
self.GenDestCache()
|
||||||
|
elif GlobalData.gUseHashCache and not GlobalData.gBinCacheSource:
|
||||||
|
# Only for --hash
|
||||||
|
# Update PreMakeCacheChain files
|
||||||
|
self.GenLocalPreMakeCache()
|
||||||
self.BuildModules = []
|
self.BuildModules = []
|
||||||
self.MakeTime += int(round((time.time() - MakeContiue)))
|
self.MakeTime += int(round((time.time() - MakeContiue)))
|
||||||
if BuildTask.HasError():
|
if BuildTask.HasError():
|
||||||
self.invalidateHash()
|
|
||||||
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
||||||
|
|
||||||
self.BuildReport.AddPlatformReport(Wa, MaList)
|
self.BuildReport.AddPlatformReport(Wa, MaList)
|
||||||
@@ -1993,7 +1995,6 @@ class Build():
|
|||||||
# Save MAP buffer into MAP file.
|
# Save MAP buffer into MAP file.
|
||||||
#
|
#
|
||||||
self._SaveMapFile (MapBuffer, Wa)
|
self._SaveMapFile (MapBuffer, Wa)
|
||||||
self.invalidateHash()
|
|
||||||
|
|
||||||
def _GenFfsCmd(self,ArchList):
|
def _GenFfsCmd(self,ArchList):
|
||||||
# convert dictionary of Cmd:(Inf,Arch)
|
# convert dictionary of Cmd:(Inf,Arch)
|
||||||
@@ -2039,10 +2040,10 @@ class Build():
|
|||||||
ModuleBuildDirectoryList = data_pipe.Get("ModuleBuildDirectoryList")
|
ModuleBuildDirectoryList = data_pipe.Get("ModuleBuildDirectoryList")
|
||||||
|
|
||||||
for m_build_dir in LibraryBuildDirectoryList:
|
for m_build_dir in LibraryBuildDirectoryList:
|
||||||
if not os.path.exists(os.path.join(m_build_dir,GenMake.BuildFile._FILE_NAME_[GenMake.gMakeType])):
|
if not os.path.exists(os.path.join(m_build_dir,self.MakeFileName)):
|
||||||
return None
|
return None
|
||||||
for m_build_dir in ModuleBuildDirectoryList:
|
for m_build_dir in ModuleBuildDirectoryList:
|
||||||
if not os.path.exists(os.path.join(m_build_dir,GenMake.BuildFile._FILE_NAME_[GenMake.gMakeType])):
|
if not os.path.exists(os.path.join(m_build_dir,self.MakeFileName)):
|
||||||
return None
|
return None
|
||||||
Wa = WorkSpaceInfo(
|
Wa = WorkSpaceInfo(
|
||||||
workspacedir,active_p,target,toolchain,archlist
|
workspacedir,active_p,target,toolchain,archlist
|
||||||
@@ -2104,15 +2105,8 @@ class Build():
|
|||||||
if GlobalData.gEnableGenfdsMultiThread and self.Fdf:
|
if GlobalData.gEnableGenfdsMultiThread and self.Fdf:
|
||||||
CmdListDict = self._GenFfsCmd(Wa.ArchList)
|
CmdListDict = self._GenFfsCmd(Wa.ArchList)
|
||||||
|
|
||||||
# Add Platform and Package level hash in share_data for module hash calculation later
|
|
||||||
if GlobalData.gBinCacheSource or GlobalData.gBinCacheDest:
|
|
||||||
GlobalData.gCacheIR[('PlatformHash')] = GlobalData.gPlatformHash
|
|
||||||
for PkgName in GlobalData.gPackageHash.keys():
|
|
||||||
GlobalData.gCacheIR[(PkgName, 'PackageHash')] = GlobalData.gPackageHash[PkgName]
|
|
||||||
|
|
||||||
self.AutoGenTime += int(round((time.time() - WorkspaceAutoGenTime)))
|
self.AutoGenTime += int(round((time.time() - WorkspaceAutoGenTime)))
|
||||||
BuildModules = []
|
BuildModules = []
|
||||||
TotalModules = []
|
|
||||||
for Arch in Wa.ArchList:
|
for Arch in Wa.ArchList:
|
||||||
PcdMaList = []
|
PcdMaList = []
|
||||||
AutoGenStart = time.time()
|
AutoGenStart = time.time()
|
||||||
@@ -2134,61 +2128,81 @@ class Build():
|
|||||||
Pa.DataPipe.DataContainer = {"Workspace_timestamp": Wa._SrcTimeStamp}
|
Pa.DataPipe.DataContainer = {"Workspace_timestamp": Wa._SrcTimeStamp}
|
||||||
Pa.DataPipe.DataContainer = {"CommandTarget": self.Target}
|
Pa.DataPipe.DataContainer = {"CommandTarget": self.Target}
|
||||||
Pa.CreateLibModuelDirs()
|
Pa.CreateLibModuelDirs()
|
||||||
|
# Fetch the MakeFileName.
|
||||||
|
self.MakeFileName = Pa.MakeFileName
|
||||||
|
if not self.MakeFileName:
|
||||||
|
self.MakeFileName = Pa.MakeFile
|
||||||
|
|
||||||
Pa.DataPipe.DataContainer = {"LibraryBuildDirectoryList":Pa.LibraryBuildDirectoryList}
|
Pa.DataPipe.DataContainer = {"LibraryBuildDirectoryList":Pa.LibraryBuildDirectoryList}
|
||||||
Pa.DataPipe.DataContainer = {"ModuleBuildDirectoryList":Pa.ModuleBuildDirectoryList}
|
Pa.DataPipe.DataContainer = {"ModuleBuildDirectoryList":Pa.ModuleBuildDirectoryList}
|
||||||
Pa.DataPipe.DataContainer = {"FdsCommandDict": Wa.GenFdsCommandDict}
|
Pa.DataPipe.DataContainer = {"FdsCommandDict": Wa.GenFdsCommandDict}
|
||||||
|
# Prepare the cache share data for multiprocessing
|
||||||
|
Pa.DataPipe.DataContainer = {"gPlatformHashFile":GlobalData.gPlatformHashFile}
|
||||||
ModuleCodaFile = {}
|
ModuleCodaFile = {}
|
||||||
for ma in Pa.ModuleAutoGenList:
|
for ma in Pa.ModuleAutoGenList:
|
||||||
ModuleCodaFile[(ma.MetaFile.File,ma.MetaFile.Root,ma.Arch,ma.MetaFile.Path)] = [item.Target for item in ma.CodaTargetList]
|
ModuleCodaFile[(ma.MetaFile.File,ma.MetaFile.Root,ma.Arch,ma.MetaFile.Path)] = [item.Target for item in ma.CodaTargetList]
|
||||||
Pa.DataPipe.DataContainer = {"ModuleCodaFile":ModuleCodaFile}
|
Pa.DataPipe.DataContainer = {"ModuleCodaFile":ModuleCodaFile}
|
||||||
|
# ModuleList contains all driver modules only
|
||||||
for Module in ModuleList:
|
for Module in ModuleList:
|
||||||
# Get ModuleAutoGen object to generate C code file and makefile
|
# Get ModuleAutoGen object to generate C code file and makefile
|
||||||
Ma = ModuleAutoGen(Wa, Module, BuildTarget, ToolChain, Arch, self.PlatformFile,Pa.DataPipe)
|
Ma = ModuleAutoGen(Wa, Module, BuildTarget, ToolChain, Arch, self.PlatformFile,Pa.DataPipe)
|
||||||
|
|
||||||
if Ma is None:
|
if Ma is None:
|
||||||
continue
|
continue
|
||||||
if Ma.PcdIsDriver:
|
if Ma.PcdIsDriver:
|
||||||
Ma.PlatformInfo = Pa
|
Ma.PlatformInfo = Pa
|
||||||
Ma.Workspace = Wa
|
Ma.Workspace = Wa
|
||||||
PcdMaList.append(Ma)
|
PcdMaList.append(Ma)
|
||||||
TotalModules.append(Ma)
|
self.AllDrivers.add(Ma)
|
||||||
# Initialize all modules in tracking to 'FAIL'
|
self.AllModules.add(Ma)
|
||||||
GlobalData.gModuleBuildTracking[Ma] = 'FAIL'
|
|
||||||
|
|
||||||
|
|
||||||
mqueue = mp.Queue()
|
mqueue = mp.Queue()
|
||||||
|
cqueue = mp.Queue()
|
||||||
for m in Pa.GetAllModuleInfo:
|
for m in Pa.GetAllModuleInfo:
|
||||||
mqueue.put(m)
|
mqueue.put(m)
|
||||||
|
module_file,module_root,module_path,module_basename,\
|
||||||
|
module_originalpath,module_arch,IsLib = m
|
||||||
|
Ma = ModuleAutoGen(Wa, PathClass(module_path, Wa), BuildTarget,\
|
||||||
|
ToolChain, Arch, self.PlatformFile,Pa.DataPipe)
|
||||||
|
self.AllModules.add(Ma)
|
||||||
data_pipe_file = os.path.join(Pa.BuildDir, "GlobalVar_%s_%s.bin" % (str(Pa.Guid),Pa.Arch))
|
data_pipe_file = os.path.join(Pa.BuildDir, "GlobalVar_%s_%s.bin" % (str(Pa.Guid),Pa.Arch))
|
||||||
Pa.DataPipe.dump(data_pipe_file)
|
Pa.DataPipe.dump(data_pipe_file)
|
||||||
|
|
||||||
autogen_rt, errorcode = self.StartAutoGen(mqueue, Pa.DataPipe, self.SkipAutoGen, PcdMaList,GlobalData.gCacheIR)
|
autogen_rt, errorcode = self.StartAutoGen(mqueue, Pa.DataPipe, self.SkipAutoGen, PcdMaList, cqueue)
|
||||||
|
|
||||||
# Skip cache hit modules
|
|
||||||
if GlobalData.gBinCacheSource:
|
|
||||||
for Ma in TotalModules:
|
|
||||||
if (Ma.MetaFile.Path, Ma.Arch) in GlobalData.gCacheIR and \
|
|
||||||
GlobalData.gCacheIR[(Ma.MetaFile.Path, Ma.Arch)].PreMakeCacheHit:
|
|
||||||
self.HashSkipModules.append(Ma)
|
|
||||||
continue
|
|
||||||
if (Ma.MetaFile.Path, Ma.Arch) in GlobalData.gCacheIR and \
|
|
||||||
GlobalData.gCacheIR[(Ma.MetaFile.Path, Ma.Arch)].MakeCacheHit:
|
|
||||||
self.HashSkipModules.append(Ma)
|
|
||||||
continue
|
|
||||||
BuildModules.append(Ma)
|
|
||||||
else:
|
|
||||||
BuildModules.extend(TotalModules)
|
|
||||||
|
|
||||||
if not autogen_rt:
|
if not autogen_rt:
|
||||||
self.AutoGenMgr.TerminateWorkers()
|
self.AutoGenMgr.TerminateWorkers()
|
||||||
self.AutoGenMgr.join(1)
|
self.AutoGenMgr.join(1)
|
||||||
raise FatalError(errorcode)
|
raise FatalError(errorcode)
|
||||||
|
|
||||||
|
if GlobalData.gUseHashCache:
|
||||||
|
for item in GlobalData.gModuleAllCacheStatus:
|
||||||
|
(MetaFilePath, Arch, CacheStr, Status) = item
|
||||||
|
Ma = ModuleAutoGen(Wa, PathClass(MetaFilePath, Wa), BuildTarget,\
|
||||||
|
ToolChain, Arch, self.PlatformFile,Pa.DataPipe)
|
||||||
|
if CacheStr == "PreMakeCache" and Status == False:
|
||||||
|
self.PreMakeCacheMiss.add(Ma)
|
||||||
|
if CacheStr == "PreMakeCache" and Status == True:
|
||||||
|
self.PreMakeCacheHit.add(Ma)
|
||||||
|
GlobalData.gModuleCacheHit.add(Ma)
|
||||||
|
if CacheStr == "MakeCache" and Status == False:
|
||||||
|
self.MakeCacheMiss.add(Ma)
|
||||||
|
if CacheStr == "MakeCache" and Status == True:
|
||||||
|
self.MakeCacheHit.add(Ma)
|
||||||
|
GlobalData.gModuleCacheHit.add(Ma)
|
||||||
self.AutoGenTime += int(round((time.time() - AutoGenStart)))
|
self.AutoGenTime += int(round((time.time() - AutoGenStart)))
|
||||||
AutoGenIdFile = os.path.join(GlobalData.gConfDirectory,".AutoGenIdFile.txt")
|
AutoGenIdFile = os.path.join(GlobalData.gConfDirectory,".AutoGenIdFile.txt")
|
||||||
with open(AutoGenIdFile,"w") as fw:
|
with open(AutoGenIdFile,"w") as fw:
|
||||||
fw.write("Arch=%s\n" % "|".join((Wa.ArchList)))
|
fw.write("Arch=%s\n" % "|".join((Wa.ArchList)))
|
||||||
fw.write("BuildDir=%s\n" % Wa.BuildDir)
|
fw.write("BuildDir=%s\n" % Wa.BuildDir)
|
||||||
fw.write("PlatformGuid=%s\n" % str(Wa.AutoGenObjectList[0].Guid))
|
fw.write("PlatformGuid=%s\n" % str(Wa.AutoGenObjectList[0].Guid))
|
||||||
|
|
||||||
|
if GlobalData.gBinCacheSource:
|
||||||
|
BuildModules.extend(self.MakeCacheMiss)
|
||||||
|
elif GlobalData.gUseHashCache and not GlobalData.gBinCacheDest:
|
||||||
|
BuildModules.extend(self.PreMakeCacheMiss)
|
||||||
|
else:
|
||||||
|
BuildModules.extend(self.AllDrivers)
|
||||||
|
|
||||||
self.Progress.Stop("done!")
|
self.Progress.Stop("done!")
|
||||||
return Wa, BuildModules
|
return Wa, BuildModules
|
||||||
|
|
||||||
@@ -2198,6 +2212,7 @@ class Build():
|
|||||||
GlobalData.gGlobalDefines['TARGET'] = BuildTarget
|
GlobalData.gGlobalDefines['TARGET'] = BuildTarget
|
||||||
index = 0
|
index = 0
|
||||||
for ToolChain in self.ToolChainList:
|
for ToolChain in self.ToolChainList:
|
||||||
|
resetFdsGlobalVariable()
|
||||||
GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain
|
GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain
|
||||||
GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = ToolChain
|
GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = ToolChain
|
||||||
GlobalData.gGlobalDefines['FAMILY'] = self.ToolChainFamily[index]
|
GlobalData.gGlobalDefines['FAMILY'] = self.ToolChainFamily[index]
|
||||||
@@ -2218,18 +2233,9 @@ class Build():
|
|||||||
GlobalData.gAutoGenPhase = False
|
GlobalData.gAutoGenPhase = False
|
||||||
|
|
||||||
if GlobalData.gBinCacheSource:
|
if GlobalData.gBinCacheSource:
|
||||||
EdkLogger.quiet("Total cache hit driver num: %s, cache miss driver num: %s" % (len(set(self.HashSkipModules)), len(set(self.BuildModules))))
|
EdkLogger.quiet("[cache Summary]: Total module num: %s" % len(self.AllModules))
|
||||||
CacheHitMa = set()
|
EdkLogger.quiet("[cache Summary]: PreMakecache miss num: %s " % len(self.PreMakeCacheMiss))
|
||||||
CacheNotHitMa = set()
|
EdkLogger.quiet("[cache Summary]: Makecache miss num: %s " % len(self.MakeCacheMiss))
|
||||||
for IR in GlobalData.gCacheIR.keys():
|
|
||||||
if 'PlatformHash' in IR or 'PackageHash' in IR:
|
|
||||||
continue
|
|
||||||
if GlobalData.gCacheIR[IR].PreMakeCacheHit or GlobalData.gCacheIR[IR].MakeCacheHit:
|
|
||||||
CacheHitMa.add(IR)
|
|
||||||
else:
|
|
||||||
# There might be binary module or module which has .inc files, not count for cache miss
|
|
||||||
CacheNotHitMa.add(IR)
|
|
||||||
EdkLogger.quiet("Total module num: %s, cache hit module num: %s" % (len(CacheHitMa)+len(CacheNotHitMa), len(CacheHitMa)))
|
|
||||||
|
|
||||||
for Arch in Wa.ArchList:
|
for Arch in Wa.ArchList:
|
||||||
MakeStart = time.time()
|
MakeStart = time.time()
|
||||||
@@ -2242,7 +2248,6 @@ class Build():
|
|||||||
# we need a full version of makefile for platform
|
# we need a full version of makefile for platform
|
||||||
ExitFlag.set()
|
ExitFlag.set()
|
||||||
BuildTask.WaitForComplete()
|
BuildTask.WaitForComplete()
|
||||||
self.invalidateHash()
|
|
||||||
Pa.CreateMakeFile(False)
|
Pa.CreateMakeFile(False)
|
||||||
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
||||||
# Start task scheduler
|
# Start task scheduler
|
||||||
@@ -2252,7 +2257,6 @@ class Build():
|
|||||||
# in case there's an interruption. we need a full version of makefile for platform
|
# in case there's an interruption. we need a full version of makefile for platform
|
||||||
|
|
||||||
if BuildTask.HasError():
|
if BuildTask.HasError():
|
||||||
self.invalidateHash()
|
|
||||||
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
||||||
self.MakeTime += int(round((time.time() - MakeStart)))
|
self.MakeTime += int(round((time.time() - MakeStart)))
|
||||||
|
|
||||||
@@ -2266,7 +2270,11 @@ class Build():
|
|||||||
BuildTask.WaitForComplete()
|
BuildTask.WaitForComplete()
|
||||||
self.CreateAsBuiltInf()
|
self.CreateAsBuiltInf()
|
||||||
if GlobalData.gBinCacheDest:
|
if GlobalData.gBinCacheDest:
|
||||||
self.UpdateBuildCache()
|
self.GenDestCache()
|
||||||
|
elif GlobalData.gUseHashCache and not GlobalData.gBinCacheSource:
|
||||||
|
# Only for --hash
|
||||||
|
# Update PreMakeCacheChain files
|
||||||
|
self.GenLocalPreMakeCache()
|
||||||
#
|
#
|
||||||
# Get Module List
|
# Get Module List
|
||||||
#
|
#
|
||||||
@@ -2278,7 +2286,6 @@ class Build():
|
|||||||
# has been signaled.
|
# has been signaled.
|
||||||
#
|
#
|
||||||
if BuildTask.HasError():
|
if BuildTask.HasError():
|
||||||
self.invalidateHash()
|
|
||||||
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
|
||||||
|
|
||||||
# Create MAP file when Load Fix Address is enabled.
|
# Create MAP file when Load Fix Address is enabled.
|
||||||
@@ -2315,7 +2322,6 @@ class Build():
|
|||||||
#
|
#
|
||||||
self._SaveMapFile(MapBuffer, Wa)
|
self._SaveMapFile(MapBuffer, Wa)
|
||||||
self.CreateGuidedSectionToolsFile(Wa)
|
self.CreateGuidedSectionToolsFile(Wa)
|
||||||
self.invalidateHash()
|
|
||||||
## Generate GuidedSectionTools.txt in the FV directories.
|
## Generate GuidedSectionTools.txt in the FV directories.
|
||||||
#
|
#
|
||||||
def CreateGuidedSectionToolsFile(self,Wa):
|
def CreateGuidedSectionToolsFile(self,Wa):
|
||||||
@@ -2371,6 +2377,12 @@ class Build():
|
|||||||
## Launch the module or platform build
|
## Launch the module or platform build
|
||||||
#
|
#
|
||||||
def Launch(self):
|
def Launch(self):
|
||||||
|
self.AllDrivers = set()
|
||||||
|
self.AllModules = set()
|
||||||
|
self.PreMakeCacheMiss = set()
|
||||||
|
self.PreMakeCacheHit = set()
|
||||||
|
self.MakeCacheMiss = set()
|
||||||
|
self.MakeCacheHit = set()
|
||||||
if not self.ModuleFile:
|
if not self.ModuleFile:
|
||||||
if not self.SpawnMode or self.Target not in ["", "all"]:
|
if not self.SpawnMode or self.Target not in ["", "all"]:
|
||||||
self.SpawnMode = False
|
self.SpawnMode = False
|
||||||
@@ -2388,23 +2400,16 @@ class Build():
|
|||||||
for Module in self.BuildModules:
|
for Module in self.BuildModules:
|
||||||
Module.CreateAsBuiltInf()
|
Module.CreateAsBuiltInf()
|
||||||
|
|
||||||
def UpdateBuildCache(self):
|
def GenDestCache(self):
|
||||||
all_lib_set = set()
|
for Module in self.AllModules:
|
||||||
all_mod_set = set()
|
Module.GenPreMakefileHashList()
|
||||||
for Module in self.BuildModules:
|
Module.GenMakefileHashList()
|
||||||
Module.CopyModuleToCache()
|
Module.CopyModuleToCache()
|
||||||
all_mod_set.add(Module)
|
|
||||||
for Module in self.HashSkipModules:
|
def GenLocalPreMakeCache(self):
|
||||||
Module.CopyModuleToCache()
|
for Module in self.PreMakeCacheMiss:
|
||||||
all_mod_set.add(Module)
|
Module.GenPreMakefileHashList()
|
||||||
for Module in all_mod_set:
|
|
||||||
for lib in Module.LibraryAutoGenList:
|
|
||||||
all_lib_set.add(lib)
|
|
||||||
for lib in all_lib_set:
|
|
||||||
lib.CopyModuleToCache()
|
|
||||||
all_lib_set.clear()
|
|
||||||
all_mod_set.clear()
|
|
||||||
self.HashSkipModules = []
|
|
||||||
## Do some clean-up works when error occurred
|
## Do some clean-up works when error occurred
|
||||||
def Relinquish(self):
|
def Relinquish(self):
|
||||||
OldLogLevel = EdkLogger.GetLevel()
|
OldLogLevel = EdkLogger.GetLevel()
|
||||||
@@ -2444,9 +2449,15 @@ def LogBuildTime(Time):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
def ThreadNum():
|
def ThreadNum():
|
||||||
|
OptionParser = MyOptionParser()
|
||||||
|
if not OptionParser.BuildOption and not OptionParser.BuildTarget:
|
||||||
|
OptionParser.GetOption()
|
||||||
|
BuildOption, BuildTarget = OptionParser.BuildOption, OptionParser.BuildTarget
|
||||||
ThreadNumber = BuildOption.ThreadNumber
|
ThreadNumber = BuildOption.ThreadNumber
|
||||||
|
GlobalData.gCmdConfDir = BuildOption.ConfDirectory
|
||||||
if ThreadNumber is None:
|
if ThreadNumber is None:
|
||||||
ThreadNumber = TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER]
|
TargetObj = TargetTxtDict()
|
||||||
|
ThreadNumber = TargetObj.Target.TargetTxtDictionary[TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER]
|
||||||
if ThreadNumber == '':
|
if ThreadNumber == '':
|
||||||
ThreadNumber = 0
|
ThreadNumber = 0
|
||||||
else:
|
else:
|
||||||
@@ -2481,7 +2492,10 @@ def Main():
|
|||||||
#
|
#
|
||||||
# Parse the options and args
|
# Parse the options and args
|
||||||
#
|
#
|
||||||
Option, Target = BuildOption, BuildTarget
|
OptionParser = MyOptionParser()
|
||||||
|
if not OptionParser.BuildOption and not OptionParser.BuildTarget:
|
||||||
|
OptionParser.GetOption()
|
||||||
|
Option, Target = OptionParser.BuildOption, OptionParser.BuildTarget
|
||||||
GlobalData.gOptions = Option
|
GlobalData.gOptions = Option
|
||||||
GlobalData.gCaseInsensitive = Option.CaseInsensitive
|
GlobalData.gCaseInsensitive = Option.CaseInsensitive
|
||||||
|
|
||||||
|
105
BaseTools/Source/Python/build/buildoptions.py
Normal file
105
BaseTools/Source/Python/build/buildoptions.py
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
## @file
|
||||||
|
# build a platform or a module
|
||||||
|
#
|
||||||
|
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
|
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||||
|
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
|
||||||
|
# Version and Copyright
|
||||||
|
from Common.BuildVersion import gBUILD_VERSION
|
||||||
|
from optparse import OptionParser
|
||||||
|
VersionNumber = "0.60" + ' ' + gBUILD_VERSION
|
||||||
|
__version__ = "%prog Version " + VersionNumber
|
||||||
|
__copyright__ = "Copyright (c) 2007 - 2018, Intel Corporation All rights reserved."
|
||||||
|
|
||||||
|
gParamCheck = []
|
||||||
|
def SingleCheckCallback(option, opt_str, value, parser):
|
||||||
|
if option not in gParamCheck:
|
||||||
|
setattr(parser.values, option.dest, value)
|
||||||
|
gParamCheck.append(option)
|
||||||
|
else:
|
||||||
|
parser.error("Option %s only allows one instance in command line!" % option)
|
||||||
|
|
||||||
|
|
||||||
|
class MyOptionParser():
|
||||||
|
|
||||||
|
def __new__(cls, *args, **kw):
|
||||||
|
if not hasattr(cls, '_instance'):
|
||||||
|
orig = super(MyOptionParser, cls)
|
||||||
|
cls._instance = orig.__new__(cls, *args, **kw)
|
||||||
|
return cls._instance
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
if not hasattr(self, 'BuildOption'):
|
||||||
|
self.BuildOption = None
|
||||||
|
if not hasattr(self, 'BuildTarget'):
|
||||||
|
self.BuildTarget = None
|
||||||
|
|
||||||
|
def GetOption(self):
|
||||||
|
Parser = OptionParser(description=__copyright__, version=__version__, prog="build.exe", usage="%prog [options] [all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run]")
|
||||||
|
Parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32', 'X64', 'EBC', 'ARM', 'AARCH64'], dest="TargetArch",
|
||||||
|
help="ARCHS is one of list: IA32, X64, ARM, AARCH64 or EBC, which overrides target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option.")
|
||||||
|
Parser.add_option("-p", "--platform", action="callback", type="string", dest="PlatformFile", callback=SingleCheckCallback,
|
||||||
|
help="Build the platform specified by the DSC file name argument, overriding target.txt's ACTIVE_PLATFORM definition.")
|
||||||
|
Parser.add_option("-m", "--module", action="callback", type="string", dest="ModuleFile", callback=SingleCheckCallback,
|
||||||
|
help="Build the module specified by the INF file name argument.")
|
||||||
|
Parser.add_option("-b", "--buildtarget", type="string", dest="BuildTarget", help="Using the TARGET to build the platform, overriding target.txt's TARGET definition.",
|
||||||
|
action="append")
|
||||||
|
Parser.add_option("-t", "--tagname", action="append", type="string", dest="ToolChain",
|
||||||
|
help="Using the Tool Chain Tagname to build the platform, overriding target.txt's TOOL_CHAIN_TAG definition.")
|
||||||
|
Parser.add_option("-x", "--sku-id", action="callback", type="string", dest="SkuId", callback=SingleCheckCallback,
|
||||||
|
help="Using this name of SKU ID to build the platform, overriding SKUID_IDENTIFIER in DSC file.")
|
||||||
|
|
||||||
|
Parser.add_option("-n", action="callback", type="int", dest="ThreadNumber", callback=SingleCheckCallback,
|
||||||
|
help="Build the platform using multi-threaded compiler. The value overrides target.txt's MAX_CONCURRENT_THREAD_NUMBER. When value is set to 0, tool automatically detect number of "\
|
||||||
|
"processor threads, set value to 1 means disable multi-thread build, and set value to more than 1 means user specify the threads number to build.")
|
||||||
|
|
||||||
|
Parser.add_option("-f", "--fdf", action="callback", type="string", dest="FdfFile", callback=SingleCheckCallback,
|
||||||
|
help="The name of the FDF file to use, which overrides the setting in the DSC file.")
|
||||||
|
Parser.add_option("-r", "--rom-image", action="append", type="string", dest="RomImage", default=[],
|
||||||
|
help="The name of FD to be generated. The name must be from [FD] section in FDF file.")
|
||||||
|
Parser.add_option("-i", "--fv-image", action="append", type="string", dest="FvImage", default=[],
|
||||||
|
help="The name of FV to be generated. The name must be from [FV] section in FDF file.")
|
||||||
|
Parser.add_option("-C", "--capsule-image", action="append", type="string", dest="CapName", default=[],
|
||||||
|
help="The name of Capsule to be generated. The name must be from [Capsule] section in FDF file.")
|
||||||
|
Parser.add_option("-u", "--skip-autogen", action="store_true", dest="SkipAutoGen", help="Skip AutoGen step.")
|
||||||
|
Parser.add_option("-e", "--re-parse", action="store_true", dest="Reparse", help="Re-parse all meta-data files.")
|
||||||
|
|
||||||
|
Parser.add_option("-c", "--case-insensitive", action="store_true", dest="CaseInsensitive", default=False, help="Don't check case of file name.")
|
||||||
|
|
||||||
|
Parser.add_option("-w", "--warning-as-error", action="store_true", dest="WarningAsError", help="Treat warning in tools as error.")
|
||||||
|
Parser.add_option("-j", "--log", action="store", dest="LogFile", help="Put log in specified file as well as on console.")
|
||||||
|
|
||||||
|
Parser.add_option("-s", "--silent", action="store_true", type=None, dest="SilentMode",
|
||||||
|
help="Make use of silent mode of (n)make.")
|
||||||
|
Parser.add_option("-q", "--quiet", action="store_true", type=None, help="Disable all messages except FATAL ERRORS.")
|
||||||
|
Parser.add_option("-v", "--verbose", action="store_true", type=None, help="Turn on verbose output with informational messages printed, "\
|
||||||
|
"including library instances selected, final dependency expression, "\
|
||||||
|
"and warning messages, etc.")
|
||||||
|
Parser.add_option("-d", "--debug", action="store", type="int", help="Enable debug messages at specified level.")
|
||||||
|
Parser.add_option("-D", "--define", action="append", type="string", dest="Macros", help="Macro: \"Name [= Value]\".")
|
||||||
|
|
||||||
|
Parser.add_option("-y", "--report-file", action="store", dest="ReportFile", help="Create/overwrite the report to the specified filename.")
|
||||||
|
Parser.add_option("-Y", "--report-type", action="append", type="choice", choices=['PCD', 'LIBRARY', 'FLASH', 'DEPEX', 'BUILD_FLAGS', 'FIXED_ADDRESS', 'HASH', 'EXECUTION_ORDER'], dest="ReportType", default=[],
|
||||||
|
help="Flags that control the type of build report to generate. Must be one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS, HASH, EXECUTION_ORDER]. "\
|
||||||
|
"To specify more than one flag, repeat this option on the command line and the default flag set is [PCD, LIBRARY, FLASH, DEPEX, HASH, BUILD_FLAGS, FIXED_ADDRESS]")
|
||||||
|
Parser.add_option("-F", "--flag", action="store", type="string", dest="Flag",
|
||||||
|
help="Specify the specific option to parse EDK UNI file. Must be one of: [-c, -s]. -c is for EDK framework UNI file, and -s is for EDK UEFI UNI file. "\
|
||||||
|
"This option can also be specified by setting *_*_*_BUILD_FLAGS in [BuildOptions] section of platform DSC. If they are both specified, this value "\
|
||||||
|
"will override the setting in [BuildOptions] section of platform DSC.")
|
||||||
|
Parser.add_option("-N", "--no-cache", action="store_true", dest="DisableCache", default=False, help="Disable build cache mechanism")
|
||||||
|
Parser.add_option("--conf", action="store", type="string", dest="ConfDirectory", help="Specify the customized Conf directory.")
|
||||||
|
Parser.add_option("--check-usage", action="store_true", dest="CheckUsage", default=False, help="Check usage content of entries listed in INF file.")
|
||||||
|
Parser.add_option("--ignore-sources", action="store_true", dest="IgnoreSources", default=False, help="Focus to a binary build and ignore all source files")
|
||||||
|
Parser.add_option("--pcd", action="append", dest="OptionPcd", help="Set PCD value by command line. Format: \"PcdName=Value\" ")
|
||||||
|
Parser.add_option("-l", "--cmd-len", action="store", type="int", dest="CommandLength", help="Specify the maximum line length of build command. Default is 4096.")
|
||||||
|
Parser.add_option("--hash", action="store_true", dest="UseHashCache", default=False, help="Enable hash-based caching during build process.")
|
||||||
|
Parser.add_option("--binary-destination", action="store", type="string", dest="BinCacheDest", help="Generate a cache of binary files in the specified directory.")
|
||||||
|
Parser.add_option("--binary-source", action="store", type="string", dest="BinCacheSource", help="Consume a cache of binary files from the specified directory.")
|
||||||
|
Parser.add_option("--genfds-multi-thread", action="store_true", dest="GenfdsMultiThread", default=True, help="Enable GenFds multi thread to generate ffs file.")
|
||||||
|
Parser.add_option("--no-genfds-multi-thread", action="store_true", dest="NoGenfdsMultiThread", default=False, help="Disable GenFds multi thread to generate ffs file.")
|
||||||
|
Parser.add_option("--disable-include-path-check", action="store_true", dest="DisableIncludePathCheck", default=False, help="Disable the include path check for outside of package.")
|
||||||
|
self.BuildOption, self.BuildTarget = Parser.parse_args()
|
@@ -4,7 +4,7 @@
|
|||||||
# This Package provides cryptographic-related libraries for UEFI security modules.
|
# This Package provides cryptographic-related libraries for UEFI security modules.
|
||||||
# It also provides a test application to test libraries.
|
# It also provides a test application to test libraries.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
Include
|
Include
|
||||||
|
|
||||||
[Includes.Common.Private]
|
[Includes.Common.Private]
|
||||||
|
Private
|
||||||
Library/Include
|
Library/Include
|
||||||
Library/OpensslLib/openssl/include
|
Library/OpensslLib/openssl/include
|
||||||
Library/OpensslLib/openssl/crypto/include
|
Library/OpensslLib/openssl/crypto/include
|
||||||
@@ -33,5 +34,53 @@
|
|||||||
##
|
##
|
||||||
TlsLib|Include/Library/TlsLib.h
|
TlsLib|Include/Library/TlsLib.h
|
||||||
|
|
||||||
|
## @libraryclass Provides Unified API for different hash implementations.
|
||||||
|
#
|
||||||
|
HashApiLib|Include/Library/HashApiLib.h
|
||||||
|
|
||||||
|
[Protocols]
|
||||||
|
## EDK II Crypto DXE protocol
|
||||||
|
# 2C2275C9-3A7B-426F-BE54-2D22BD9D1092
|
||||||
|
gEdkiiCryptoProtocolGuid = { 0x2C2275C9, 0x3A7B, 0x426F, { 0xBE, 0x54, 0x2D, 0x22, 0xBD, 0x9D, 0x10, 0x92 }}
|
||||||
|
|
||||||
|
## EDK II Crypto SMM protocol
|
||||||
|
# F46B2EB2-E0D7-4C96-A3B1-CB7C572EB300
|
||||||
|
gEdkiiSmmCryptoProtocolGuid = { 0xF46B2EB2, 0xE0D7, 0x4C96, { 0xA3, 0xB1, 0xc, 0x61, 0xbb, 0x24, 0x5c, 0x42 }}
|
||||||
|
|
||||||
|
[Ppis]
|
||||||
|
## EDK II Crypto PPI
|
||||||
|
# 7DCE671B-C223-446A-A705-ED637AAF6771
|
||||||
|
gEdkiiCryptoPpiGuid = { 0x7DCE671B, 0xC223, 0x446A, { 0xA7, 0x05, 0xED, 0x63, 0x7A, 0xAF, 0x67, 0x71 }}
|
||||||
|
|
||||||
|
[Guids]
|
||||||
|
## Crypto package token space guid.
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid = { 0x6bd7de60, 0x9ef7, 0x4899, { 0x97, 0xd0, 0xab, 0xff, 0xfd, 0xe9, 0x70, 0xf2 } }
|
||||||
|
|
||||||
|
[PcdsFixedAtBuild]
|
||||||
|
## Enable/Disable the families and individual services produced by the
|
||||||
|
# EDK II Crypto Protocols/PPIs. The default is all services disabled.
|
||||||
|
# This Structured PCD is associated with PCD_CRYPTO_SERVICE_FAMILY_ENABLE
|
||||||
|
# structure that is defined in Include/Pcd/PcdCryptoServiceFamilyEnable.h.
|
||||||
|
# @Prompt Enable/Disable EDK II Crypto Protocol/PPI services
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable|{0x00}|PCD_CRYPTO_SERVICE_FAMILY_ENABLE|0x00000002 {
|
||||||
|
<Packages>
|
||||||
|
CryptoPkg/CryptoPkg.dec
|
||||||
|
<HeaderFiles>
|
||||||
|
Pcd/PcdCryptoServiceFamilyEnable.h
|
||||||
|
}
|
||||||
|
|
||||||
|
## This PCD indicates the HASH algorithm to calculate hash of data
|
||||||
|
# Based on the value set, the required algorithm is chosen to calculate
|
||||||
|
# the hash of data.<BR>
|
||||||
|
# The default hashing algorithm for BaseHashApiLib is set to SHA256.<BR>
|
||||||
|
# 0x00000001 - HASH_ALG_SHA1.<BR>
|
||||||
|
# 0x00000002 - HASH_ALG_SHA256.<BR>
|
||||||
|
# 0x00000004 - HASH_ALG_SHA384.<BR>
|
||||||
|
# 0x00000008 - HASH_ALG_SHA512.<BR>
|
||||||
|
# 0x00000010 - HASH_ALG_SM3_256.<BR>
|
||||||
|
# @Prompt Set policy for hashing unsigned image for Secure Boot.
|
||||||
|
# @ValidList 0x80000001 | 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdHashApiLibPolicy|0x00000002|UINT32|0x00000001
|
||||||
|
|
||||||
[UserExtensions.TianoCore."ExtraFiles"]
|
[UserExtensions.TianoCore."ExtraFiles"]
|
||||||
CryptoPkgExtra.uni
|
CryptoPkgExtra.uni
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
## @file
|
## @file
|
||||||
# Cryptographic Library Package for UEFI Security Implementation.
|
# Cryptographic Library Package for UEFI Security Implementation.
|
||||||
|
# PEIM, DXE Driver, and SMM Driver with all crypto services enabled.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
@@ -21,6 +22,28 @@
|
|||||||
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
|
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
|
||||||
SKUID_IDENTIFIER = DEFAULT
|
SKUID_IDENTIFIER = DEFAULT
|
||||||
|
|
||||||
|
#
|
||||||
|
# Flavor of PEI, DXE, SMM modules to build.
|
||||||
|
# Must be one of ALL, NONE, MIN_PEI, MIN_DXE_MIN_SMM.
|
||||||
|
# Default is ALL that is used for package build verification.
|
||||||
|
# PACKAGE - Package verification build of all components. Null
|
||||||
|
# versions of libraries are used to minimize build times.
|
||||||
|
# ALL - Build PEIM, DXE, and SMM drivers. Protocols and PPIs
|
||||||
|
# publish all services.
|
||||||
|
# NONE - Build PEIM, DXE, and SMM drivers. Protocols and PPIs
|
||||||
|
# publish no services. Used to verify compiler/linker
|
||||||
|
# optimizations are working correctly.
|
||||||
|
# MIN_PEI - Build PEIM with PPI that publishes minimum required
|
||||||
|
# services.
|
||||||
|
# MIN_DXE_MIN_SMM - Build DXE and SMM drivers with Protocols that publish
|
||||||
|
# minimum required services.
|
||||||
|
#
|
||||||
|
DEFINE CRYPTO_SERVICES = PACKAGE
|
||||||
|
!if $(CRYPTO_SERVICES) IN "PACKAGE ALL NONE MIN_PEI MIN_DXE_MIN_SMM"
|
||||||
|
!else
|
||||||
|
!error CRYPTO_SERVICES must be set to one of PACKAGE ALL NONE MIN_PEI MIN_DXE_MIN_SMM.
|
||||||
|
!endif
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Library Class section - list of all Library Classes needed by this Platform.
|
# Library Class section - list of all Library Classes needed by this Platform.
|
||||||
@@ -29,21 +52,13 @@
|
|||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
|
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
|
||||||
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
|
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
|
||||||
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
|
|
||||||
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
|
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
|
||||||
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
||||||
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
|
|
||||||
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
|
|
||||||
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
|
|
||||||
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
|
||||||
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
|
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
|
||||||
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
|
|
||||||
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
|
|
||||||
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
|
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
|
||||||
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
|
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
|
||||||
|
TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
|
||||||
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
|
HashApiLib|CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf
|
||||||
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
|
|
||||||
|
|
||||||
[LibraryClasses.ARM, LibraryClasses.AARCH64]
|
[LibraryClasses.ARM, LibraryClasses.AARCH64]
|
||||||
#
|
#
|
||||||
@@ -57,41 +72,140 @@
|
|||||||
# Add support for stack protector
|
# Add support for stack protector
|
||||||
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
|
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
|
||||||
|
|
||||||
|
[LibraryClasses.common.PEIM]
|
||||||
|
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
|
||||||
|
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
|
||||||
|
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
|
||||||
|
PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
|
||||||
|
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
|
||||||
|
|
||||||
|
[LibraryClasses.common.DXE_SMM_DRIVER]
|
||||||
|
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
|
||||||
|
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
|
||||||
|
|
||||||
|
!if $(CRYPTO_SERVICES) IN "ALL NONE MIN_PEI MIN_DXE_MIN_SMM"
|
||||||
|
[LibraryClasses]
|
||||||
|
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
|
||||||
|
DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
|
||||||
|
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
|
||||||
|
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
|
||||||
|
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
|
||||||
|
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
|
||||||
|
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
|
||||||
|
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
|
||||||
|
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf #???
|
||||||
|
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf #???
|
||||||
|
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
|
||||||
|
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
|
||||||
|
SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
|
||||||
|
|
||||||
[LibraryClasses.ARM]
|
[LibraryClasses.ARM]
|
||||||
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
|
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
|
||||||
|
|
||||||
[LibraryClasses.common.PEIM]
|
[LibraryClasses.common.PEIM]
|
||||||
|
PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
|
||||||
|
ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
|
||||||
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
|
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
|
||||||
|
TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
|
||||||
|
|
||||||
|
[LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM]
|
||||||
|
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
|
||||||
|
|
||||||
|
[LibraryClasses.ARM.PEIM, LibraryClasses.AARCH64.PEIM]
|
||||||
|
PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
|
||||||
|
|
||||||
[LibraryClasses.common.DXE_DRIVER]
|
[LibraryClasses.common.DXE_DRIVER]
|
||||||
|
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
|
||||||
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
|
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
|
||||||
|
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
|
||||||
[LibraryClasses.common.DXE_RUNTIME_DRIVER]
|
|
||||||
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
|
|
||||||
|
|
||||||
[LibraryClasses.common.DXE_SMM_DRIVER]
|
[LibraryClasses.common.DXE_SMM_DRIVER]
|
||||||
|
ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf
|
||||||
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
|
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
|
||||||
|
TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
|
||||||
[LibraryClasses.common.UEFI_DRIVER]
|
!endif
|
||||||
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
|
|
||||||
|
|
||||||
[LibraryClasses.common.UEFI_APPLICATION]
|
|
||||||
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Pcd Section - list of all EDK II PCD Entries defined by this Platform
|
# Pcd Section - list of all EDK II PCD Entries defined by this Platform
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
[PcdsFeatureFlag]
|
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
|
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE
|
|
||||||
|
|
||||||
[PcdsFixedAtBuild]
|
[PcdsFixedAtBuild]
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
|
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
|
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x06
|
gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x06
|
||||||
|
|
||||||
|
!if $(CRYPTO_SERVICES) IN "PACKAGE ALL"
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacMd5.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha1.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md4.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md5.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Dh.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Random.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tdes.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Arc4.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Hkdf.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tls.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsSet.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsGet.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!if $(CRYPTO_SERVICES) == MIN_PEI
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha1.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Pkcs1Verify | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.New | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Free | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.SetKey | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs5HashPassword | TRUE
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!if $(CRYPTO_SERVICES) == MIN_DXE_MIN_SMM
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha1.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs1v2Encrypt | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs5HashPassword | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs7Verify | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.VerifyEKUsInPkcs7Signature | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs7GetSigners | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs7FreeSigners | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.AuthenticodeVerify | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Random.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Pkcs1Verify | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.New | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Free | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.SetKey | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.GetPublicKeyFromX509 | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services.HashAll | FALSE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Services.GetSubjectName | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Services.GetCommonName | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Services.GetOrganizationName | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Services.GetTBSCert | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tls.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsSet.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsGet.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.Init | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.CbcEncrypt | TRUE
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.CbcDecrypt | TRUE
|
||||||
|
!endif
|
||||||
|
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
#
|
#
|
||||||
# Components Section - list of the modules and components that will be processed by compilation
|
# Components Section - list of the modules and components that will be processed by compilation
|
||||||
@@ -110,9 +224,11 @@
|
|||||||
# generated for it, but the binary will not be put into any firmware volume.
|
# generated for it, but the binary will not be put into any firmware volume.
|
||||||
#
|
#
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
!if $(CRYPTO_SERVICES) == PACKAGE
|
||||||
[Components]
|
[Components]
|
||||||
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
|
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
|
||||||
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
|
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
|
||||||
|
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
|
||||||
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
|
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
|
||||||
CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
|
CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
|
||||||
CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
|
CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
|
||||||
@@ -120,9 +236,52 @@
|
|||||||
CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
|
CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
|
||||||
CryptoPkg/Library/OpensslLib/OpensslLib.inf
|
CryptoPkg/Library/OpensslLib/OpensslLib.inf
|
||||||
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
|
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
|
||||||
|
CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf
|
||||||
|
|
||||||
|
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/PeiCryptLib.inf
|
||||||
|
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf
|
||||||
|
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/SmmCryptLib.inf
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!if $(CRYPTO_SERVICES) IN "PACKAGE ALL NONE MIN_PEI"
|
||||||
|
[Components.IA32, Components.X64, Components.ARM, Components.AARCH64]
|
||||||
|
CryptoPkg/Driver/CryptoPei.inf {
|
||||||
|
<Defines>
|
||||||
|
!if $(CRYPTO_SERVICES) == ALL
|
||||||
|
FILE_GUID = 8DF53C2E-3380-495F-A8B7-370CFE28E1C6
|
||||||
|
!elseif $(CRYPTO_SERVICES) == NONE
|
||||||
|
FILE_GUID = E5A97EE3-71CC-407F-9DA9-6BE0C8A6C7DF
|
||||||
|
!elseif $(CRYPTO_SERVICES) == MIN_PEI
|
||||||
|
FILE_GUID = 0F5827A9-35FD-4F41-8D38-9BAFCE594D31
|
||||||
|
!endif
|
||||||
|
}
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!if $(CRYPTO_SERVICES) IN "PACKAGE ALL NONE MIN_DXE_MIN_SMM"
|
||||||
|
[Components.IA32, Components.X64, Components.AARCH64]
|
||||||
|
CryptoPkg/Driver/CryptoDxe.inf {
|
||||||
|
<Defines>
|
||||||
|
!if $(CRYPTO_SERVICES) == ALL
|
||||||
|
FILE_GUID = D9444B06-060D-42C5-9344-F04707BE0169
|
||||||
|
!elseif $(CRYPTO_SERVICES) == NONE
|
||||||
|
FILE_GUID = C7A340F4-A6CC-4F95-A2DA-42BEA4C3944A
|
||||||
|
!elseif $(CRYPTO_SERVICES) == MIN_DXE_MIN_SMM
|
||||||
|
FILE_GUID = DDF5BE9E-159A-4B77-B6D7-82B84B5763A2
|
||||||
|
!endif
|
||||||
|
}
|
||||||
|
|
||||||
[Components.IA32, Components.X64]
|
[Components.IA32, Components.X64]
|
||||||
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
|
CryptoPkg/Driver/CryptoSmm.inf {
|
||||||
|
<Defines>
|
||||||
|
!if $(CRYPTO_SERVICES) == ALL
|
||||||
|
FILE_GUID = A3542CE8-77F7-49DC-A834-45D37D2EC1FA
|
||||||
|
!elseif $(CRYPTO_SERVICES) == NONE
|
||||||
|
FILE_GUID = 6DCB3127-01E7-4131-A487-DC77A965A541
|
||||||
|
!elseif $(CRYPTO_SERVICES) == MIN_DXE_MIN_SMM
|
||||||
|
FILE_GUID = 85F7EA15-3A2B-474A-8875-180542CD6BF3
|
||||||
|
!endif
|
||||||
|
}
|
||||||
|
!endif
|
||||||
|
|
||||||
[BuildOptions]
|
[BuildOptions]
|
||||||
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
|
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
// This Package provides cryptographic-related libraries for UEFI security modules.
|
// This Package provides cryptographic-related libraries for UEFI security modules.
|
||||||
// It also provides a test application to test libraries.
|
// It also provides a test application to test libraries.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: BSD-2-Clause-Patent
|
// SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
//
|
//
|
||||||
@@ -15,5 +15,18 @@
|
|||||||
|
|
||||||
#string STR_PACKAGE_DESCRIPTION #language en-US "This Package provides cryptographic-related libraries for UEFI security modules."
|
#string STR_PACKAGE_DESCRIPTION #language en-US "This Package provides cryptographic-related libraries for UEFI security modules."
|
||||||
|
|
||||||
|
#string STR_gEfiCryptoPkgTokenSpaceGuid_PcdHashApiLibPolicy_PROMPT #language en-US "HASH algorithm to calculate hash"
|
||||||
|
|
||||||
|
#string STR_gEfiCryptoPkgTokenSpaceGuid_PcdHashApiLibPolicy_HELP #language en-US "This PCD indicates the HASH algorithm to calculate hash of data.<BR><BR>\n"
|
||||||
|
"Based on the value set, the required algorithm is chosen to calculate\n"
|
||||||
|
"the hash of data.<BR>\n"
|
||||||
|
"The default hashing algorithm for BaseHashApiLib is set to SHA256.<BR>\n"
|
||||||
|
"0x00000001 - HASH_ALG_SHA1.<BR>\n"
|
||||||
|
"0x00000002 - HASH_ALG_SHA256.<BR>\n"
|
||||||
|
"0x00000004 - HASH_ALG_SHA384.<BR>\n"
|
||||||
|
"0x00000008 - HASH_ALG_SHA512.<BR>\n"
|
||||||
|
"0x00000010 - HASH_ALG_SM3.<BR>"
|
||||||
|
|
||||||
|
#string STR_gEfiCryptoPkgTokenSpaceGuid_PcdCryptoServiceFamilyEnable_PROMPT #language en-US "Enable/Disable EDK II Crypto Protocol/PPI services"
|
||||||
|
|
||||||
|
#string STR_gEfiCryptoPkgTokenSpaceGuid_PcdCryptoServiceFamilyEnable_HELP #language en-US "Enable/Disable the families and individual services produced by the EDK II Crypto Protocols/PPIs. The default is all services disabled. This Structured PCD is associated with PCD_CRYPTO_SERVICE_FAMILY_ENABLE structure that is defined in Include/Pcd/PcdCryptoServiceFamilyEnable.h."
|
||||||
|
4582
CryptoPkg/Driver/Crypto.c
Normal file
4582
CryptoPkg/Driver/Crypto.c
Normal file
File diff suppressed because it is too large
Load Diff
13
CryptoPkg/Driver/Crypto.uni
Normal file
13
CryptoPkg/Driver/Crypto.uni
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// /** @file
|
||||||
|
// Module that produces the EDK II Crypto Protocol/PPI using the library
|
||||||
|
// services from BaseCryptLib and TlsLib.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
//
|
||||||
|
// **/
|
||||||
|
|
||||||
|
#string STR_MODULE_ABSTRACT #language en-US "Module that produces the EDK II Crypto Protocol/PPI using the library services from BaseCryptLib and TlsLib"
|
||||||
|
|
||||||
|
#string STR_MODULE_DESCRIPTION #language en-US "Module that produces the EDK II Crypto Protocol/PPI using the library services from BaseCryptLib and TlsLib."
|
38
CryptoPkg/Driver/CryptoDxe.c
Normal file
38
CryptoPkg/Driver/CryptoDxe.c
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/** @file
|
||||||
|
Installs the EDK II Crypto Protocol
|
||||||
|
|
||||||
|
Copyright (C) Microsoft Corporation. All rights reserved.
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include <PiDxe.h>
|
||||||
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
|
#include <Protocol/Crypto.h>
|
||||||
|
|
||||||
|
extern CONST EDKII_CRYPTO_PROTOCOL mEdkiiCrypto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
The module Entry Point of the Crypto Dxe Driver.
|
||||||
|
|
||||||
|
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||||
|
@param[in] SystemTable A pointer to the EFI System Table.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||||
|
@retval Other Some error occurs when executing this entry point.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
CryptoDxeEntry (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return gBS->InstallMultipleProtocolInterfaces(
|
||||||
|
&ImageHandle,
|
||||||
|
&gEdkiiCryptoProtocolGuid,
|
||||||
|
(EDKII_CRYPTO_PROTOCOL *) &mEdkiiCrypto,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
}
|
49
CryptoPkg/Driver/CryptoDxe.inf
Normal file
49
CryptoPkg/Driver/CryptoDxe.inf
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
## @file
|
||||||
|
# Produces the EDK II Crypto Protocol using the library services from
|
||||||
|
# BaseCryptLib and TlsLib. PcdCryptoServiceFamilyEnable is used to enable the
|
||||||
|
# subset of available services.
|
||||||
|
#
|
||||||
|
# Copyright (C) Microsoft Corporation. All rights reserved.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
|
[Defines]
|
||||||
|
INF_VERSION = 0x0001001B
|
||||||
|
PI_SPECIFICATION_VERSION = 0x0001000A
|
||||||
|
BASE_NAME = CryptoDxe
|
||||||
|
MODULE_UNI_FILE = Crypto.uni
|
||||||
|
FILE_GUID = FEA01457-E381-4135-9475-C6AFD0076C61
|
||||||
|
MODULE_TYPE = DXE_DRIVER
|
||||||
|
VERSION_STRING = 1.0
|
||||||
|
ENTRY_POINT = CryptoDxeEntry
|
||||||
|
|
||||||
|
#
|
||||||
|
# The following information is for reference only and not required by the build tools.
|
||||||
|
#
|
||||||
|
# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
|
||||||
|
#
|
||||||
|
|
||||||
|
[Sources]
|
||||||
|
Crypto.c
|
||||||
|
CryptoDxe.c
|
||||||
|
|
||||||
|
[Packages]
|
||||||
|
MdePkg/MdePkg.dec
|
||||||
|
CryptoPkg/CryptoPkg.dec
|
||||||
|
|
||||||
|
[LibraryClasses]
|
||||||
|
UefiDriverEntryPoint
|
||||||
|
UefiBootServicesTableLib
|
||||||
|
DebugLib
|
||||||
|
BaseCryptLib
|
||||||
|
TlsLib
|
||||||
|
|
||||||
|
[Protocols]
|
||||||
|
gEdkiiCryptoProtocolGuid ## PRODUCES
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable #CONSUMES
|
||||||
|
|
||||||
|
[Depex]
|
||||||
|
TRUE
|
99
CryptoPkg/Driver/CryptoPei.c
Normal file
99
CryptoPkg/Driver/CryptoPei.c
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
/** @file
|
||||||
|
Installs the EDK II Crypto PPI. If this PEIM is dispatched before memory is
|
||||||
|
discovered, the RegisterForShadow() feature is used to reload this PEIM into
|
||||||
|
memory after memory is discovered.
|
||||||
|
|
||||||
|
Copyright (C) Microsoft Corporation. All rights reserved.
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include <PiPei.h>
|
||||||
|
#include <Library/PeiServicesLib.h>
|
||||||
|
#include <Library/DebugLib.h>
|
||||||
|
#include <Ppi/Crypto.h>
|
||||||
|
|
||||||
|
extern CONST EDKII_CRYPTO_PROTOCOL mEdkiiCrypto;
|
||||||
|
|
||||||
|
CONST EFI_PEI_PPI_DESCRIPTOR mEdkiiCryptoPpiList = {
|
||||||
|
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
|
||||||
|
&gEdkiiCryptoPpiGuid,
|
||||||
|
(EDKII_CRYPTO_PPI *) &mEdkiiCrypto
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
Entry to CryptoPeiEntry.
|
||||||
|
|
||||||
|
@param FileHandle The image handle.
|
||||||
|
@param PeiServices The PEI services table.
|
||||||
|
|
||||||
|
@retval Status From internal routine or boot object, should not fail
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
CryptoPeiEntry (
|
||||||
|
IN EFI_PEI_FILE_HANDLE FileHandle,
|
||||||
|
IN CONST EFI_PEI_SERVICES **PeiServices
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
VOID *MemoryDiscoveredPpi;
|
||||||
|
EDKII_CRYPTO_PPI *EdkiiCryptoPpi;
|
||||||
|
EFI_PEI_PPI_DESCRIPTOR *EdkiiCryptoPpiDescriptor;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Not all Open SSL services support XIP due to use of global variables.
|
||||||
|
// Use gEfiPeiMemoryDiscoveredPpiGuid to detect Pre-Mem and Post-Mem and
|
||||||
|
// always shadow this module in memory in Post-Mem.
|
||||||
|
//
|
||||||
|
Status = PeiServicesLocatePpi (
|
||||||
|
&gEfiPeiMemoryDiscoveredPpiGuid,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
(VOID **)&MemoryDiscoveredPpi
|
||||||
|
);
|
||||||
|
if (Status == EFI_NOT_FOUND) {
|
||||||
|
//
|
||||||
|
// CryptoPei is dispatched before gEfiPeiMemoryDiscoveredPpiGuid
|
||||||
|
//
|
||||||
|
Status = PeiServicesRegisterForShadow (FileHandle);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// First CryptoPpi installation. CryptoPei could come from memory or flash
|
||||||
|
// it will be re-installed after gEfiPeiMemoryDiscoveredPpiGuid
|
||||||
|
//
|
||||||
|
DEBUG ((DEBUG_INFO, "CryptoPeiEntry: Install Pre-Memory Crypto PPI\n"));
|
||||||
|
Status = PeiServicesInstallPpi (&mEdkiiCryptoPpiList);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
}
|
||||||
|
} else if (Status == EFI_SUCCESS) {
|
||||||
|
//
|
||||||
|
// CryptoPei is dispatched after gEfiPeiMemoryDiscoveredPpiGuid
|
||||||
|
//
|
||||||
|
Status = PeiServicesLocatePpi (
|
||||||
|
&gEdkiiCryptoPpiGuid,
|
||||||
|
0,
|
||||||
|
&EdkiiCryptoPpiDescriptor,
|
||||||
|
(VOID **)&EdkiiCryptoPpi
|
||||||
|
);
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// CryptoPei was also dispatched before gEfiPeiMemoryDiscoveredPpiGuid
|
||||||
|
//
|
||||||
|
DEBUG((DEBUG_INFO, "CryptoPeiEntry: ReInstall Post-Memmory Crypto PPI\n"));
|
||||||
|
Status = PeiServicesReInstallPpi (
|
||||||
|
EdkiiCryptoPpiDescriptor,
|
||||||
|
&mEdkiiCryptoPpiList
|
||||||
|
);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
} else {
|
||||||
|
DEBUG ((DEBUG_INFO, "CryptoPeiEntry: Install Post-Memmory Crypto PPI\n"));
|
||||||
|
Status = PeiServicesInstallPpi (&mEdkiiCryptoPpiList);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
51
CryptoPkg/Driver/CryptoPei.inf
Normal file
51
CryptoPkg/Driver/CryptoPei.inf
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
## @file
|
||||||
|
# Produces the EDK II Crypto PPI using the library services from BaseCryptLib
|
||||||
|
# and TlsLib. PcdCryptoServiceFamilyEnable is used to enable the subset of
|
||||||
|
# available services. If this PEIM is dispatched before memory is discovered,
|
||||||
|
# the RegisterForShadow() feature is used to reload this PEIM into memory after
|
||||||
|
# memory is discovered.
|
||||||
|
#
|
||||||
|
# Copyright (C) Microsoft Corporation. All rights reserved.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
|
[Defines]
|
||||||
|
INF_VERSION = 0x0001001B
|
||||||
|
BASE_NAME = CryptoPei
|
||||||
|
MODULE_UNI_FILE = Crypto.uni
|
||||||
|
FILE_GUID = 0D1CE46B-72D9-4BA7-95DA-23511865E661
|
||||||
|
MODULE_TYPE = PEIM
|
||||||
|
VERSION_STRING = 1.0
|
||||||
|
ENTRY_POINT = CryptoPeiEntry
|
||||||
|
|
||||||
|
#
|
||||||
|
# The following information is for reference only and not required by the build tools.
|
||||||
|
#
|
||||||
|
# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
|
||||||
|
#
|
||||||
|
|
||||||
|
[Sources]
|
||||||
|
Crypto.c
|
||||||
|
CryptoPei.c
|
||||||
|
|
||||||
|
[Packages]
|
||||||
|
MdePkg/MdePkg.dec
|
||||||
|
CryptoPkg/CryptoPkg.dec
|
||||||
|
|
||||||
|
[LibraryClasses]
|
||||||
|
PeimEntryPoint
|
||||||
|
PeiServicesLib
|
||||||
|
DebugLib
|
||||||
|
BaseCryptLib
|
||||||
|
TlsLib
|
||||||
|
|
||||||
|
[Ppis]
|
||||||
|
gEfiPeiMemoryDiscoveredPpiGuid ## CONSUMES
|
||||||
|
gEdkiiCryptoPpiGuid ## PRODUCES
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable ## CONSUMES
|
||||||
|
|
||||||
|
[Depex]
|
||||||
|
TRUE
|
41
CryptoPkg/Driver/CryptoSmm.c
Normal file
41
CryptoPkg/Driver/CryptoSmm.c
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/** @file
|
||||||
|
Installs the EDK II Crypto SMM Protocol
|
||||||
|
|
||||||
|
Copyright (C) Microsoft Corporation. All rights reserved.
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include <PiSmm.h>
|
||||||
|
#include <Library/SmmServicesTableLib.h>
|
||||||
|
#include <Protocol/SmmCrypto.h>
|
||||||
|
|
||||||
|
extern CONST EDKII_CRYPTO_PROTOCOL mEdkiiCrypto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
The module Entry Point of the Crypto SMM Driver.
|
||||||
|
|
||||||
|
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||||
|
@param[in] SystemTable A pointer to the EFI System Table.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||||
|
@retval Other Some error occurs when executing this entry point.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
CryptoSmmEntry (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_HANDLE Handle;
|
||||||
|
|
||||||
|
Handle = NULL;
|
||||||
|
return gSmst->SmmInstallProtocolInterface (
|
||||||
|
&Handle,
|
||||||
|
&gEdkiiSmmCryptoProtocolGuid,
|
||||||
|
EFI_NATIVE_INTERFACE,
|
||||||
|
(EDKII_CRYPTO_PROTOCOL *) &mEdkiiCrypto
|
||||||
|
);
|
||||||
|
}
|
49
CryptoPkg/Driver/CryptoSmm.inf
Normal file
49
CryptoPkg/Driver/CryptoSmm.inf
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
## @file
|
||||||
|
# Produces the EDK II SMM Crypto Protocol using the library services from
|
||||||
|
# BaseCryptLib and TlsLib. PcdCryptoServiceFamilyEnable is used to enable the
|
||||||
|
# subset of available services.
|
||||||
|
#
|
||||||
|
# Copyright (C) Microsoft Corporation. All rights reserved.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
|
[Defines]
|
||||||
|
INF_VERSION = 0x0001001B
|
||||||
|
PI_SPECIFICATION_VERSION = 0x00010014
|
||||||
|
BASE_NAME = CryptoSmm
|
||||||
|
MODULE_UNI_FILE = Crypto.uni
|
||||||
|
FILE_GUID = 391B853F-F488-479B-A3D6-870766C7A38F
|
||||||
|
MODULE_TYPE = DXE_SMM_DRIVER
|
||||||
|
VERSION_STRING = 1.0
|
||||||
|
ENTRY_POINT = CryptoSmmEntry
|
||||||
|
|
||||||
|
#
|
||||||
|
# The following information is for reference only and not required by the build tools.
|
||||||
|
#
|
||||||
|
# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
|
||||||
|
#
|
||||||
|
|
||||||
|
[Sources]
|
||||||
|
Crypto.c
|
||||||
|
CryptoSmm.c
|
||||||
|
|
||||||
|
[Packages]
|
||||||
|
MdePkg/MdePkg.dec
|
||||||
|
CryptoPkg/CryptoPkg.dec
|
||||||
|
|
||||||
|
[LibraryClasses]
|
||||||
|
UefiDriverEntryPoint
|
||||||
|
SmmServicesTableLib
|
||||||
|
DebugLib
|
||||||
|
BaseCryptLib
|
||||||
|
TlsLib
|
||||||
|
|
||||||
|
[Protocols]
|
||||||
|
gEdkiiSmmCryptoProtocolGuid ## PRODUCES
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable ## CONSUMES
|
||||||
|
|
||||||
|
[Depex]
|
||||||
|
TRUE
|
@@ -4,7 +4,7 @@
|
|||||||
primitives (Hash Serials, HMAC, RSA, Diffie-Hellman, etc) for UEFI security
|
primitives (Hash Serials, HMAC, RSA, Diffie-Hellman, etc) for UEFI security
|
||||||
functionality enabling.
|
functionality enabling.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@@ -1025,23 +1025,6 @@ Sm3HashAll (
|
|||||||
// MAC (Message Authentication Code) Primitive
|
// MAC (Message Authentication Code) Primitive
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacMd5New() / HmacMd5Free() for HMAC-MD5 Context operations.)
|
|
||||||
|
|
||||||
If this interface is not supported, then return zero.
|
|
||||||
|
|
||||||
@return The size, in bytes, of the context buffer required for HMAC-MD5 operations.
|
|
||||||
@retval 0 This interface is not supported.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacMd5GetContextSize (
|
|
||||||
VOID
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use.
|
||||||
|
|
||||||
@@ -1073,24 +1056,24 @@ HmacMd5Free (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacMd5Update().
|
||||||
|
|
||||||
If HmacMd5Context is NULL, then return FALSE.
|
If HmacMd5Context is NULL, then return FALSE.
|
||||||
If this interface is not supported, then return FALSE.
|
If this interface is not supported, then return FALSE.
|
||||||
|
|
||||||
@param[out] HmacMd5Context Pointer to HMAC-MD5 context being initialized.
|
@param[out] HmacMd5Context Pointer to HMAC-MD5 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@retval TRUE HMAC-MD5 context initialization succeeded.
|
@retval TRUE Key is set successfully.
|
||||||
@retval FALSE HMAC-MD5 context initialization failed.
|
@retval FALSE Key is set unsuccessfully.
|
||||||
@retval FALSE This interface is not supported.
|
@retval FALSE This interface is not supported.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacMd5Init (
|
HmacMd5SetKey (
|
||||||
OUT VOID *HmacMd5Context,
|
OUT VOID *HmacMd5Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
@@ -1123,8 +1106,8 @@ HmacMd5Duplicate (
|
|||||||
|
|
||||||
This function performs HMAC-MD5 digest on a data buffer of the specified size.
|
This function performs HMAC-MD5 digest on a data buffer of the specified size.
|
||||||
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
||||||
HMAC-MD5 context should be already correctly initialized by HmacMd5Init(), and should not be
|
HMAC-MD5 context should be initialized by HmacMd5New(), and should not be finalized by
|
||||||
finalized by HmacMd5Final(). Behavior with invalid context is undefined.
|
HmacMd5Final(). Behavior with invalid context is undefined.
|
||||||
|
|
||||||
If HmacMd5Context is NULL, then return FALSE.
|
If HmacMd5Context is NULL, then return FALSE.
|
||||||
If this interface is not supported, then return FALSE.
|
If this interface is not supported, then return FALSE.
|
||||||
@@ -1152,8 +1135,8 @@ HmacMd5Update (
|
|||||||
This function completes HMAC-MD5 hash computation and retrieves the digest value into
|
This function completes HMAC-MD5 hash computation and retrieves the digest value into
|
||||||
the specified memory. After this function has been called, the HMAC-MD5 context cannot
|
the specified memory. After this function has been called, the HMAC-MD5 context cannot
|
||||||
be used again.
|
be used again.
|
||||||
HMAC-MD5 context should be already correctly initialized by HmacMd5Init(), and should not be
|
HMAC-MD5 context should be initialized by HmacMd5New(), and should not be finalized by
|
||||||
finalized by HmacMd5Final(). Behavior with invalid HMAC-MD5 context is undefined.
|
HmacMd5Final(). Behavior with invalid HMAC-MD5 context is undefined.
|
||||||
|
|
||||||
If HmacMd5Context is NULL, then return FALSE.
|
If HmacMd5Context is NULL, then return FALSE.
|
||||||
If HmacValue is NULL, then return FALSE.
|
If HmacValue is NULL, then return FALSE.
|
||||||
@@ -1175,23 +1158,6 @@ HmacMd5Final (
|
|||||||
OUT UINT8 *HmacValue
|
OUT UINT8 *HmacValue
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacSha1New() / HmacSha1Free() for HMAC-SHA1 Context operations.)
|
|
||||||
|
|
||||||
If this interface is not supported, then return zero.
|
|
||||||
|
|
||||||
@return The size, in bytes, of the context buffer required for HMAC-SHA1 operations.
|
|
||||||
@retval 0 This interface is not supported.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacSha1GetContextSize (
|
|
||||||
VOID
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 use.
|
||||||
|
|
||||||
@@ -1223,24 +1189,24 @@ HmacSha1Free (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacSha1Update().
|
||||||
|
|
||||||
If HmacSha1Context is NULL, then return FALSE.
|
If HmacSha1Context is NULL, then return FALSE.
|
||||||
If this interface is not supported, then return FALSE.
|
If this interface is not supported, then return FALSE.
|
||||||
|
|
||||||
@param[out] HmacSha1Context Pointer to HMAC-SHA1 context being initialized.
|
@param[out] HmacSha1Context Pointer to HMAC-SHA1 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@retval TRUE HMAC-SHA1 context initialization succeeded.
|
@retval TRUE The Key is set successfully.
|
||||||
@retval FALSE HMAC-SHA1 context initialization failed.
|
@retval FALSE The Key is set unsuccessfully.
|
||||||
@retval FALSE This interface is not supported.
|
@retval FALSE This interface is not supported.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacSha1Init (
|
HmacSha1SetKey (
|
||||||
OUT VOID *HmacSha1Context,
|
OUT VOID *HmacSha1Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
@@ -1273,8 +1239,8 @@ HmacSha1Duplicate (
|
|||||||
|
|
||||||
This function performs HMAC-SHA1 digest on a data buffer of the specified size.
|
This function performs HMAC-SHA1 digest on a data buffer of the specified size.
|
||||||
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
||||||
HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should not
|
HMAC-SHA1 context should be initialized by HmacSha1New(), and should not be finalized by
|
||||||
be finalized by HmacSha1Final(). Behavior with invalid context is undefined.
|
HmacSha1Final(). Behavior with invalid context is undefined.
|
||||||
|
|
||||||
If HmacSha1Context is NULL, then return FALSE.
|
If HmacSha1Context is NULL, then return FALSE.
|
||||||
If this interface is not supported, then return FALSE.
|
If this interface is not supported, then return FALSE.
|
||||||
@@ -1302,8 +1268,8 @@ HmacSha1Update (
|
|||||||
This function completes HMAC-SHA1 hash computation and retrieves the digest value into
|
This function completes HMAC-SHA1 hash computation and retrieves the digest value into
|
||||||
the specified memory. After this function has been called, the HMAC-SHA1 context cannot
|
the specified memory. After this function has been called, the HMAC-SHA1 context cannot
|
||||||
be used again.
|
be used again.
|
||||||
HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should
|
HMAC-SHA1 context should be initialized by HmacSha1New(), and should not be finalized
|
||||||
not be finalized by HmacSha1Final(). Behavior with invalid HMAC-SHA1 context is undefined.
|
by HmacSha1Final(). Behavior with invalid HMAC-SHA1 context is undefined.
|
||||||
|
|
||||||
If HmacSha1Context is NULL, then return FALSE.
|
If HmacSha1Context is NULL, then return FALSE.
|
||||||
If HmacValue is NULL, then return FALSE.
|
If HmacValue is NULL, then return FALSE.
|
||||||
@@ -1325,23 +1291,6 @@ HmacSha1Final (
|
|||||||
OUT UINT8 *HmacValue
|
OUT UINT8 *HmacValue
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)
|
|
||||||
|
|
||||||
If this interface is not supported, then return zero.
|
|
||||||
|
|
||||||
@return The size, in bytes, of the context buffer required for HMAC-SHA256 operations.
|
|
||||||
@retval 0 This interface is not supported.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacSha256GetContextSize (
|
|
||||||
VOID
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
|
||||||
|
|
||||||
@@ -1368,24 +1317,24 @@ HmacSha256Free (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacSha256Update().
|
||||||
|
|
||||||
If HmacSha256Context is NULL, then return FALSE.
|
If HmacSha256Context is NULL, then return FALSE.
|
||||||
If this interface is not supported, then return FALSE.
|
If this interface is not supported, then return FALSE.
|
||||||
|
|
||||||
@param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized.
|
@param[out] HmacSha256Context Pointer to HMAC-SHA256 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@retval TRUE HMAC-SHA256 context initialization succeeded.
|
@retval TRUE The Key is set successfully.
|
||||||
@retval FALSE HMAC-SHA256 context initialization failed.
|
@retval FALSE The Key is set unsuccessfully.
|
||||||
@retval FALSE This interface is not supported.
|
@retval FALSE This interface is not supported.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacSha256Init (
|
HmacSha256SetKey (
|
||||||
OUT VOID *HmacSha256Context,
|
OUT VOID *HmacSha256Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
@@ -1418,8 +1367,8 @@ HmacSha256Duplicate (
|
|||||||
|
|
||||||
This function performs HMAC-SHA256 digest on a data buffer of the specified size.
|
This function performs HMAC-SHA256 digest on a data buffer of the specified size.
|
||||||
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
||||||
HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should not
|
HMAC-SHA256 context should be initialized by HmacSha256New(), and should not be finalized
|
||||||
be finalized by HmacSha256Final(). Behavior with invalid context is undefined.
|
by HmacSha256Final(). Behavior with invalid context is undefined.
|
||||||
|
|
||||||
If HmacSha256Context is NULL, then return FALSE.
|
If HmacSha256Context is NULL, then return FALSE.
|
||||||
If this interface is not supported, then return FALSE.
|
If this interface is not supported, then return FALSE.
|
||||||
@@ -1447,8 +1396,8 @@ HmacSha256Update (
|
|||||||
This function completes HMAC-SHA256 hash computation and retrieves the digest value into
|
This function completes HMAC-SHA256 hash computation and retrieves the digest value into
|
||||||
the specified memory. After this function has been called, the HMAC-SHA256 context cannot
|
the specified memory. After this function has been called, the HMAC-SHA256 context cannot
|
||||||
be used again.
|
be used again.
|
||||||
HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should
|
HMAC-SHA256 context should be initialized by HmacSha256New(), and should not be finalized
|
||||||
not be finalized by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.
|
by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.
|
||||||
|
|
||||||
If HmacSha256Context is NULL, then return FALSE.
|
If HmacSha256Context is NULL, then return FALSE.
|
||||||
If HmacValue is NULL, then return FALSE.
|
If HmacValue is NULL, then return FALSE.
|
||||||
@@ -2422,6 +2371,32 @@ X509ConstructCertificate (
|
|||||||
OUT UINT8 **SingleX509Cert
|
OUT UINT8 **SingleX509Cert
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Construct a X509 stack object from a list of DER-encoded certificate data.
|
||||||
|
|
||||||
|
If X509Stack is NULL, then return FALSE.
|
||||||
|
If this interface is not supported, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.
|
||||||
|
On output, pointer to the X509 stack object with new
|
||||||
|
inserted X509 certificate.
|
||||||
|
@param[in] Args VA_LIST marker for the variable argument list.
|
||||||
|
A list of DER-encoded single certificate data followed
|
||||||
|
by certificate size. A NULL terminates the list. The
|
||||||
|
pairs are the arguments to X509ConstructCertificate().
|
||||||
|
|
||||||
|
@retval TRUE The X509 stack construction succeeded.
|
||||||
|
@retval FALSE The construction operation failed.
|
||||||
|
@retval FALSE This interface is not supported.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
X509ConstructCertificateStackV (
|
||||||
|
IN OUT UINT8 **X509Stack,
|
||||||
|
IN VA_LIST Args
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Construct a X509 stack object from a list of DER-encoded certificate data.
|
Construct a X509 stack object from a list of DER-encoded certificate data.
|
||||||
|
|
||||||
|
110
CryptoPkg/Include/Library/HashApiLib.h
Normal file
110
CryptoPkg/Include/Library/HashApiLib.h
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
/** @file
|
||||||
|
Unified Hash API Defines
|
||||||
|
|
||||||
|
This API when called will calculate the Hash using the
|
||||||
|
hashing algorithm specified by PcdHashApiLibPolicy.
|
||||||
|
|
||||||
|
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#ifndef __HASH_API_LIB_H_
|
||||||
|
#define __HASH_API_LIB_H_
|
||||||
|
|
||||||
|
typedef VOID *HASH_API_CONTEXT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Retrieves the size, in bytes, of the context buffer required for hash operations.
|
||||||
|
|
||||||
|
@return The size, in bytes, of the context buffer required for hash operations.
|
||||||
|
**/
|
||||||
|
UINTN
|
||||||
|
EFIAPI
|
||||||
|
HashApiGetContextSize (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Init hash sequence.
|
||||||
|
|
||||||
|
@param[out] HashContext Hash context.
|
||||||
|
|
||||||
|
@retval TRUE Hash start and HashHandle returned.
|
||||||
|
@retval FALSE Hash Init unsuccessful.
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
HashApiInit (
|
||||||
|
OUT HASH_API_CONTEXT HashContext
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Makes a copy of an existing hash context.
|
||||||
|
|
||||||
|
@param[in] HashContext Hash context.
|
||||||
|
@param[out] NewHashContext New copy of hash context.
|
||||||
|
|
||||||
|
@retval TRUE Hash context copy succeeded.
|
||||||
|
@retval FALSE Hash context copy failed.
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
HashApiDuplicate (
|
||||||
|
IN HASH_API_CONTEXT HashContext,
|
||||||
|
OUT HASH_API_CONTEXT NewHashContext
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Update hash data.
|
||||||
|
|
||||||
|
@param[in] HashContext Hash context.
|
||||||
|
@param[in] DataToHash Data to be hashed.
|
||||||
|
@param[in] DataToHashLen Data size.
|
||||||
|
|
||||||
|
@retval TRUE Hash updated.
|
||||||
|
@retval FALSE Hash updated unsuccessful.
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
HashApiUpdate (
|
||||||
|
IN HASH_API_CONTEXT HashContext,
|
||||||
|
IN VOID *DataToHash,
|
||||||
|
IN UINTN DataToHashLen
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Hash complete.
|
||||||
|
|
||||||
|
@param[in] HashContext Hash context.
|
||||||
|
@param[out] Digest Hash Digest.
|
||||||
|
|
||||||
|
@retval TRUE Hash complete and Digest is returned.
|
||||||
|
@retval FALSE Hash complete unsuccessful.
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
HashApiFinal (
|
||||||
|
IN HASH_API_CONTEXT HashContext,
|
||||||
|
OUT UINT8 *Digest
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Computes hash message digest of a input data buffer.
|
||||||
|
|
||||||
|
@param[in] DataToHash Data to be hashed.
|
||||||
|
@param[in] DataToHashLen Data size.
|
||||||
|
@param[out] Digest Hash Digest.
|
||||||
|
|
||||||
|
@retval TRUE Hash digest computation succeeded.
|
||||||
|
@retval FALSE Hash digest computation failed.
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
HashApiHashAll (
|
||||||
|
IN CONST VOID *DataToHash,
|
||||||
|
IN UINTN DataToHashLen,
|
||||||
|
OUT UINT8 *Digest
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif
|
293
CryptoPkg/Include/Pcd/PcdCryptoServiceFamilyEnable.h
Normal file
293
CryptoPkg/Include/Pcd/PcdCryptoServiceFamilyEnable.h
Normal file
@@ -0,0 +1,293 @@
|
|||||||
|
/** @file
|
||||||
|
Defines the PCD_CRYPTO_SERVICE_FAMILY_ENABLE structure associated with
|
||||||
|
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.
|
||||||
|
|
||||||
|
Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#ifndef __PCD_CRYPTO_SERVICE_FAMILY_ENABLE_H__
|
||||||
|
#define __PCD_CRYPTO_SERVICE_FAMILY_ENABLE_H__
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Define used to enable all the crypto services in a family
|
||||||
|
///
|
||||||
|
#define PCD_CRYPTO_SERVICE_ENABLE_FAMILY 0xFFFFFFFF
|
||||||
|
|
||||||
|
///
|
||||||
|
/// PCD_CRYPTO_SERVICE_FAMILY_ENABLE structure. Each field in this structure
|
||||||
|
/// is associated with a service in the EDK II Crypto Protocol/PPI. This allows
|
||||||
|
/// each individual service to be enabled/disabled in a DSC file. Services are
|
||||||
|
/// also grouped into families. Unions are used to support enabling or
|
||||||
|
/// disabling an entire family in a single DSC statement.
|
||||||
|
///
|
||||||
|
typedef struct {
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 New:1;
|
||||||
|
UINT8 Free:1;
|
||||||
|
UINT8 SetKey:1;
|
||||||
|
UINT8 Duplicate:1;
|
||||||
|
UINT8 Update:1;
|
||||||
|
UINT8 Final:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} HmacMd5;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 New:1;
|
||||||
|
UINT8 Free:1;
|
||||||
|
UINT8 SetKey:1;
|
||||||
|
UINT8 Duplicate:1;
|
||||||
|
UINT8 Update:1;
|
||||||
|
UINT8 Final:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} HmacSha1;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 New:1;
|
||||||
|
UINT8 Free:1;
|
||||||
|
UINT8 SetKey:1;
|
||||||
|
UINT8 Duplicate:1;
|
||||||
|
UINT8 Update:1;
|
||||||
|
UINT8 Final:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} HmacSha256;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 GetContextSize:1;
|
||||||
|
UINT8 Init:1;
|
||||||
|
UINT8 Duplicate:1;
|
||||||
|
UINT8 Update:1;
|
||||||
|
UINT8 Final:1;
|
||||||
|
UINT8 HashAll:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Md4;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 GetContextSize:1;
|
||||||
|
UINT8 Init:1;
|
||||||
|
UINT8 Duplicate:1;
|
||||||
|
UINT8 Update:1;
|
||||||
|
UINT8 Final:1;
|
||||||
|
UINT8 HashAll:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Md5;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 Pkcs1v2Encrypt:1;
|
||||||
|
UINT8 Pkcs5HashPassword:1;
|
||||||
|
UINT8 Pkcs7Verify:1;
|
||||||
|
UINT8 VerifyEKUsInPkcs7Signature:1;
|
||||||
|
UINT8 Pkcs7GetSigners:1;
|
||||||
|
UINT8 Pkcs7FreeSigners:1;
|
||||||
|
UINT8 Pkcs7Sign:1;
|
||||||
|
UINT8 Pkcs7GetAttachedContent:1;
|
||||||
|
UINT8 Pkcs7GetCertificatesList:1;
|
||||||
|
UINT8 AuthenticodeVerify:1;
|
||||||
|
UINT8 ImageTimestampVerify:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Pkcs;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 New:1;
|
||||||
|
UINT8 Free:1;
|
||||||
|
UINT8 GenerateParameter:1;
|
||||||
|
UINT8 SetParameter:1;
|
||||||
|
UINT8 GenerateKey:1;
|
||||||
|
UINT8 ComputeKey:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Dh;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 Seed:1;
|
||||||
|
UINT8 Bytes:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Random;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 VerifyPkcs1:1;
|
||||||
|
UINT8 New:1;
|
||||||
|
UINT8 Free:1;
|
||||||
|
UINT8 SetKey:1;
|
||||||
|
UINT8 GetKey:1;
|
||||||
|
UINT8 GenerateKey:1;
|
||||||
|
UINT8 CheckKey:1;
|
||||||
|
UINT8 Pkcs1Sign:1;
|
||||||
|
UINT8 Pkcs1Verify:1;
|
||||||
|
UINT8 GetPrivateKeyFromPem:1;
|
||||||
|
UINT8 GetPublicKeyFromX509:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Rsa;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 GetContextSize:1;
|
||||||
|
UINT8 Init:1;
|
||||||
|
UINT8 Duplicate:1;
|
||||||
|
UINT8 Update:1;
|
||||||
|
UINT8 Final:1;
|
||||||
|
UINT8 HashAll:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Sha1;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 GetContextSize:1;
|
||||||
|
UINT8 Init:1;
|
||||||
|
UINT8 Duplicate:1;
|
||||||
|
UINT8 Update:1;
|
||||||
|
UINT8 Final:1;
|
||||||
|
UINT8 HashAll:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Sha256;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 GetContextSize:1;
|
||||||
|
UINT8 Init:1;
|
||||||
|
UINT8 Duplicate:1;
|
||||||
|
UINT8 Update:1;
|
||||||
|
UINT8 Final:1;
|
||||||
|
UINT8 HashAll:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Sha384;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 GetContextSize:1;
|
||||||
|
UINT8 Init:1;
|
||||||
|
UINT8 Duplicate:1;
|
||||||
|
UINT8 Update:1;
|
||||||
|
UINT8 Final:1;
|
||||||
|
UINT8 HashAll:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Sha512;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 GetSubjectName:1;
|
||||||
|
UINT8 GetCommonName:1;
|
||||||
|
UINT8 GetOrganizationName:1;
|
||||||
|
UINT8 VerifyCert:1;
|
||||||
|
UINT8 ConstructCertificate:1;
|
||||||
|
UINT8 ConstructCertificateStack:1;
|
||||||
|
UINT8 ConstructCertificateStackV:1;
|
||||||
|
UINT8 Free:1;
|
||||||
|
UINT8 StackFree:1;
|
||||||
|
UINT8 GetTBSCert:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} X509;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 GetContextSize:1;
|
||||||
|
UINT8 Init:1;
|
||||||
|
UINT8 EcbEncrypt:1;
|
||||||
|
UINT8 EcbDecrypt:1;
|
||||||
|
UINT8 CbcEncrypt:1;
|
||||||
|
UINT8 CbcDecrypt:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Tdes;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 GetContextSize:1;
|
||||||
|
UINT8 Init:1;
|
||||||
|
UINT8 EcbEncrypt:1;
|
||||||
|
UINT8 EcbDecrypt:1;
|
||||||
|
UINT8 CbcEncrypt:1;
|
||||||
|
UINT8 CbcDecrypt:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Aes;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 GetContextSize:1;
|
||||||
|
UINT8 Init:1;
|
||||||
|
UINT8 Encrypt:1;
|
||||||
|
UINT8 Decrypt:1;
|
||||||
|
UINT8 Reset:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Arc4;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 GetContextSize:1;
|
||||||
|
UINT8 Init:1;
|
||||||
|
UINT8 Duplicate:1;
|
||||||
|
UINT8 Update:1;
|
||||||
|
UINT8 Final:1;
|
||||||
|
UINT8 HashAll:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Sm3;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 Sha256ExtractAndExpand;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Hkdf;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 Initialize:1;
|
||||||
|
UINT8 CtxFree:1;
|
||||||
|
UINT8 CtxNew:1;
|
||||||
|
UINT8 Free:1;
|
||||||
|
UINT8 New:1;
|
||||||
|
UINT8 InHandshake:1;
|
||||||
|
UINT8 DoHandshake:1;
|
||||||
|
UINT8 HandleAlert:1;
|
||||||
|
UINT8 CloseNotify:1;
|
||||||
|
UINT8 CtrlTrafficOut:1;
|
||||||
|
UINT8 CtrlTrafficIn:1;
|
||||||
|
UINT8 Read:1;
|
||||||
|
UINT8 Write:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} Tls;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 Version:1;
|
||||||
|
UINT8 ConnectionEnd:1;
|
||||||
|
UINT8 CipherList:1;
|
||||||
|
UINT8 CompressionMethod:1;
|
||||||
|
UINT8 Verify:1;
|
||||||
|
UINT8 VerifyHost:1;
|
||||||
|
UINT8 SessionId:1;
|
||||||
|
UINT8 CaCertificate:1;
|
||||||
|
UINT8 HostPublicCert:1;
|
||||||
|
UINT8 HostPrivateKey:1;
|
||||||
|
UINT8 CertRevocationList:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} TlsSet;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
UINT8 Version:1;
|
||||||
|
UINT8 ConnectionEnd:1;
|
||||||
|
UINT8 CurrentCipher:1;
|
||||||
|
UINT8 CurrentCompressionId:1;
|
||||||
|
UINT8 Verify:1;
|
||||||
|
UINT8 SessionId:1;
|
||||||
|
UINT8 ClientRandom:1;
|
||||||
|
UINT8 ServerRandom:1;
|
||||||
|
UINT8 KeyMaterial:1;
|
||||||
|
UINT8 CaCertificate:1;
|
||||||
|
UINT8 HostPublicCert:1;
|
||||||
|
UINT8 HostPrivateKey:1;
|
||||||
|
UINT8 CertRevocationList:1;
|
||||||
|
} Services;
|
||||||
|
UINT32 Family;
|
||||||
|
} TlsGet;
|
||||||
|
} PCD_CRYPTO_SERVICE_FAMILY_ENABLE;
|
||||||
|
|
||||||
|
#endif
|
@@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
HMAC-MD5 Wrapper Implementation over OpenSSL.
|
HMAC-MD5 Wrapper Implementation over OpenSSL.
|
||||||
|
|
||||||
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@@ -9,37 +9,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
#include "InternalCryptLib.h"
|
#include "InternalCryptLib.h"
|
||||||
#include <openssl/hmac.h>
|
#include <openssl/hmac.h>
|
||||||
|
|
||||||
//
|
|
||||||
// NOTE: OpenSSL redefines the size of HMAC_CTX at crypto/hmac/hmac_lcl.h
|
|
||||||
// #define HMAC_MAX_MD_CBLOCK_SIZE 144
|
|
||||||
//
|
|
||||||
#define HMAC_MD5_CTX_SIZE (sizeof(void *) * 4 + sizeof(unsigned int) + \
|
|
||||||
sizeof(unsigned char) * 144)
|
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacMd5New() / HmacMd5Free() for HMAC-MD5 Context operations.)
|
|
||||||
|
|
||||||
@return The size, in bytes, of the context buffer required for HMAC-MD5 operations.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacMd5GetContextSize (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Retrieves the OpenSSL HMAC-MD5 Context Size
|
|
||||||
// NOTE: HMAC_CTX object was made opaque in openssl-1.1.x, here we just use the
|
|
||||||
// fixed size as a workaround to make this API work for compatibility.
|
|
||||||
// We should retire HmacMd5GetContextSize() in future, and use HmacMd5New()
|
|
||||||
// and HmacMd5Free() for context allocation and release.
|
|
||||||
//
|
|
||||||
return (UINTN) HMAC_MD5_CTX_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use.
|
||||||
|
|
||||||
@@ -78,22 +47,22 @@ HmacMd5Free (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacMd5Update().
|
||||||
|
|
||||||
If HmacMd5Context is NULL, then return FALSE.
|
If HmacMd5Context is NULL, then return FALSE.
|
||||||
|
|
||||||
@param[out] HmacMd5Context Pointer to HMAC-MD5 context being initialized.
|
@param[out] HmacMd5Context Pointer to HMAC-MD5 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@retval TRUE HMAC-MD5 context initialization succeeded.
|
@retval TRUE Key is set successfully.
|
||||||
@retval FALSE HMAC-MD5 context initialization failed.
|
@retval FALSE Key is set unsuccessfully.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacMd5Init (
|
HmacMd5SetKey (
|
||||||
OUT VOID *HmacMd5Context,
|
OUT VOID *HmacMd5Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
@@ -106,13 +75,6 @@ HmacMd5Init (
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// OpenSSL HMAC-MD5 Context Initialization
|
|
||||||
//
|
|
||||||
memset(HmacMd5Context, 0, HMAC_MD5_CTX_SIZE);
|
|
||||||
if (HMAC_CTX_reset ((HMAC_CTX *)HmacMd5Context) != 1) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (HMAC_Init_ex ((HMAC_CTX *)HmacMd5Context, Key, (UINT32) KeySize, EVP_md5(), NULL) != 1) {
|
if (HMAC_Init_ex ((HMAC_CTX *)HmacMd5Context, Key, (UINT32) KeySize, EVP_md5(), NULL) != 1) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -159,8 +121,8 @@ HmacMd5Duplicate (
|
|||||||
|
|
||||||
This function performs HMAC-MD5 digest on a data buffer of the specified size.
|
This function performs HMAC-MD5 digest on a data buffer of the specified size.
|
||||||
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
||||||
HMAC-MD5 context should be already correctly initialized by HmacMd5Init(), and should not be
|
HMAC-MD5 context should be initialized by HmacMd5New(), and should not be finalized by
|
||||||
finalized by HmacMd5Final(). Behavior with invalid context is undefined.
|
HmacMd5Final(). Behavior with invalid context is undefined.
|
||||||
|
|
||||||
If HmacMd5Context is NULL, then return FALSE.
|
If HmacMd5Context is NULL, then return FALSE.
|
||||||
|
|
||||||
@@ -210,8 +172,8 @@ HmacMd5Update (
|
|||||||
This function completes HMAC-MD5 digest computation and retrieves the digest value into
|
This function completes HMAC-MD5 digest computation and retrieves the digest value into
|
||||||
the specified memory. After this function has been called, the HMAC-MD5 context cannot
|
the specified memory. After this function has been called, the HMAC-MD5 context cannot
|
||||||
be used again.
|
be used again.
|
||||||
HMAC-MD5 context should be already correctly initialized by HmacMd5Init(), and should not be
|
HMAC-MD5 context should be initialized by HmacMd5New(), and should not be finalized by
|
||||||
finalized by HmacMd5Final(). Behavior with invalid HMAC-MD5 context is undefined.
|
HmacMd5Final(). Behavior with invalid HMAC-MD5 context is undefined.
|
||||||
|
|
||||||
If HmacMd5Context is NULL, then return FALSE.
|
If HmacMd5Context is NULL, then return FALSE.
|
||||||
If HmacValue is NULL, then return FALSE.
|
If HmacValue is NULL, then return FALSE.
|
||||||
|
@@ -1,33 +1,13 @@
|
|||||||
/** @file
|
/** @file
|
||||||
HMAC-MD5 Wrapper Implementation which does not provide real capabilities.
|
HMAC-MD5 Wrapper Implementation which does not provide real capabilities.
|
||||||
|
|
||||||
Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2012 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "InternalCryptLib.h"
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacMd5New() / HmacMd5Free() for HMAC-MD5 Context operations.)
|
|
||||||
|
|
||||||
Return zero to indicate this interface is not supported.
|
|
||||||
|
|
||||||
@retval 0 This interface is not supported.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacMd5GetContextSize (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ASSERT (FALSE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use.
|
||||||
|
|
||||||
@@ -65,12 +45,12 @@ HmacMd5Free (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacMd5Update().
|
||||||
|
|
||||||
Return FALSE to indicate this interface is not supported.
|
Return FALSE to indicate this interface is not supported.
|
||||||
|
|
||||||
@param[out] HmacMd5Context Pointer to HMAC-MD5 context being initialized.
|
@param[out] HmacMd5Context Pointer to HMAC-MD5 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@@ -79,7 +59,7 @@ HmacMd5Free (
|
|||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacMd5Init (
|
HmacMd5SetKey (
|
||||||
OUT VOID *HmacMd5Context,
|
OUT VOID *HmacMd5Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
HMAC-SHA1 Wrapper Implementation over OpenSSL.
|
HMAC-SHA1 Wrapper Implementation over OpenSSL.
|
||||||
|
|
||||||
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@@ -9,38 +9,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
#include "InternalCryptLib.h"
|
#include "InternalCryptLib.h"
|
||||||
#include <openssl/hmac.h>
|
#include <openssl/hmac.h>
|
||||||
|
|
||||||
//
|
|
||||||
// NOTE: OpenSSL redefines the size of HMAC_CTX at crypto/hmac/hmac_lcl.h
|
|
||||||
// #define HMAC_MAX_MD_CBLOCK_SIZE 144
|
|
||||||
//
|
|
||||||
//
|
|
||||||
#define HMAC_SHA1_CTX_SIZE (sizeof(void *) * 4 + sizeof(unsigned int) + \
|
|
||||||
sizeof(unsigned char) * 144)
|
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacSha1New() / HmacSha1Free() for HMAC-SHA1 Context operations.)
|
|
||||||
|
|
||||||
@return The size, in bytes, of the context buffer required for HMAC-SHA1 operations.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacSha1GetContextSize (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Retrieves the OpenSSL HMAC-SHA1 Context Size
|
|
||||||
// NOTE: HMAC_CTX object was made opaque in openssl-1.1.x, here we just use the
|
|
||||||
// fixed size as a workaround to make this API work for compatibility.
|
|
||||||
// We should retire HmacSha15GetContextSize() in future, and use HmacSha1New()
|
|
||||||
// and HmacSha1Free() for context allocation and release.
|
|
||||||
//
|
|
||||||
return (UINTN) HMAC_SHA1_CTX_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 use.
|
||||||
|
|
||||||
@@ -79,22 +47,22 @@ HmacSha1Free (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacSha1Update().
|
||||||
|
|
||||||
If HmacSha1Context is NULL, then return FALSE.
|
If HmacSha1Context is NULL, then return FALSE.
|
||||||
|
|
||||||
@param[out] HmacSha1Context Pointer to HMAC-SHA1 context being initialized.
|
@param[out] HmacSha1Context Pointer to HMAC-SHA1 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@retval TRUE HMAC-SHA1 context initialization succeeded.
|
@retval TRUE The Key is set successfully.
|
||||||
@retval FALSE HMAC-SHA1 context initialization failed.
|
@retval FALSE The Key is set unsuccessfully.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacSha1Init (
|
HmacSha1SetKey (
|
||||||
OUT VOID *HmacSha1Context,
|
OUT VOID *HmacSha1Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
@@ -107,13 +75,6 @@ HmacSha1Init (
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// OpenSSL HMAC-SHA1 Context Initialization
|
|
||||||
//
|
|
||||||
memset(HmacSha1Context, 0, HMAC_SHA1_CTX_SIZE);
|
|
||||||
if (HMAC_CTX_reset ((HMAC_CTX *)HmacSha1Context) != 1) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (HMAC_Init_ex ((HMAC_CTX *)HmacSha1Context, Key, (UINT32) KeySize, EVP_sha1(), NULL) != 1) {
|
if (HMAC_Init_ex ((HMAC_CTX *)HmacSha1Context, Key, (UINT32) KeySize, EVP_sha1(), NULL) != 1) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -160,8 +121,8 @@ HmacSha1Duplicate (
|
|||||||
|
|
||||||
This function performs HMAC-SHA1 digest on a data buffer of the specified size.
|
This function performs HMAC-SHA1 digest on a data buffer of the specified size.
|
||||||
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
||||||
HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should not
|
HMAC-SHA1 context should be initialized by HmacSha1New(), and should not be finalized by
|
||||||
be finalized by HmacSha1Final(). Behavior with invalid context is undefined.
|
HmacSha1Final(). Behavior with invalid context is undefined.
|
||||||
|
|
||||||
If HmacSha1Context is NULL, then return FALSE.
|
If HmacSha1Context is NULL, then return FALSE.
|
||||||
|
|
||||||
@@ -211,8 +172,8 @@ HmacSha1Update (
|
|||||||
This function completes HMAC-SHA1 digest computation and retrieves the digest value into
|
This function completes HMAC-SHA1 digest computation and retrieves the digest value into
|
||||||
the specified memory. After this function has been called, the HMAC-SHA1 context cannot
|
the specified memory. After this function has been called, the HMAC-SHA1 context cannot
|
||||||
be used again.
|
be used again.
|
||||||
HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should
|
HMAC-SHA1 context should be initialized by HmacSha1New(), and should not be finalized by
|
||||||
not be finalized by HmacSha1Final(). Behavior with invalid HMAC-SHA1 context is undefined.
|
HmacSha1Final(). Behavior with invalid HMAC-SHA1 context is undefined.
|
||||||
|
|
||||||
If HmacSha1Context is NULL, then return FALSE.
|
If HmacSha1Context is NULL, then return FALSE.
|
||||||
If HmacValue is NULL, then return FALSE.
|
If HmacValue is NULL, then return FALSE.
|
||||||
|
@@ -1,33 +1,13 @@
|
|||||||
/** @file
|
/** @file
|
||||||
HMAC-SHA1 Wrapper Implementation which does not provide real capabilities.
|
HMAC-SHA1 Wrapper Implementation which does not provide real capabilities.
|
||||||
|
|
||||||
Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2012 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "InternalCryptLib.h"
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacSha1New() / HmacSha1Free() for HMAC-SHA1 Context operations.)
|
|
||||||
|
|
||||||
Return zero to indicate this interface is not supported.
|
|
||||||
|
|
||||||
@retval 0 This interface is not supported.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacSha1GetContextSize (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ASSERT (FALSE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 use.
|
||||||
|
|
||||||
@@ -65,12 +45,12 @@ HmacSha1Free (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacSha1Update().
|
||||||
|
|
||||||
Return FALSE to indicate this interface is not supported.
|
Return FALSE to indicate this interface is not supported.
|
||||||
|
|
||||||
@param[out] HmacSha1Context Pointer to HMAC-SHA1 context being initialized.
|
@param[out] HmacSha1Context Pointer to HMAC-SHA1 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@@ -79,7 +59,7 @@ HmacSha1Free (
|
|||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacSha1Init (
|
HmacSha1SetKey (
|
||||||
OUT VOID *HmacSha1Context,
|
OUT VOID *HmacSha1Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
HMAC-SHA256 Wrapper Implementation over OpenSSL.
|
HMAC-SHA256 Wrapper Implementation over OpenSSL.
|
||||||
|
|
||||||
Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@@ -9,37 +9,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
#include "InternalCryptLib.h"
|
#include "InternalCryptLib.h"
|
||||||
#include <openssl/hmac.h>
|
#include <openssl/hmac.h>
|
||||||
|
|
||||||
//
|
|
||||||
// NOTE: OpenSSL redefines the size of HMAC_CTX at crypto/hmac/hmac_lcl.h
|
|
||||||
// #define HMAC_MAX_MD_CBLOCK_SIZE 144
|
|
||||||
//
|
|
||||||
#define HMAC_SHA256_CTX_SIZE (sizeof(void *) * 4 + sizeof(unsigned int) + \
|
|
||||||
sizeof(unsigned char) * 144)
|
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)
|
|
||||||
|
|
||||||
@return The size, in bytes, of the context buffer required for HMAC-SHA256 operations.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacSha256GetContextSize (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Retrieves the OpenSSL HMAC-SHA256 Context Size
|
|
||||||
// NOTE: HMAC_CTX object was made opaque in openssl-1.1.x, here we just use the
|
|
||||||
// fixed size as a workaround to make this API work for compatibility.
|
|
||||||
// We should retire HmacSha256GetContextSize() in future, and use HmacSha256New()
|
|
||||||
// and HmacSha256Free() for context allocation and release.
|
|
||||||
//
|
|
||||||
return (UINTN)HMAC_SHA256_CTX_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
|
||||||
|
|
||||||
@@ -78,22 +47,22 @@ HmacSha256Free (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacSha256Update().
|
||||||
|
|
||||||
If HmacSha256Context is NULL, then return FALSE.
|
If HmacSha256Context is NULL, then return FALSE.
|
||||||
|
|
||||||
@param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized.
|
@param[out] HmacSha256Context Pointer to HMAC-SHA256 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@retval TRUE HMAC-SHA256 context initialization succeeded.
|
@retval TRUE The Key is set successfully.
|
||||||
@retval FALSE HMAC-SHA256 context initialization failed.
|
@retval FALSE The Key is set unsuccessfully.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacSha256Init (
|
HmacSha256SetKey (
|
||||||
OUT VOID *HmacSha256Context,
|
OUT VOID *HmacSha256Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
@@ -106,13 +75,6 @@ HmacSha256Init (
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// OpenSSL HMAC-SHA256 Context Initialization
|
|
||||||
//
|
|
||||||
memset(HmacSha256Context, 0, HMAC_SHA256_CTX_SIZE);
|
|
||||||
if (HMAC_CTX_reset ((HMAC_CTX *)HmacSha256Context) != 1) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (HMAC_Init_ex ((HMAC_CTX *)HmacSha256Context, Key, (UINT32) KeySize, EVP_sha256(), NULL) != 1) {
|
if (HMAC_Init_ex ((HMAC_CTX *)HmacSha256Context, Key, (UINT32) KeySize, EVP_sha256(), NULL) != 1) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -159,8 +121,8 @@ HmacSha256Duplicate (
|
|||||||
|
|
||||||
This function performs HMAC-SHA256 digest on a data buffer of the specified size.
|
This function performs HMAC-SHA256 digest on a data buffer of the specified size.
|
||||||
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
It can be called multiple times to compute the digest of long or discontinuous data streams.
|
||||||
HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should not
|
HMAC-SHA256 context should be initialized by HmacSha256New(), and should not be finalized
|
||||||
be finalized by HmacSha256Final(). Behavior with invalid context is undefined.
|
by HmacSha256Final(). Behavior with invalid context is undefined.
|
||||||
|
|
||||||
If HmacSha256Context is NULL, then return FALSE.
|
If HmacSha256Context is NULL, then return FALSE.
|
||||||
|
|
||||||
@@ -210,8 +172,8 @@ HmacSha256Update (
|
|||||||
This function completes HMAC-SHA256 hash computation and retrieves the digest value into
|
This function completes HMAC-SHA256 hash computation and retrieves the digest value into
|
||||||
the specified memory. After this function has been called, the HMAC-SHA256 context cannot
|
the specified memory. After this function has been called, the HMAC-SHA256 context cannot
|
||||||
be used again.
|
be used again.
|
||||||
HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should
|
HMAC-SHA256 context should be initialized by HmacSha256New(), and should not be finalized
|
||||||
not be finalized by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.
|
by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.
|
||||||
|
|
||||||
If HmacSha256Context is NULL, then return FALSE.
|
If HmacSha256Context is NULL, then return FALSE.
|
||||||
If HmacValue is NULL, then return FALSE.
|
If HmacValue is NULL, then return FALSE.
|
||||||
|
@@ -1,33 +1,13 @@
|
|||||||
/** @file
|
/** @file
|
||||||
HMAC-SHA256 Wrapper Implementation which does not provide real capabilities.
|
HMAC-SHA256 Wrapper Implementation which does not provide real capabilities.
|
||||||
|
|
||||||
Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "InternalCryptLib.h"
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)
|
|
||||||
|
|
||||||
Return zero to indicate this interface is not supported.
|
|
||||||
|
|
||||||
@retval 0 This interface is not supported.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacSha256GetContextSize (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ASSERT (FALSE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
|
||||||
|
|
||||||
@@ -65,12 +45,12 @@ HmacSha256Free (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacSha256Update().
|
||||||
|
|
||||||
Return FALSE to indicate this interface is not supported.
|
Return FALSE to indicate this interface is not supported.
|
||||||
|
|
||||||
@param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized.
|
@param[out] HmacSha256Context Pointer to HMAC-SHA256 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@@ -79,7 +59,7 @@ HmacSha256Free (
|
|||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacSha256Init (
|
HmacSha256SetKey (
|
||||||
OUT VOID *HmacSha256Context,
|
OUT VOID *HmacSha256Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
3) RsaSetKey
|
3) RsaSetKey
|
||||||
4) RsaPkcs1Verify
|
4) RsaPkcs1Verify
|
||||||
|
|
||||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@@ -250,7 +250,7 @@ RsaSetKey (
|
|||||||
If RsaContext is NULL, then return FALSE.
|
If RsaContext is NULL, then return FALSE.
|
||||||
If MessageHash is NULL, then return FALSE.
|
If MessageHash is NULL, then return FALSE.
|
||||||
If Signature is NULL, then return FALSE.
|
If Signature is NULL, then return FALSE.
|
||||||
If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.
|
If HashSize is not equal to the size of MD5, SHA-1, SHA-256, SHA-384 or SHA-512 digest, then return FALSE.
|
||||||
|
|
||||||
@param[in] RsaContext Pointer to RSA context for signature verification.
|
@param[in] RsaContext Pointer to RSA context for signature verification.
|
||||||
@param[in] MessageHash Pointer to octet message hash to be checked.
|
@param[in] MessageHash Pointer to octet message hash to be checked.
|
||||||
@@ -288,7 +288,7 @@ RsaPkcs1Verify (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Determine the message digest algorithm according to digest size.
|
// Determine the message digest algorithm according to digest size.
|
||||||
// Only MD5, SHA-1 or SHA-256 algorithm is supported.
|
// Only MD5, SHA-1, SHA-256, SHA-384 or SHA-512 algorithm is supported.
|
||||||
//
|
//
|
||||||
switch (HashSize) {
|
switch (HashSize) {
|
||||||
case MD5_DIGEST_SIZE:
|
case MD5_DIGEST_SIZE:
|
||||||
@@ -303,6 +303,14 @@ RsaPkcs1Verify (
|
|||||||
DigestType = NID_sha256;
|
DigestType = NID_sha256;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SHA384_DIGEST_SIZE:
|
||||||
|
DigestType = NID_sha384;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SHA512_DIGEST_SIZE:
|
||||||
|
DigestType = NID_sha512;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
3) RsaCheckKey
|
3) RsaCheckKey
|
||||||
4) RsaPkcs1Sign
|
4) RsaPkcs1Sign
|
||||||
|
|
||||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@@ -276,7 +276,7 @@ RsaCheckKey (
|
|||||||
|
|
||||||
If RsaContext is NULL, then return FALSE.
|
If RsaContext is NULL, then return FALSE.
|
||||||
If MessageHash is NULL, then return FALSE.
|
If MessageHash is NULL, then return FALSE.
|
||||||
If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.
|
If HashSize is not equal to the size of MD5, SHA-1, SHA-256, SHA-384 or SHA-512 digest, then return FALSE.
|
||||||
If SigSize is large enough but Signature is NULL, then return FALSE.
|
If SigSize is large enough but Signature is NULL, then return FALSE.
|
||||||
|
|
||||||
@param[in] RsaContext Pointer to RSA context for signature generation.
|
@param[in] RsaContext Pointer to RSA context for signature generation.
|
||||||
@@ -326,7 +326,7 @@ RsaPkcs1Sign (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Determine the message digest algorithm according to digest size.
|
// Determine the message digest algorithm according to digest size.
|
||||||
// Only MD5, SHA-1 or SHA-256 algorithm is supported.
|
// Only MD5, SHA-1, SHA-256, SHA-384 or SHA-512 algorithm is supported.
|
||||||
//
|
//
|
||||||
switch (HashSize) {
|
switch (HashSize) {
|
||||||
case MD5_DIGEST_SIZE:
|
case MD5_DIGEST_SIZE:
|
||||||
@@ -341,6 +341,14 @@ RsaPkcs1Sign (
|
|||||||
DigestType = NID_sha256;
|
DigestType = NID_sha256;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SHA384_DIGEST_SIZE:
|
||||||
|
DigestType = NID_sha384;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SHA512_DIGEST_SIZE:
|
||||||
|
DigestType = NID_sha512;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
X.509 Certificate Handler Wrapper Implementation over OpenSSL.
|
X.509 Certificate Handler Wrapper Implementation over OpenSSL.
|
||||||
|
|
||||||
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@@ -60,23 +60,26 @@ X509ConstructCertificate (
|
|||||||
Construct a X509 stack object from a list of DER-encoded certificate data.
|
Construct a X509 stack object from a list of DER-encoded certificate data.
|
||||||
|
|
||||||
If X509Stack is NULL, then return FALSE.
|
If X509Stack is NULL, then return FALSE.
|
||||||
|
If this interface is not supported, then return FALSE.
|
||||||
|
|
||||||
@param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.
|
@param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.
|
||||||
On output, pointer to the X509 stack object with new
|
On output, pointer to the X509 stack object with new
|
||||||
inserted X509 certificate.
|
inserted X509 certificate.
|
||||||
@param ... A list of DER-encoded single certificate data followed
|
@param[in] Args VA_LIST marker for the variable argument list.
|
||||||
|
A list of DER-encoded single certificate data followed
|
||||||
by certificate size. A NULL terminates the list. The
|
by certificate size. A NULL terminates the list. The
|
||||||
pairs are the arguments to X509ConstructCertificate().
|
pairs are the arguments to X509ConstructCertificate().
|
||||||
|
|
||||||
@retval TRUE The X509 stack construction succeeded.
|
@retval TRUE The X509 stack construction succeeded.
|
||||||
@retval FALSE The construction operation failed.
|
@retval FALSE The construction operation failed.
|
||||||
|
@retval FALSE This interface is not supported.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
X509ConstructCertificateStack (
|
X509ConstructCertificateStackV (
|
||||||
IN OUT UINT8 **X509Stack,
|
IN OUT UINT8 **X509Stack,
|
||||||
...
|
IN VA_LIST Args
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT8 *Cert;
|
UINT8 *Cert;
|
||||||
@@ -84,7 +87,6 @@ X509ConstructCertificateStack (
|
|||||||
X509 *X509Cert;
|
X509 *X509Cert;
|
||||||
STACK_OF(X509) *CertStack;
|
STACK_OF(X509) *CertStack;
|
||||||
BOOLEAN Status;
|
BOOLEAN Status;
|
||||||
VA_LIST Args;
|
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -107,8 +109,6 @@ X509ConstructCertificateStack (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VA_START (Args, X509Stack);
|
|
||||||
|
|
||||||
for (Index = 0; ; Index++) {
|
for (Index = 0; ; Index++) {
|
||||||
//
|
//
|
||||||
// If Cert is NULL, then it is the end of the list.
|
// If Cert is NULL, then it is the end of the list.
|
||||||
@@ -145,8 +145,6 @@ X509ConstructCertificateStack (
|
|||||||
sk_X509_push (CertStack, X509Cert);
|
sk_X509_push (CertStack, X509Cert);
|
||||||
}
|
}
|
||||||
|
|
||||||
VA_END (Args);
|
|
||||||
|
|
||||||
if (!Status) {
|
if (!Status) {
|
||||||
sk_X509_pop_free (CertStack, X509_free);
|
sk_X509_pop_free (CertStack, X509_free);
|
||||||
} else {
|
} else {
|
||||||
@@ -156,6 +154,38 @@ X509ConstructCertificateStack (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Construct a X509 stack object from a list of DER-encoded certificate data.
|
||||||
|
|
||||||
|
If X509Stack is NULL, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.
|
||||||
|
On output, pointer to the X509 stack object with new
|
||||||
|
inserted X509 certificate.
|
||||||
|
@param ... A list of DER-encoded single certificate data followed
|
||||||
|
by certificate size. A NULL terminates the list. The
|
||||||
|
pairs are the arguments to X509ConstructCertificate().
|
||||||
|
|
||||||
|
@retval TRUE The X509 stack construction succeeded.
|
||||||
|
@retval FALSE The construction operation failed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
X509ConstructCertificateStack (
|
||||||
|
IN OUT UINT8 **X509Stack,
|
||||||
|
...
|
||||||
|
)
|
||||||
|
{
|
||||||
|
VA_LIST Args;
|
||||||
|
BOOLEAN Result;
|
||||||
|
|
||||||
|
VA_START (Args, X509Stack);
|
||||||
|
Result = X509ConstructCertificateStackV (X509Stack, Args);
|
||||||
|
VA_END (Args);
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Release the specified X509 object.
|
Release the specified X509 object.
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
X.509 Certificate Handler Wrapper Implementation which does not provide
|
X.509 Certificate Handler Wrapper Implementation which does not provide
|
||||||
real capabilities.
|
real capabilities.
|
||||||
|
|
||||||
Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2012 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@@ -33,6 +33,36 @@ X509ConstructCertificate (
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Construct a X509 stack object from a list of DER-encoded certificate data.
|
||||||
|
|
||||||
|
If X509Stack is NULL, then return FALSE.
|
||||||
|
If this interface is not supported, then return FALSE.
|
||||||
|
|
||||||
|
@param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.
|
||||||
|
On output, pointer to the X509 stack object with new
|
||||||
|
inserted X509 certificate.
|
||||||
|
@param[in] Args VA_LIST marker for the variable argument list.
|
||||||
|
A list of DER-encoded single certificate data followed
|
||||||
|
by certificate size. A NULL terminates the list. The
|
||||||
|
pairs are the arguments to X509ConstructCertificate().
|
||||||
|
|
||||||
|
@retval TRUE The X509 stack construction succeeded.
|
||||||
|
@retval FALSE The construction operation failed.
|
||||||
|
@retval FALSE This interface is not supported.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
X509ConstructCertificateStackV (
|
||||||
|
IN OUT UINT8 **X509Stack,
|
||||||
|
IN VA_LIST Args
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Construct a X509 stack object from a list of DER-encoded certificate data.
|
Construct a X509 stack object from a list of DER-encoded certificate data.
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
# This external input must be validated carefully to avoid security issues such as
|
# This external input must be validated carefully to avoid security issues such as
|
||||||
# buffer overflow or integer overflow.
|
# buffer overflow or integer overflow.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
Hmac/CryptHmacMd5Null.c
|
Hmac/CryptHmacMd5Null.c
|
||||||
Hmac/CryptHmacSha1Null.c
|
Hmac/CryptHmacSha1Null.c
|
||||||
Hmac/CryptHmacSha256Null.c
|
Hmac/CryptHmacSha256Null.c
|
||||||
|
Kdf/CryptHkdfNull.c
|
||||||
Cipher/CryptAesNull.c
|
Cipher/CryptAesNull.c
|
||||||
Cipher/CryptTdesNull.c
|
Cipher/CryptTdesNull.c
|
||||||
Cipher/CryptArc4Null.c
|
Cipher/CryptArc4Null.c
|
||||||
|
@@ -1,33 +1,13 @@
|
|||||||
/** @file
|
/** @file
|
||||||
HMAC-MD5 Wrapper Implementation which does not provide real capabilities.
|
HMAC-MD5 Wrapper Implementation which does not provide real capabilities.
|
||||||
|
|
||||||
Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2012 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "InternalCryptLib.h"
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacMd5New() / HmacMd5Free() for HMAC-MD5 Context operations.)
|
|
||||||
|
|
||||||
Return zero to indicate this interface is not supported.
|
|
||||||
|
|
||||||
@retval 0 This interface is not supported.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacMd5GetContextSize (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ASSERT (FALSE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use.
|
||||||
|
|
||||||
@@ -65,12 +45,12 @@ HmacMd5Free (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacMd5Update().
|
||||||
|
|
||||||
Return FALSE to indicate this interface is not supported.
|
Return FALSE to indicate this interface is not supported.
|
||||||
|
|
||||||
@param[out] HmacMd5Context Pointer to HMAC-MD5 context being initialized.
|
@param[out] HmacMd5Context Pointer to HMAC-MD5 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@@ -79,7 +59,7 @@ HmacMd5Free (
|
|||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacMd5Init (
|
HmacMd5SetKey (
|
||||||
OUT VOID *HmacMd5Context,
|
OUT VOID *HmacMd5Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
|
@@ -1,33 +1,13 @@
|
|||||||
/** @file
|
/** @file
|
||||||
HMAC-SHA1 Wrapper Implementation which does not provide real capabilities.
|
HMAC-SHA1 Wrapper Implementation which does not provide real capabilities.
|
||||||
|
|
||||||
Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2012 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "InternalCryptLib.h"
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacSha1New() / HmacSha1Free() for HMAC-SHA1 Context operations.)
|
|
||||||
|
|
||||||
Return zero to indicate this interface is not supported.
|
|
||||||
|
|
||||||
@retval 0 This interface is not supported.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacSha1GetContextSize (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ASSERT (FALSE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 use.
|
||||||
|
|
||||||
@@ -65,12 +45,12 @@ HmacSha1Free (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacSha1Update().
|
||||||
|
|
||||||
Return FALSE to indicate this interface is not supported.
|
Return FALSE to indicate this interface is not supported.
|
||||||
|
|
||||||
@param[out] HmacSha1Context Pointer to HMAC-SHA1 context being initialized.
|
@param[out] HmacSha1Context Pointer to HMAC-SHA1 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@@ -79,7 +59,7 @@ HmacSha1Free (
|
|||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacSha1Init (
|
HmacSha1SetKey (
|
||||||
OUT VOID *HmacSha1Context,
|
OUT VOID *HmacSha1Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
|
@@ -1,33 +1,13 @@
|
|||||||
/** @file
|
/** @file
|
||||||
HMAC-SHA256 Wrapper Implementation which does not provide real capabilities.
|
HMAC-SHA256 Wrapper Implementation which does not provide real capabilities.
|
||||||
|
|
||||||
Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "InternalCryptLib.h"
|
#include "InternalCryptLib.h"
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.
|
|
||||||
(NOTE: This API is deprecated.
|
|
||||||
Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)
|
|
||||||
|
|
||||||
Return zero to indicate this interface is not supported.
|
|
||||||
|
|
||||||
@retval 0 This interface is not supported.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
HmacSha256GetContextSize (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ASSERT (FALSE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
|
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
|
||||||
|
|
||||||
@@ -65,12 +45,12 @@ HmacSha256Free (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for
|
Set user-supplied key for subsequent use. It must be done before any
|
||||||
subsequent use.
|
calling to HmacSha256Update().
|
||||||
|
|
||||||
Return FALSE to indicate this interface is not supported.
|
Return FALSE to indicate this interface is not supported.
|
||||||
|
|
||||||
@param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized.
|
@param[out] HmacSha256Context Pointer to HMAC-SHA256 context.
|
||||||
@param[in] Key Pointer to the user-supplied key.
|
@param[in] Key Pointer to the user-supplied key.
|
||||||
@param[in] KeySize Key size in bytes.
|
@param[in] KeySize Key size in bytes.
|
||||||
|
|
||||||
@@ -79,7 +59,7 @@ HmacSha256Free (
|
|||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
HmacSha256Init (
|
HmacSha256SetKey (
|
||||||
OUT VOID *HmacSha256Context,
|
OUT VOID *HmacSha256Context,
|
||||||
IN CONST UINT8 *Key,
|
IN CONST UINT8 *Key,
|
||||||
IN UINTN KeySize
|
IN UINTN KeySize
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user