Compare commits
179 Commits
system76-c
...
vUDK2017
Author | SHA1 | Date | |
---|---|---|---|
324a4c9d7d | |||
37a0c27fe1 | |||
2447ae30ac | |||
9e0da2fa43 | |||
0a92412e8f | |||
a54759c134 | |||
ed6ff8b7d4 | |||
872c124c6f | |||
ec198f52fc | |||
d615a3a136 | |||
41e13d1056 | |||
a12787c356 | |||
a5765eec77 | |||
0164fa8f43 | |||
695d419c4c | |||
a56bfec25f | |||
756065c328 | |||
d82ea26664 | |||
f9a4814a2d | |||
c26c4067f3 | |||
3e47c01c85 | |||
fc2ef2115f | |||
121e15a578 | |||
14bb6567c7 | |||
8f0dea41bc | |||
0e3899bed8 | |||
0b5813b95d | |||
8ecee3850d | |||
508dc16eae | |||
ed500f9ed0 | |||
537b39af13 | |||
dc834fb544 | |||
60b6b38cde | |||
d3b84e02eb | |||
60ea76dd3a | |||
931f669d81 | |||
8bb0a06208 | |||
cfab632610 | |||
4dae0b6999 | |||
4f953cca20 | |||
6933eb824a | |||
e10f7f1bae | |||
19b5379a3c | |||
66a539b5d4 | |||
cb053bb8a3 | |||
1a6ed43a07 | |||
93637612c0 | |||
d58f502728 | |||
7ecf635971 | |||
454d99de04 | |||
3ecfa5668f | |||
2d18c3a917 | |||
ceaf8ece84 | |||
b46e49e70d | |||
b0cfe7bb57 | |||
6358c320ad | |||
1d22d00766 | |||
219fee13c8 | |||
14ddca5afe | |||
afd7109b1c | |||
b6adb11163 | |||
9107fb6f55 | |||
d30c0e3f5a | |||
9f7e9a0687 | |||
a08c8afa4c | |||
c345ecbb9b | |||
166481dabf | |||
52dd44ec92 | |||
103f53b650 | |||
0ebc1fa295 | |||
dee4573998 | |||
1316cced3e | |||
72d014cd18 | |||
ca89f36940 | |||
96f3ca2307 | |||
c95b7d8ee1 | |||
1531c7bd82 | |||
82729eef4c | |||
a28adad906 | |||
66dcf570a6 | |||
b583486b14 | |||
85426bd106 | |||
455af1049f | |||
08f2c8fd3a | |||
69a8a9ee20 | |||
bd49174d05 | |||
91751a0825 | |||
f30c40618b | |||
e399d6ff56 | |||
fd9e6ee972 | |||
32c1d95881 | |||
3b530b3896 | |||
c54144f512 | |||
7903b6d2b0 | |||
929246cc03 | |||
7ff98a2f77 | |||
c2fb3cd166 | |||
f567743825 | |||
09a0dbeb3f | |||
7154167901 | |||
2078ead60d | |||
efbf0349e7 | |||
eb7506f76d | |||
5b3b1e00dc | |||
905190af42 | |||
0c0490ecaa | |||
ed906ffb84 | |||
20237f4854 | |||
d64de223f7 | |||
7a4b6b1688 | |||
11a4e7057b | |||
ffd2cde5d2 | |||
1377330367 | |||
3b43e9c06a | |||
78fbc8ec8e | |||
88a0b204ec | |||
407a5c55ba | |||
44c7d1d40c | |||
5fc4b658e6 | |||
094d3a4142 | |||
28614a7b7c | |||
9b68006c93 | |||
0abf7713aa | |||
fa939c26b6 | |||
71a9aa1c50 | |||
4d3f4a20f1 | |||
9fe5799446 | |||
5794c3a92c | |||
844a25f983 | |||
b4244d101d | |||
f35772deee | |||
7430771ec3 | |||
ca740d75d6 | |||
d1ffb4e436 | |||
e51b591e2d | |||
6d644dd0d0 | |||
250c5b2aaa | |||
c0b1ed569f | |||
d7c94fca2f | |||
b4221a2e9e | |||
ce0f811c28 | |||
c29973b789 | |||
0a69072ca0 | |||
66cbba1044 | |||
5359955ddb | |||
f76eb7c132 | |||
d012503729 | |||
ffb4af3b5a | |||
4a75bfb5a0 | |||
757decbd53 | |||
870f872bad | |||
d999d6c8e4 | |||
cbdde352d1 | |||
6efcd38566 | |||
03b4f340d7 | |||
6e5dc5541b | |||
53ae831443 | |||
591c1bed31 | |||
abf1027b09 | |||
729b6b5164 | |||
adeef88496 | |||
321ec73af7 | |||
fc3ce2f30c | |||
7dbcca8820 | |||
6aecbe2de8 | |||
e83897e90c | |||
4df1410641 | |||
fca6831ae4 | |||
549a342e1e | |||
602b573d61 | |||
bfbcd7e4b2 | |||
1e2d930951 | |||
df082f757a | |||
0b75171b76 | |||
0ffecbead1 | |||
ca41ee781d | |||
c69a51ce65 | |||
ae480c61f4 | |||
cbfd09a014 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
Build/
|
||||
tags/
|
||||
.DS_Store
|
||||
|
@ -1 +1,2 @@
|
||||
Win32 https://svn.code.sf.net/p/edk2-toolbinaries/code/trunk/Win32
|
||||
Win32 -r 253 https://svn.code.sf.net/p/edk2-toolbinaries/code/trunk/Win32
|
||||
GIT: 0e088c19ab31fccd1d2f55d9e4fe0314b57c0097 https://github.com/tianocore/edk2-BaseTools-win32.git
|
||||
|
@ -11,32 +11,52 @@
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
LVL="--quality 9"
|
||||
QLT="-q 9"
|
||||
INPUTFLAG=0
|
||||
|
||||
while [ $# != 0 ];do
|
||||
case $1 in
|
||||
-d)
|
||||
ARGS+="--decompress "
|
||||
;;
|
||||
-e)
|
||||
;;
|
||||
-g)
|
||||
ARGS+="--gap $2 "
|
||||
for arg; do
|
||||
if [ $1 = -d ]
|
||||
then
|
||||
INPUTFLAG=1
|
||||
fi
|
||||
if [ $1 = -e ]
|
||||
then
|
||||
INPUTFLAG=1
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
LVL="--quality $2 "
|
||||
continue;
|
||||
fi
|
||||
if [ $1 = -g ]
|
||||
then
|
||||
ARGS+="$1 $2 "
|
||||
shift
|
||||
;;
|
||||
-o)
|
||||
ARGS+="--output $2 "
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
ARGS+="--input $1 "
|
||||
esac
|
||||
continue;
|
||||
fi
|
||||
if [ $1 = -o ]
|
||||
then
|
||||
ARGS+="$1 $2 "
|
||||
shift
|
||||
shift
|
||||
continue;
|
||||
fi
|
||||
if [ $1 = -q ]
|
||||
then
|
||||
QLT="$1 $2 "
|
||||
shift
|
||||
shift
|
||||
continue;
|
||||
fi
|
||||
if [ $INPUTFLAG -eq 1 ]
|
||||
then
|
||||
if [ -z $2 ]
|
||||
then
|
||||
ARGS+="$QLT -i $1 "
|
||||
break;
|
||||
fi
|
||||
fi
|
||||
|
||||
ARGS+="$1 "
|
||||
shift
|
||||
done
|
||||
|
||||
exec Brotli $ARGS $LVL
|
||||
exec Brotli $ARGS
|
||||
|
@ -5512,7 +5512,7 @@ DEFINE CLANG38_X64_PREFIX = ENV(CLANG38_BIN)
|
||||
DEFINE CLANG38_IA32_TARGET = -target i686-pc-linux-gnu
|
||||
DEFINE CLANG38_X64_TARGET = -target x86_64-pc-linux-gnu
|
||||
|
||||
DEFINE CLANG38_ALL_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -Wno-empty-body -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-parentheses-equality -Wno-unknown-pragmas -Wno-tautological-constant-out-of-range-compare -Wno-incompatible-library-redeclaration -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -msoft-float -mno-implicit-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -funsigned-char -fno-ms-extensions -Wno-null-dereference -Wno-tautological-compare
|
||||
DEFINE CLANG38_ALL_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -Wno-empty-body -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negative-value -Wno-parentheses-equality -Wno-unknown-pragmas -Wno-tautological-constant-out-of-range-compare -Wno-incompatible-library-redeclaration -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -msoft-float -mno-implicit-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -funsigned-char -fno-ms-extensions -Wno-null-dereference -Wno-tautological-compare -Wno-unknown-warning-option
|
||||
|
||||
###########################
|
||||
# CLANG38 IA32 definitions
|
||||
@ -7435,29 +7435,40 @@ RELEASE_XCLANG_X64_CC_FLAGS = -ccc-host-triple x86_64-pc-win32-macho -c -Os
|
||||
*_XCODE5_*_*_BUILDRULEFAMILY = XCODE
|
||||
*_XCODE5_*_*_BUILDRULEORDER = S s nasm
|
||||
|
||||
*_XCODE5_*_ASL_PATH = /usr/bin/iasl
|
||||
#
|
||||
# use xcode-select to change Xcode version of command line tools
|
||||
#
|
||||
*_XCODE5_*_MAKE_PATH = make
|
||||
*_XCODE5_*_CC_PATH = clang
|
||||
*_XCODE5_*_SLINK_PATH = libtool
|
||||
*_XCODE5_*_DLINK_PATH = ld
|
||||
*_XCODE5_*_ASM_PATH = as
|
||||
*_XCODE5_*_PP_PATH = clang
|
||||
*_XCODE5_*_VFRPP_PATH = clang
|
||||
*_XCODE5_*_ASL_PATH = iasl
|
||||
*_XCODE5_*_ASLCC_PATH = clang
|
||||
*_XCODE5_*_ASLPP_PATH = clang
|
||||
*_XCODE5_*_ASLDLINK_PATH = ld
|
||||
*_XCODE5_*_DSYMUTIL_PATH = /usr/bin/dsymutil
|
||||
*_XCODE5_*_MTOC_PATH = /usr/local/bin/mtoc
|
||||
|
||||
*_XCODE5_*_MAKE_PATH = make
|
||||
*_XCODE5_*_DSYMUTIL_PATH = /usr/bin/dsymutil
|
||||
##################
|
||||
# ASL definitions
|
||||
##################
|
||||
*_XCODE5_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h
|
||||
*_XCODE5_*_ASLDLINK_FLAGS = -e _ReferenceAcpiTable -preload -segalign 0x20 -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
|
||||
*_XCODE5_*_ASLPP_FLAGS = -x c -E -include AutoGen.h
|
||||
*_XCODE5_*_ASL_FLAGS =
|
||||
*_XCODE5_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
||||
|
||||
##################
|
||||
# MTOC definitions
|
||||
##################
|
||||
|
||||
DEBUG_XCODE5_*_MTOC_FLAGS = -align 0x20 -d $(DEBUG_DIR)/$(MODULE_NAME).dll
|
||||
NOOPT_XCODE5_*_MTOC_FLAGS = -align 0x20 -d $(DEBUG_DIR)/$(MODULE_NAME).dll
|
||||
RELEASE_XCODE5_*_MTOC_FLAGS = -align 0x20
|
||||
|
||||
#
|
||||
# use xcode-select to change Xcode version of command line tools
|
||||
#
|
||||
*_XCODE5_*_CC_PATH = clang
|
||||
*_XCODE5_*_SLINK_PATH = libtool
|
||||
*_XCODE5_*_DLINK_PATH = ld
|
||||
*_XCODE5_*_ASM_PATH = as
|
||||
*_XCODE5_*_PP_PATH = clang
|
||||
*_XCODE5_*_VFRPP_PATH = clang
|
||||
*_XCODE5_*_ASL_PATH = iasl
|
||||
*_XCODE5_*_ASLCC_PATH = clang
|
||||
*_XCODE5_*_ASLPP_PATH = clang
|
||||
*_XCODE5_*_ASLDLINK_PATH = ld
|
||||
|
||||
####################
|
||||
# IA-32 definitions
|
||||
####################
|
||||
@ -7476,8 +7487,6 @@ RELEASE_XCODE5_IA32_ASM_FLAGS = -arch i386
|
||||
RELEASE_XCODE5_IA32_CC_FLAGS = -arch i386 -c -Os -Wall -Werror -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fshort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
|
||||
NOOPT_XCODE5_IA32_CC_FLAGS = -arch i386 -c -g -O0 -Wall -Werror -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fshort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
|
||||
|
||||
|
||||
|
||||
##################
|
||||
# X64 definitions
|
||||
##################
|
||||
@ -7493,16 +7502,9 @@ RELEASE_XCODE5_X64_ASM_FLAGS = -arch x86_64
|
||||
*_XCODE5_*_PP_FLAGS = -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
|
||||
*_XCODE5_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
|
||||
|
||||
|
||||
DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
|
||||
NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
|
||||
RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
|
||||
|
||||
*_XCODE5_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h
|
||||
*_XCODE5_*_ASLDLINK_FLAGS = -e _ReferenceAcpiTable -preload -segalign 0x20 -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
|
||||
*_XCODE5_*_ASLPP_FLAGS = -x c -E -include AutoGen.h
|
||||
*_XCODE5_*_ASL_FLAGS =
|
||||
*_XCODE5_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
|
||||
DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
|
||||
NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
|
||||
RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
|
||||
|
||||
####################################################################################
|
||||
#
|
||||
|
@ -14,48 +14,54 @@
|
||||
@echo off
|
||||
@setlocal
|
||||
|
||||
set LVL=--quality 9
|
||||
set QLT=-q 9
|
||||
set INPUTFLAG=0
|
||||
|
||||
:Begin
|
||||
if "%1"=="" goto End
|
||||
|
||||
if "%1"=="-d" (
|
||||
set ARGS=%ARGS% --decompress
|
||||
shift
|
||||
goto Begin
|
||||
set INPUTFLAG=1
|
||||
)
|
||||
|
||||
if "%1"=="-e" (
|
||||
set INPUTFLAG=1
|
||||
shift
|
||||
goto Begin
|
||||
)
|
||||
|
||||
if "%1"=="-g" (
|
||||
set ARGS=%ARGS% --gap %2
|
||||
shift
|
||||
shift
|
||||
goto Begin
|
||||
)
|
||||
|
||||
if "%1"=="-l" (
|
||||
set LVL=--quality %2
|
||||
set ARGS=%ARGS% %1 %2
|
||||
shift
|
||||
shift
|
||||
goto Begin
|
||||
)
|
||||
|
||||
if "%1"=="-o" (
|
||||
set ARGS=%ARGS% --output %2
|
||||
set INTMP=%2
|
||||
set ARGS=%ARGS% %1 %2
|
||||
shift
|
||||
shift
|
||||
goto Begin
|
||||
)
|
||||
|
||||
set ARGS=%ARGS% --input %1
|
||||
if "%1"=="-q" (
|
||||
set QLT=%1 %2
|
||||
shift
|
||||
shift
|
||||
goto Begin
|
||||
)
|
||||
|
||||
if %INPUTFLAG%==1 (
|
||||
if "%2"=="" (
|
||||
set ARGS=%ARGS% %QLT% -i %1
|
||||
goto End
|
||||
)
|
||||
)
|
||||
|
||||
set ARGS=%ARGS% %1
|
||||
shift
|
||||
goto Begin
|
||||
|
||||
:End
|
||||
Brotli %ARGS% %LVL%
|
||||
Brotli %ARGS%
|
||||
@echo on
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <Common/BuildVersion.h>
|
||||
|
||||
#include "../dec/decode.h"
|
||||
#include "../enc/encode.h"
|
||||
@ -67,6 +68,11 @@ static int ParseQuality(const char* s, int* quality) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define UTILITY_NAME "Brotli"
|
||||
#define UTILITY_MAJOR_VERSION 0
|
||||
#define UTILITY_MINOR_VERSION 5
|
||||
#define UTILITY_REVERSION 2
|
||||
|
||||
static void ParseArgv(int argc, char **argv,
|
||||
char **input_path,
|
||||
char **output_path,
|
||||
@ -110,6 +116,15 @@ static void ParseArgv(int argc, char **argv,
|
||||
}
|
||||
*verbose = 1;
|
||||
continue;
|
||||
} else if (!strcmp("--version", argv[k])) {
|
||||
fprintf(stderr,
|
||||
"%s Version %d.%d.%d %s\n",
|
||||
UTILITY_NAME,
|
||||
UTILITY_MAJOR_VERSION,
|
||||
UTILITY_MINOR_VERSION,
|
||||
UTILITY_REVERSION,
|
||||
__BUILD_VERSION);
|
||||
exit(1);
|
||||
}
|
||||
if (k < argc - 1) {
|
||||
if (!strcmp("--input", argv[k]) ||
|
||||
@ -177,7 +192,8 @@ error:
|
||||
fprintf(stderr,
|
||||
"Usage: %s [--force] [--quality n] [--gap n] [--decompress]"
|
||||
" [--input filename] [--output filename] [--repeat iters]"
|
||||
" [--verbose] [--window n] [--custom-dictionary filename]\n",
|
||||
" [--verbose] [--window n] [--custom-dictionary filename]"
|
||||
" [--version]\n",
|
||||
argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
@ -331,7 +331,10 @@ Returns:
|
||||
if (OpenSslEnv == NULL) {
|
||||
OpenSslPath = OpenSslCommand;
|
||||
} else {
|
||||
OpenSslPath = malloc(strlen(OpenSslEnv)+strlen(OpenSslCommand)+1);
|
||||
//
|
||||
// We add quotes to the Openssl Path in case it has space characters
|
||||
//
|
||||
OpenSslPath = malloc(2+strlen(OpenSslEnv)+strlen(OpenSslCommand)+1);
|
||||
if (OpenSslPath == NULL) {
|
||||
Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
|
||||
return GetUtilityStatus ();
|
||||
@ -1591,11 +1594,12 @@ CombinePath (
|
||||
{
|
||||
UINT32 DefaultPathLen;
|
||||
UINT64 Index;
|
||||
|
||||
CHAR8 QuotesStr[] = "\"";
|
||||
strcpy(NewPath, QuotesStr);
|
||||
DefaultPathLen = strlen(DefaultPath);
|
||||
strcpy(NewPath, DefaultPath);
|
||||
strcat(NewPath, DefaultPath);
|
||||
Index = 0;
|
||||
for (; Index < DefaultPathLen; Index ++) {
|
||||
for (; Index < DefaultPathLen + 1; Index ++) {
|
||||
if (NewPath[Index] == '\\' || NewPath[Index] == '/') {
|
||||
if (NewPath[Index + 1] != '\0') {
|
||||
NewPath[Index] = '/';
|
||||
@ -1607,6 +1611,7 @@ CombinePath (
|
||||
NewPath[Index + 1] = '\0';
|
||||
}
|
||||
strcat(NewPath, AppendPath);
|
||||
strcat(NewPath, QuotesStr);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,10 @@ gMakeTypeMap = {"MSFT":"nmake", "GCC":"gmake"}
|
||||
|
||||
|
||||
## Build rule configuration file
|
||||
gDefaultBuildRuleFile = 'Conf/build_rule.txt'
|
||||
gDefaultBuildRuleFile = 'build_rule.txt'
|
||||
|
||||
## Tools definition configuration file
|
||||
gDefaultToolsDefFile = 'tools_def.txt'
|
||||
|
||||
## Build rule default version
|
||||
AutoGenReqBuildRuleVerNum = "0.1"
|
||||
@ -413,7 +416,7 @@ class WorkspaceAutoGen(AutoGen):
|
||||
if HasTokenSpace:
|
||||
if (PcdItem.TokenCName, PcdItem.TokenSpaceGuidCName) == (TokenCName, TokenSpaceGuidCName):
|
||||
PcdDatumType = PcdItem.DatumType
|
||||
NewValue = self._BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, pcdvalue)
|
||||
NewValue = BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, pcdvalue)
|
||||
FoundFlag = True
|
||||
else:
|
||||
if PcdItem.TokenCName == TokenCName:
|
||||
@ -422,7 +425,7 @@ class WorkspaceAutoGen(AutoGen):
|
||||
TokenSpaceGuidCNameList.append(PcdItem.TokenSpaceGuidCName)
|
||||
PcdDatumType = PcdItem.DatumType
|
||||
TokenSpaceGuidCName = PcdItem.TokenSpaceGuidCName
|
||||
NewValue = self._BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, pcdvalue)
|
||||
NewValue = BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, pcdvalue)
|
||||
FoundFlag = True
|
||||
else:
|
||||
EdkLogger.error(
|
||||
@ -501,6 +504,22 @@ class WorkspaceAutoGen(AutoGen):
|
||||
SourcePcdDict['FixedAtBuild'].append((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName))
|
||||
else:
|
||||
pass
|
||||
#
|
||||
# A PCD can only use one type for all source modules
|
||||
#
|
||||
for i in SourcePcdDict_Keys:
|
||||
for j in SourcePcdDict_Keys:
|
||||
if i != j:
|
||||
IntersectionList = list(set(SourcePcdDict[i]).intersection(set(SourcePcdDict[j])))
|
||||
if len(IntersectionList) > 0:
|
||||
EdkLogger.error(
|
||||
'build',
|
||||
FORMAT_INVALID,
|
||||
"Building modules from source INFs, following PCD use %s and %s access method. It must be corrected to use only one access method." % (i, j),
|
||||
ExtraData="%s" % '\n\t'.join([str(P[1]+'.'+P[0]) for P in IntersectionList])
|
||||
)
|
||||
else:
|
||||
pass
|
||||
|
||||
#
|
||||
# intersection the BinaryPCD for Mixed PCD
|
||||
@ -642,15 +661,35 @@ class WorkspaceAutoGen(AutoGen):
|
||||
self._BuildCommand = None
|
||||
|
||||
#
|
||||
# Create BuildOptions Macro & PCD metafile.
|
||||
# Create BuildOptions Macro & PCD metafile, also add the Active Platform and FDF file.
|
||||
#
|
||||
content = 'gCommandLineDefines: '
|
||||
content += str(GlobalData.gCommandLineDefines)
|
||||
content += os.linesep
|
||||
content += 'BuildOptionPcd: '
|
||||
content += str(GlobalData.BuildOptionPcd)
|
||||
content += os.linesep
|
||||
content += 'Active Platform: '
|
||||
content += str(self.Platform)
|
||||
content += os.linesep
|
||||
if self.FdfFile:
|
||||
content += 'Flash Image Definition: '
|
||||
content += str(self.FdfFile)
|
||||
SaveFileOnChange(os.path.join(self.BuildDir, 'BuildOptions'), content, False)
|
||||
|
||||
#
|
||||
# Create PcdToken Number file for Dynamic/DynamicEx Pcd.
|
||||
#
|
||||
PcdTokenNumber = 'PcdTokenNumber: '
|
||||
if Pa.PcdTokenNumber:
|
||||
if Pa.DynamicPcdList:
|
||||
for Pcd in Pa.DynamicPcdList:
|
||||
PcdTokenNumber += os.linesep
|
||||
PcdTokenNumber += str((Pcd.TokenCName, Pcd.TokenSpaceGuidCName))
|
||||
PcdTokenNumber += ' : '
|
||||
PcdTokenNumber += str(Pa.PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName])
|
||||
SaveFileOnChange(os.path.join(self.BuildDir, 'PcdTokenNumber'), PcdTokenNumber, False)
|
||||
|
||||
#
|
||||
# Get set of workspace metafiles
|
||||
#
|
||||
@ -678,31 +717,6 @@ class WorkspaceAutoGen(AutoGen):
|
||||
print >> file, f
|
||||
return True
|
||||
|
||||
def _BuildOptionPcdValueFormat(self, TokenSpaceGuidCName, TokenCName, PcdDatumType, Value):
|
||||
if PcdDatumType == 'VOID*':
|
||||
if Value.startswith('L'):
|
||||
if not Value[1]:
|
||||
EdkLogger.error('build', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')
|
||||
Value = Value[0] + '"' + Value[1:] + '"'
|
||||
elif Value.startswith('B'):
|
||||
if not Value[1]:
|
||||
EdkLogger.error('build', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')
|
||||
Value = Value[1:]
|
||||
else:
|
||||
if not Value[0]:
|
||||
EdkLogger.error('build', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')
|
||||
Value = '"' + Value + '"'
|
||||
|
||||
IsValid, Cause = CheckPcdDatum(PcdDatumType, Value)
|
||||
if not IsValid:
|
||||
EdkLogger.error('build', FORMAT_INVALID, Cause, ExtraData="%s.%s" % (TokenSpaceGuidCName, TokenCName))
|
||||
if PcdDatumType == 'BOOLEAN':
|
||||
Value = Value.upper()
|
||||
if Value == 'TRUE' or Value == '1':
|
||||
Value = '1'
|
||||
elif Value == 'FALSE' or Value == '0':
|
||||
Value = '0'
|
||||
return Value
|
||||
|
||||
def _GetMetaFiles(self, Target, Toolchain, Arch):
|
||||
AllWorkSpaceMetaFiles = set()
|
||||
@ -721,10 +735,19 @@ class WorkspaceAutoGen(AutoGen):
|
||||
AllWorkSpaceMetaFiles.add(self.MetaFile.Path)
|
||||
|
||||
#
|
||||
# add build_rule.txt & tools_def.txt
|
||||
#
|
||||
AllWorkSpaceMetaFiles.add(os.path.join(GlobalData.gConfDirectory, gDefaultBuildRuleFile))
|
||||
AllWorkSpaceMetaFiles.add(os.path.join(GlobalData.gConfDirectory, gDefaultToolsDefFile))
|
||||
|
||||
# add BuildOption metafile
|
||||
#
|
||||
AllWorkSpaceMetaFiles.add(os.path.join(self.BuildDir, 'BuildOptions'))
|
||||
|
||||
# add PcdToken Number file for Dynamic/DynamicEx Pcd
|
||||
#
|
||||
AllWorkSpaceMetaFiles.add(os.path.join(self.BuildDir, 'PcdTokenNumber'))
|
||||
|
||||
for Arch in self.ArchList:
|
||||
Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
|
||||
PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)
|
||||
@ -2735,10 +2758,7 @@ class ModuleAutoGen(AutoGen):
|
||||
if self._FixedAtBuildPcds:
|
||||
return self._FixedAtBuildPcds
|
||||
for Pcd in self.ModulePcdList:
|
||||
if self.IsLibrary:
|
||||
if not (Pcd.Pending == False and Pcd.Type == "FixedAtBuild"):
|
||||
continue
|
||||
elif Pcd.Type != "FixedAtBuild":
|
||||
if Pcd.Type != "FixedAtBuild":
|
||||
continue
|
||||
if Pcd not in self._FixedAtBuildPcds:
|
||||
self._FixedAtBuildPcds.append(Pcd)
|
||||
@ -3917,6 +3937,13 @@ class ModuleAutoGen(AutoGen):
|
||||
else:
|
||||
continue
|
||||
PcdValue = ''
|
||||
if Pcd.DatumType == 'BOOLEAN':
|
||||
BoolValue = Pcd.DefaultValue.upper()
|
||||
if BoolValue == 'TRUE':
|
||||
Pcd.DefaultValue = '1'
|
||||
elif BoolValue == 'FALSE':
|
||||
Pcd.DefaultValue = '0'
|
||||
|
||||
if Pcd.DatumType != 'VOID*':
|
||||
HexFormat = '0x%02x'
|
||||
if Pcd.DatumType == 'UINT16':
|
||||
@ -4183,6 +4210,8 @@ class ModuleAutoGen(AutoGen):
|
||||
with open(self.GetTimeStampPath(),'r') as f:
|
||||
for source in f:
|
||||
source = source.rstrip('\n')
|
||||
if not os.path.exists(source):
|
||||
return False
|
||||
if source not in ModuleAutoGen.TimeDict :
|
||||
ModuleAutoGen.TimeDict[source] = os.stat(source)[8]
|
||||
if ModuleAutoGen.TimeDict[source] > DstTimeStamp:
|
||||
|
@ -1203,21 +1203,22 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
|
||||
else:
|
||||
AutoGenH.Append('extern volatile %s %s%s;\n' % (DatumType, PcdVariableName, Array))
|
||||
AutoGenH.Append('#define %s %s_gPcd_BinaryPatch_%s\n' %(GetModeName, Type, TokenCName))
|
||||
PcdDataSize = GetPcdSize(Pcd)
|
||||
if Pcd.DatumType == 'VOID*':
|
||||
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcdSetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &_gPcd_BinaryPatch_Size_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), (Buffer))\n' % (SetModeName, TokenCName, TokenCName, TokenCName))
|
||||
AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcdSetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &_gPcd_BinaryPatch_Size_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, TokenCName, TokenCName, TokenCName))
|
||||
AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, Pcd.MaxDatumSize))
|
||||
else:
|
||||
AutoGenH.Append('#define %s(Value) (%s = (Value))\n' % (SetModeName, PcdVariableName))
|
||||
AutoGenH.Append('#define %s(Value) ((%s = (Value)), RETURN_SUCCESS)\n' % (SetModeStatusName, PcdVariableName))
|
||||
AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, PcdDataSize))
|
||||
|
||||
PcdDataSize = GetPcdSize(Pcd)
|
||||
AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, PcdDataSize))
|
||||
AutoGenH.Append('#define %s %s\n' % (GetModeSizeName,PatchPcdSizeVariableName))
|
||||
AutoGenH.Append('extern UINTN %s; \n' % PatchPcdSizeVariableName)
|
||||
|
||||
if PcdItemType == TAB_PCDS_FIXED_AT_BUILD or PcdItemType == TAB_PCDS_FEATURE_FLAG:
|
||||
key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName))
|
||||
|
||||
PcdVariableName = '_gPcd_' + gItemTypeStringDatabase[Pcd.Type] + '_' + TokenCName
|
||||
if DatumType == 'VOID*' and Array == '[]':
|
||||
DatumType = ['UINT8', 'UINT16'][Pcd.DefaultValue[0] == 'L']
|
||||
AutoGenH.Append('extern const %s _gPcd_FixedAtBuild_%s%s;\n' %(DatumType, TokenCName, Array))
|
||||
@ -1225,7 +1226,10 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
|
||||
AutoGenH.Append('//#define %s ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD\n' % SetModeName)
|
||||
|
||||
if PcdItemType == TAB_PCDS_FIXED_AT_BUILD and (key in Info.ConstPcd or (Info.IsLibrary and not Info._ReferenceModules)):
|
||||
AutoGenH.Append('#define _PCD_VALUE_%s %s\n' %(TokenCName, Pcd.DefaultValue))
|
||||
if Pcd.DatumType == 'VOID*':
|
||||
AutoGenH.Append('#define _PCD_VALUE_%s %s%s\n' %(TokenCName, Type, PcdVariableName))
|
||||
else:
|
||||
AutoGenH.Append('#define _PCD_VALUE_%s %s\n' %(TokenCName, Pcd.DefaultValue))
|
||||
|
||||
if PcdItemType == TAB_PCDS_FIXED_AT_BUILD:
|
||||
PcdDataSize = GetPcdSize(Pcd)
|
||||
|
@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# Create makefile for MS nmake and GNU make
|
||||
#
|
||||
# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -386,7 +386,7 @@ ${END}
|
||||
#
|
||||
clean:
|
||||
\t${BEGIN}${clean_command}
|
||||
\t${END}
|
||||
\t${END}\t$(RM) AutoGenTimeStamp
|
||||
|
||||
#
|
||||
# clean all generated files
|
||||
@ -395,6 +395,7 @@ cleanall:
|
||||
${BEGIN}\t${cleanall_command}
|
||||
${END}\t$(RM) *.pdb *.idb > NUL 2>&1
|
||||
\t$(RM) $(BIN_DIR)${separator}$(MODULE_NAME).efi
|
||||
\t$(RM) AutoGenTimeStamp
|
||||
|
||||
#
|
||||
# clean all dependent libraries built
|
||||
@ -1452,7 +1453,15 @@ class TopLevelMakefile(BuildFile):
|
||||
if GlobalData.BuildOptionPcd:
|
||||
for index, option in enumerate(GlobalData.gCommand):
|
||||
if "--pcd" == option and GlobalData.gCommand[index+1]:
|
||||
ExtraOption += " --pcd " + GlobalData.gCommand[index+1]
|
||||
pcdName, pcdValue = GlobalData.gCommand[index+1].split('=')
|
||||
if pcdValue.startswith('H'):
|
||||
pcdValue = 'H' + '"' + pcdValue[1:] + '"'
|
||||
ExtraOption += " --pcd " + pcdName + '=' + pcdValue
|
||||
elif pcdValue.startswith('L'):
|
||||
pcdValue = 'L' + '"' + pcdValue[1:] + '"'
|
||||
ExtraOption += " --pcd " + pcdName + '=' + pcdValue
|
||||
else:
|
||||
ExtraOption += " --pcd " + GlobalData.gCommand[index+1]
|
||||
|
||||
MakefileName = self._FILE_NAME_[self._FileType]
|
||||
SubBuildCommandList = []
|
||||
|
@ -2062,6 +2062,32 @@ def PackRegistryFormatGuid(Guid):
|
||||
int(Guid[4][-2:], 16)
|
||||
)
|
||||
|
||||
def BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, Value):
|
||||
if PcdDatumType == 'VOID*':
|
||||
if Value.startswith('L'):
|
||||
if not Value[1]:
|
||||
EdkLogger.error("build", FORMAT_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", H"{...}"')
|
||||
Value = Value[0] + '"' + Value[1:] + '"'
|
||||
elif Value.startswith('H'):
|
||||
if not Value[1]:
|
||||
EdkLogger.error("build", FORMAT_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", H"{...}"')
|
||||
Value = Value[1:]
|
||||
else:
|
||||
if not Value[0]:
|
||||
EdkLogger.error("build", FORMAT_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", H"{...}"')
|
||||
Value = '"' + Value + '"'
|
||||
|
||||
IsValid, Cause = CheckPcdDatum(PcdDatumType, Value)
|
||||
if not IsValid:
|
||||
EdkLogger.error("build", FORMAT_INVALID, Cause, ExtraData="%s.%s" % (TokenSpaceGuidCName, TokenCName))
|
||||
if PcdDatumType == 'BOOLEAN':
|
||||
Value = Value.upper()
|
||||
if Value == 'TRUE' or Value == '1':
|
||||
Value = '1'
|
||||
elif Value == 'FALSE' or Value == '0':
|
||||
Value = '0'
|
||||
return Value
|
||||
|
||||
##
|
||||
#
|
||||
# This acts like the main() function for the script, unless it is 'import'ed into another
|
||||
|
@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# This file is used to define checkpoints used by ECC tool
|
||||
#
|
||||
# Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -41,6 +41,134 @@ class Check(object):
|
||||
self.DeclAndDataTypeCheck()
|
||||
self.FunctionLayoutCheck()
|
||||
self.NamingConventionCheck()
|
||||
self.SmmCommParaCheck()
|
||||
|
||||
def SmmCommParaCheck(self):
|
||||
self.SmmCommParaCheckBufferType()
|
||||
|
||||
|
||||
# Check if SMM communication function has correct parameter type
|
||||
# 1. Get function calling with instance./->Communicate() interface
|
||||
# and make sure the protocol instance is of type EFI_SMM_COMMUNICATION_PROTOCOL.
|
||||
# 2. Find the origin of the 2nd parameter of Communicate() interface, if -
|
||||
# a. it is a local buffer on stack
|
||||
# report error.
|
||||
# b. it is a global buffer, check the driver that holds the global buffer is of type DXE_RUNTIME_DRIVER
|
||||
# report success.
|
||||
# c. it is a buffer by AllocatePage/AllocatePool (may be wrapped by nested function calls),
|
||||
# check the EFI_MEMORY_TYPE to be EfiRuntimeServicesCode,EfiRuntimeServicesData,
|
||||
# EfiACPIMemoryNVS or EfiReservedMemoryType
|
||||
# report success.
|
||||
# d. it is a buffer located via EFI_SYSTEM_TABLE.ConfigurationTable (may be wrapped by nested function calls)
|
||||
# report warning to indicate human code review.
|
||||
# e. it is a buffer from other kind of pointers (may need to trace into nested function calls to locate),
|
||||
# repeat checks in a.b.c and d.
|
||||
def SmmCommParaCheckBufferType(self):
|
||||
if EccGlobalData.gConfig.SmmCommParaCheckBufferType == '1' or EccGlobalData.gConfig.SmmCommParaCheckAll == '1':
|
||||
EdkLogger.quiet("Checking SMM communication parameter type ...")
|
||||
# Get all EFI_SMM_COMMUNICATION_PROTOCOL interface
|
||||
CommApiList = []
|
||||
for IdentifierTable in EccGlobalData.gIdentifierTableList:
|
||||
SqlCommand = """select ID, Name, BelongsToFile from %s
|
||||
where Modifier = 'EFI_SMM_COMMUNICATION_PROTOCOL*' """ % (IdentifierTable)
|
||||
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||
if RecordSet:
|
||||
for Record in RecordSet:
|
||||
if Record[1] not in CommApiList:
|
||||
CommApiList.append(Record[1])
|
||||
# For each interface, check the second parameter
|
||||
for CommApi in CommApiList:
|
||||
for IdentifierTable in EccGlobalData.gIdentifierTableList:
|
||||
SqlCommand = """select ID, Name, Value, BelongsToFile, StartLine from %s
|
||||
where Name = '%s->Communicate' and Model = %s""" \
|
||||
% (IdentifierTable, CommApi, MODEL_IDENTIFIER_FUNCTION_CALLING)
|
||||
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||
if RecordSet:
|
||||
# print IdentifierTable
|
||||
for Record in RecordSet:
|
||||
# Get the second parameter for Communicate function
|
||||
SecondPara = Record[2].split(',')[1].strip()
|
||||
SecondParaIndex = None
|
||||
if SecondPara.startswith('&'):
|
||||
SecondPara = SecondPara[1:]
|
||||
if SecondPara.endswith(']'):
|
||||
SecondParaIndex = SecondPara[SecondPara.find('[') + 1:-1]
|
||||
SecondPara = SecondPara[:SecondPara.find('[')]
|
||||
# Get the ID
|
||||
Id = Record[0]
|
||||
# Get the BelongsToFile
|
||||
BelongsToFile = Record[3]
|
||||
# Get the source file path
|
||||
SqlCommand = """select FullPath from File where ID = %s""" % BelongsToFile
|
||||
NewRecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||
FullPath = NewRecordSet[0][0]
|
||||
# Get the line no of function calling
|
||||
StartLine = Record[4]
|
||||
# Get the module type
|
||||
SqlCommand = """select Value3 from INF where BelongsToFile = (select ID from File
|
||||
where Path = (select Path from File where ID = %s) and Model = 1011)
|
||||
and Value2 = 'MODULE_TYPE'""" % BelongsToFile
|
||||
NewRecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||
ModuleType = NewRecordSet[0][0] if NewRecordSet else None
|
||||
|
||||
# print BelongsToFile, FullPath, StartLine, ModuleType, SecondPara
|
||||
|
||||
Value = FindPara(FullPath, SecondPara, StartLine)
|
||||
# Find the value of the parameter
|
||||
if Value:
|
||||
if 'AllocatePage' in Value \
|
||||
or 'AllocatePool' in Value \
|
||||
or 'AllocateRuntimePool' in Value \
|
||||
or 'AllocateZeroPool' in Value:
|
||||
pass
|
||||
else:
|
||||
if '->' in Value:
|
||||
if not EccGlobalData.gException.IsException(
|
||||
ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE, Value):
|
||||
EccGlobalData.gDb.TblReport.Insert(ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE,
|
||||
OtherMsg="Please review the buffer type"
|
||||
+ "is correct or not. If it is correct" +
|
||||
" please add [%s] to exception list"
|
||||
% Value,
|
||||
BelongsToTable=IdentifierTable,
|
||||
BelongsToItem=Id)
|
||||
else:
|
||||
if not EccGlobalData.gException.IsException(
|
||||
ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE, Value):
|
||||
EccGlobalData.gDb.TblReport.Insert(ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE,
|
||||
OtherMsg="Please review the buffer type"
|
||||
+ "is correct or not. If it is correct" +
|
||||
" please add [%s] to exception list"
|
||||
% Value,
|
||||
BelongsToTable=IdentifierTable,
|
||||
BelongsToItem=Id)
|
||||
|
||||
|
||||
# Not find the value of the parameter
|
||||
else:
|
||||
SqlCommand = """select ID, Modifier, Name, Value, Model, BelongsToFunction from %s
|
||||
where Name = '%s' and StartLine < %s order by StartLine DESC""" \
|
||||
% (IdentifierTable, SecondPara, StartLine)
|
||||
NewRecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||
if NewRecordSet:
|
||||
Value = NewRecordSet[0][1]
|
||||
if 'AllocatePage' in Value \
|
||||
or 'AllocatePool' in Value \
|
||||
or 'AllocateRuntimePool' in Value \
|
||||
or 'AllocateZeroPool' in Value:
|
||||
pass
|
||||
else:
|
||||
if not EccGlobalData.gException.IsException(
|
||||
ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE, Value):
|
||||
EccGlobalData.gDb.TblReport.Insert(ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE,
|
||||
OtherMsg="Please review the buffer type"
|
||||
+ "is correct or not. If it is correct" +
|
||||
" please add [%s] to exception list"
|
||||
% Value,
|
||||
BelongsToTable=IdentifierTable,
|
||||
BelongsToItem=Id)
|
||||
else:
|
||||
pass
|
||||
|
||||
# Check UNI files
|
||||
def UniCheck(self):
|
||||
@ -941,7 +1069,7 @@ class Check(object):
|
||||
|
||||
# Check Guid Format in module INF
|
||||
def MetaDataFileCheckModuleFileGuidFormat(self):
|
||||
if EccGlobalData.gConfig.MetaDataFileCheckModuleFileGuidFormat or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
if EccGlobalData.gConfig.MetaDataFileCheckModuleFileGuidFormat == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Check Guid Format in module INF ...")
|
||||
Table = EccGlobalData.gDb.TblInf
|
||||
SqlCommand = """
|
||||
@ -984,7 +1112,7 @@ class Check(object):
|
||||
|
||||
# Check Protocol Format in module INF
|
||||
def MetaDataFileCheckModuleFileProtocolFormat(self):
|
||||
if EccGlobalData.gConfig.MetaDataFileCheckModuleFileProtocolFormat or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
if EccGlobalData.gConfig.MetaDataFileCheckModuleFileProtocolFormat == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Check Protocol Format in module INF ...")
|
||||
Table = EccGlobalData.gDb.TblInf
|
||||
SqlCommand = """
|
||||
@ -1015,7 +1143,7 @@ class Check(object):
|
||||
|
||||
# Check Ppi Format in module INF
|
||||
def MetaDataFileCheckModuleFilePpiFormat(self):
|
||||
if EccGlobalData.gConfig.MetaDataFileCheckModuleFilePpiFormat or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
if EccGlobalData.gConfig.MetaDataFileCheckModuleFilePpiFormat == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Check Ppi Format in module INF ...")
|
||||
Table = EccGlobalData.gDb.TblInf
|
||||
SqlCommand = """
|
||||
@ -1043,7 +1171,7 @@ class Check(object):
|
||||
|
||||
# Check Pcd Format in module INF
|
||||
def MetaDataFileCheckModuleFilePcdFormat(self):
|
||||
if EccGlobalData.gConfig.MetaDataFileCheckModuleFilePcdFormat or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
if EccGlobalData.gConfig.MetaDataFileCheckModuleFilePcdFormat == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Check Pcd Format in module INF ...")
|
||||
Table = EccGlobalData.gDb.TblInf
|
||||
SqlCommand = """
|
||||
@ -1139,9 +1267,10 @@ class Check(object):
|
||||
FileTable = 'Identifier' + str(Id)
|
||||
self.NamingConventionCheckDefineStatement(FileTable)
|
||||
self.NamingConventionCheckTypedefStatement(FileTable)
|
||||
self.NamingConventionCheckIfndefStatement(FileTable)
|
||||
self.NamingConventionCheckVariableName(FileTable)
|
||||
self.NamingConventionCheckSingleCharacterVariable(FileTable)
|
||||
if os.path.splitext(F)[1] in ('.h'):
|
||||
self.NamingConventionCheckIfndefStatement(FileTable)
|
||||
|
||||
self.NamingConventionCheckPathName()
|
||||
self.NamingConventionCheckFunctionName()
|
||||
@ -1183,7 +1312,7 @@ class Check(object):
|
||||
|
||||
# Check whether the #ifndef at the start of an include file uses both prefix and postfix underscore characters, '_'.
|
||||
def NamingConventionCheckIfndefStatement(self, FileTable):
|
||||
if EccGlobalData.gConfig.NamingConventionCheckTypedefStatement == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
if EccGlobalData.gConfig.NamingConventionCheckIfndefStatement == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Checking naming covention of #ifndef statement ...")
|
||||
|
||||
SqlCommand = """select ID, Value from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_MACRO_IFNDEF)
|
||||
@ -1260,6 +1389,19 @@ class Check(object):
|
||||
if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_SINGLE_CHARACTER_VARIABLE, Record[1]):
|
||||
EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_SINGLE_CHARACTER_VARIABLE, OtherMsg="The variable name [%s] does not follow the rules" % (Record[1]), BelongsToTable=FileTable, BelongsToItem=Record[0])
|
||||
|
||||
def FindPara(FilePath, Para, CallingLine):
|
||||
Lines = open(FilePath).readlines()
|
||||
Line = ''
|
||||
for Index in range(CallingLine - 1, 0, -1):
|
||||
# Find the nearest statement for Para
|
||||
Line = Lines[Index].strip()
|
||||
if Line.startswith('%s = ' % Para):
|
||||
Line = Line.strip()
|
||||
return Line
|
||||
break
|
||||
|
||||
return ''
|
||||
|
||||
##
|
||||
#
|
||||
# This acts like the main() function for the script, unless it is 'import'ed into another
|
||||
|
@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# This file is used to define class Configuration
|
||||
#
|
||||
# Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -256,6 +256,11 @@ class Configuration(object):
|
||||
# Check PCD whether defined the prompt, help in the DEC file and localized information in the associated UNI file.
|
||||
self.UniCheckPCDInfo = 1
|
||||
|
||||
# Check SMM communication function parameter
|
||||
self.SmmCommParaCheckAll = 0
|
||||
# Check if the EFI_SMM_COMMUNICATION_PROTOCOL parameter buffer type is Reserved / ACPI NVS or UEFI RT code/data
|
||||
self.SmmCommParaCheckBufferType = -1
|
||||
|
||||
#
|
||||
# The check points in this section are reserved
|
||||
#
|
||||
|
@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# Standardized Error Hanlding infrastructures.
|
||||
#
|
||||
# Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -105,6 +105,8 @@ ERROR_META_DATA_FILE_CHECK_LIBRARY_NOT_DEFINED = 10022
|
||||
|
||||
ERROR_SPELLING_CHECK_ALL = 11000
|
||||
|
||||
ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE = 12001
|
||||
|
||||
gEccErrorMessage = {
|
||||
ERROR_GENERAL_CHECK_ALL : "",
|
||||
ERROR_GENERAL_CHECK_NO_TAB : "'TAB' character is not allowed in source code, please replace each 'TAB' with two spaces",
|
||||
@ -198,5 +200,7 @@ gEccErrorMessage = {
|
||||
ERROR_META_DATA_FILE_CHECK_FORMAT_PCD : "Wrong Pcd Format used in Module file",
|
||||
ERROR_META_DATA_FILE_CHECK_LIBRARY_NOT_DEFINED : "Not defined LibraryClass used in the Module file.",
|
||||
ERROR_SPELLING_CHECK_ALL : "",
|
||||
|
||||
ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE : "SMM communication function may use wrong parameter type",
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# This file is used to parse exception items found by ECC tool
|
||||
#
|
||||
# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -72,7 +72,7 @@ class ExceptionCheck(object):
|
||||
self.ExceptionList = self.ExceptionListXml.ToList()
|
||||
|
||||
def IsException(self, ErrorID, KeyWord, FileID=-1):
|
||||
if (str(ErrorID), KeyWord) in self.ExceptionList:
|
||||
if (str(ErrorID), KeyWord.replace('\r\n', '\n')) in self.ExceptionList:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
@ -261,6 +261,13 @@ UniCheckPCDInfo = 1
|
||||
# Uncheck whether UNI file is in UTF-16 format
|
||||
GeneralCheckUni = -1
|
||||
|
||||
#
|
||||
# SMM Communicate Function Parameter Checking
|
||||
#
|
||||
SmmCommParaCheckAll = 0
|
||||
# Check if the EFI_SMM_COMMUNICATION_PROTOCOL parameter buffer type is Reserved / ACPI NVS or UEFI RT code/data
|
||||
SmmCommParaCheckBufferType = 1
|
||||
|
||||
#
|
||||
# The check points in this section are reserved
|
||||
#
|
||||
|
@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# generate capsule
|
||||
#
|
||||
# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
@ -141,6 +141,11 @@ class Capsule (CapsuleClassObject) :
|
||||
Content.write(File.read())
|
||||
File.close()
|
||||
for fmp in self.FmpPayloadList:
|
||||
if fmp.Existed:
|
||||
FwMgrHdr.write(pack('=Q', PreSize))
|
||||
PreSize += len(fmp.Buffer)
|
||||
Content.write(fmp.Buffer)
|
||||
continue
|
||||
if fmp.ImageFile:
|
||||
for Obj in fmp.ImageFile:
|
||||
fmp.ImageFile = Obj.GenCapsuleSubItem()
|
||||
@ -169,12 +174,12 @@ class Capsule (CapsuleClassObject) :
|
||||
dwLength = 4 + 2 + 2 + 16 + 16 + 256 + 256
|
||||
fmp.ImageFile = CapOutputTmp
|
||||
AuthData = [fmp.MonotonicCount, dwLength, WIN_CERT_REVISION, WIN_CERT_TYPE_EFI_GUID, fmp.Certificate_Guid]
|
||||
Buffer = fmp.GenCapsuleSubItem(AuthData)
|
||||
fmp.Buffer = fmp.GenCapsuleSubItem(AuthData)
|
||||
else:
|
||||
Buffer = fmp.GenCapsuleSubItem()
|
||||
fmp.Buffer = fmp.GenCapsuleSubItem()
|
||||
FwMgrHdr.write(pack('=Q', PreSize))
|
||||
PreSize += len(Buffer)
|
||||
Content.write(Buffer)
|
||||
PreSize += len(fmp.Buffer)
|
||||
Content.write(fmp.Buffer)
|
||||
BodySize = len(FwMgrHdr.getvalue()) + len(Content.getvalue())
|
||||
Header.write(pack('=I', HdrSize + BodySize))
|
||||
#
|
||||
|
@ -183,6 +183,8 @@ class CapsulePayload(CapsuleData):
|
||||
self.VendorCodeFile = []
|
||||
self.Certificate_Guid = None
|
||||
self.MonotonicCount = None
|
||||
self.Existed = False
|
||||
self.Buffer = None
|
||||
|
||||
def GenCapsuleSubItem(self, AuthData=[]):
|
||||
if not self.Version:
|
||||
@ -239,4 +241,5 @@ class CapsulePayload(CapsuleData):
|
||||
VendorFile = open(self.VendorCodeFile, 'rb')
|
||||
Buffer += VendorFile.read()
|
||||
VendorFile.close()
|
||||
self.Existed = True
|
||||
return Buffer
|
||||
|
@ -39,6 +39,7 @@ from Common.Misc import SaveFileOnChange
|
||||
from Common.Misc import ClearDuplicatedInf
|
||||
from Common.Misc import GuidStructureStringToGuidString
|
||||
from Common.Misc import CheckPcdDatum
|
||||
from Common.Misc import BuildOptionPcdValueFormat
|
||||
from Common.BuildVersion import gBUILD_VERSION
|
||||
from Common.MultipleWorkspace import MultipleWorkspace as mws
|
||||
|
||||
@ -408,31 +409,6 @@ def CheckBuildOptionPcd():
|
||||
|
||||
GlobalData.BuildOptionPcd[i] = (TokenSpaceGuidCName, TokenCName, NewValue)
|
||||
|
||||
def BuildOptionPcdValueFormat(TokenSpaceGuidCName, TokenCName, PcdDatumType, Value):
|
||||
if PcdDatumType == 'VOID*':
|
||||
if Value.startswith('L'):
|
||||
if not Value[1]:
|
||||
EdkLogger.error('GenFds', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')
|
||||
Value = Value[0] + '"' + Value[1:] + '"'
|
||||
elif Value.startswith('B'):
|
||||
if not Value[1]:
|
||||
EdkLogger.error('GenFds', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')
|
||||
Value = Value[1:]
|
||||
else:
|
||||
if not Value[0]:
|
||||
EdkLogger.error('GenFds', OPTION_VALUE_INVALID, 'For Void* type PCD, when specify the Value in the command line, please use the following format: "string", L"string", B"{...}"')
|
||||
Value = '"' + Value + '"'
|
||||
|
||||
IsValid, Cause = CheckPcdDatum(PcdDatumType, Value)
|
||||
if not IsValid:
|
||||
EdkLogger.error('build', FORMAT_INVALID, Cause, ExtraData="%s.%s" % (TokenSpaceGuidCName, TokenCName))
|
||||
if PcdDatumType == 'BOOLEAN':
|
||||
Value = Value.upper()
|
||||
if Value == 'TRUE' or Value == '1':
|
||||
Value = '1'
|
||||
elif Value == 'FALSE' or Value == '0':
|
||||
Value = '0'
|
||||
return Value
|
||||
|
||||
## FindExtendTool()
|
||||
#
|
||||
|
@ -102,6 +102,8 @@ if __name__ == '__main__':
|
||||
try:
|
||||
OpenSslPath = os.environ['OPENSSL_PATH']
|
||||
OpenSslCommand = os.path.join(OpenSslPath, OpenSslCommand)
|
||||
if ' ' in OpenSslCommand:
|
||||
OpenSslCommand = '"' + OpenSslCommand + '"'
|
||||
except:
|
||||
pass
|
||||
|
||||
|
@ -21,10 +21,44 @@ You may need the following steps for initialization:
|
||||
|
||||
rd ./demoCA /S/Q
|
||||
mkdir ./demoCA
|
||||
echo "" > ./demoCA/index.txt
|
||||
echo.>./demoCA/index.txt
|
||||
echo 01 > ./demoCA/serial
|
||||
mkdir ./demoCA/newcerts
|
||||
|
||||
OpenSSL will apply the options from the specified sections in openssl.cnf when creating certificates or certificate signing requests. Make sure your configuration in openssl.cnf is correct and rational for certificate constraints.
|
||||
The following sample sections were used when generating test certificates in this readme.
|
||||
...
|
||||
[ req ]
|
||||
default_bits = 2048
|
||||
default_keyfile = privkey.pem
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
x509_extensions = v3_ca # The extensions to add to the self signed cert
|
||||
...
|
||||
[ v3_ca ]
|
||||
# Extensions for a typical Root CA.
|
||||
subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid:always,issuer
|
||||
basicConstraints = critical,CA:true
|
||||
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
|
||||
...
|
||||
[ v3_intermediate_ca ]
|
||||
# Extensions for a typical intermediate CA.
|
||||
subjectKeyIdentifier = hash
|
||||
authorityKeyIdentifier = keyid:always,issuer
|
||||
basicConstraints = critical, CA:true
|
||||
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
|
||||
...
|
||||
[ usr_cert ]
|
||||
# Extensions for user end certificates.
|
||||
basicConstraints = CA:FALSE
|
||||
nsCertType = client, email
|
||||
subjectKeyIdentifier = hash
|
||||
authorityKeyIdentifier = keyid,issuer
|
||||
keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment
|
||||
extendedKeyUsage = clientAuth, emailProtection
|
||||
...
|
||||
|
||||
* Generate the certificate chain:
|
||||
|
||||
NOTE: User MUST set a UNIQUE "Common Name" on the different certificate
|
||||
@ -37,7 +71,7 @@ Generate a root key:
|
||||
|
||||
Generate a self-signed root certificate:
|
||||
|
||||
openssl req -new -x509 -days 3650 -key TestRoot.key -out TestRoot.crt
|
||||
openssl req -extensions v3_ca -new -x509 -days 3650 -key TestRoot.key -out TestRoot.crt
|
||||
openssl x509 -in TestRoot.crt -out TestRoot.cer -outform DER
|
||||
openssl x509 -inform DER -in TestRoot.cer -outform PEM -out TestRoot.pub.pem
|
||||
|
||||
@ -50,7 +84,7 @@ Generate the intermediate key:
|
||||
Generate the intermediate certificate:
|
||||
|
||||
openssl req -new -days 3650 -key TestSub.key -out TestSub.csr
|
||||
openssl ca -extensions v3_ca -in TestSub.csr -days 3650 -out TestSub.crt -cert TestRoot.crt -keyfile TestRoot.key
|
||||
openssl ca -extensions v3_intermediate_ca -in TestSub.csr -days 3650 -out TestSub.crt -cert TestRoot.crt -keyfile TestRoot.key
|
||||
openssl x509 -in TestSub.crt -out TestSub.cer -outform DER
|
||||
openssl x509 -inform DER -in TestSub.cer -outform PEM -out TestSub.pub.pem
|
||||
|
||||
@ -63,7 +97,7 @@ Generate User key:
|
||||
Generate User certificate:
|
||||
|
||||
openssl req -new -days 3650 -key TestCert.key -out TestCert.csr
|
||||
openssl ca -in TestCert.csr -days 3650 -out TestCert.crt -cert TestSub.crt -keyfile TestSub.key`
|
||||
openssl ca -extensions usr_cert -in TestCert.csr -days 3650 -out TestCert.crt -cert TestSub.crt -keyfile TestSub.key
|
||||
openssl x509 -in TestCert.crt -out TestCert.cer -outform DER
|
||||
openssl x509 -inform DER -in TestCert.cer -outform PEM -out TestCert.pub.pem
|
||||
|
||||
|
@ -1,57 +1,60 @@
|
||||
Bag Attributes
|
||||
localKeyID: 01 00 00 00
|
||||
Microsoft CSP Name: Microsoft Strong Cryptographic Provider
|
||||
friendlyName: PvkTmp:133cc061-112c-467a-b8cf-dc0a56d7830e
|
||||
Key Attributes
|
||||
X509v3 Key Usage: 80
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCSPHYSohF+fim4
|
||||
89iNx8CcCG/fPb7KLu9Dsq+p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tSYJzYXP1AHQny3Ip5kutCMo19td
|
||||
R4LfdebcgQKBgF3CHQzJ/mw0euWN2cdGnid3W9J4uUJMH8n0MpMU4ar+2/xVNUAO
|
||||
YTBXmirusGbKO8SPocwsMXQ8bGMrrc19yeREUpr22XdB6408L9WfnyW9hsuWlGhm
|
||||
LclLT4I4cf/9GNbIJedcvvRckEozvmFdIplMP0tpeiDEdfYwZNSkiuktAoGBAL5m
|
||||
gTXYDSFO/VUiFFOsOElyPV174LOsuQyVoGZjOjOtI1rVInTqkAD1p1/hf+aahSyD
|
||||
qYzrvv8s+RVWKg9u10JDNgVg0kupHLr98RfPiWJg8vHhXFYwtb6tlNMS9+9yvczm
|
||||
O4jzY/4zW7+qQoYKxkyq2pVn7uVOnmPNcQIHEGqBAoGBAJMfZV2vpxY6kti8SXzb
|
||||
PscYI3ZbbKyJLq4+KHGcKCqqbLiY4ao8vflDyDwBm+TJg4xq9wjJAN2riE9nuuds
|
||||
99mYW/8R30BIfiH/4oBHjggb0NC5K3vHR4KGDKcUiIKZPv1r7mNeYw227N4n/dPM
|
||||
NXjlZVuS6mqc2T+GPzAJj/Uf
|
||||
-----END PRIVATE KEY-----
|
||||
Bag Attributes
|
||||
localKeyID: 01 00 00 00
|
||||
subject=/CN=TestCert
|
||||
issuer=/CN=TestSub
|
||||
localKeyID: 32 25 22 FA 81 B3 BF 25 E2 F7 8F 0B 1B C4 50 70 BB B7 85 96
|
||||
subject=/C=CN/ST=SH/O=TianoCore/OU=EDKII/CN=TestCert/emailAddress=edkii@tianocore.org
|
||||
issuer=/C=CN/ST=SH/O=TianoCore/OU=EDKII/CN=TestSub/emailAddress=edkii@tianocore.org
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC/TCCAemgAwIBAgIQ0+nLBVt+jbJMSfzhFpRJrDAJBgUrDgMCHQUAMBIxEDAO
|
||||
BgNVBAMTB1Rlc3RTdWIwHhcNMTYwODA0MTUwMjMwWhcNMzkxMjMxMjM1OTU5WjAT
|
||||
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KwYBBQUHAwIGCCsGAQUFBwMEMA0GCSqGSIb3DQEBCwUAA4IBAQA7
|
||||
vYHdpk9u63dpMKAt5MrKU9dxVn/wuqNaYQMucvQLpcE12fgWMhV2wOHlmk3fJxq7
|
||||
CnD8QVaRbL3OQYWQQDA+sGNSJ9r71WFFET++94Rny6BzTz+dkrvIS4WaL/vLZ17c
|
||||
/gOsMCZUlhodxDcSSkachab3eE/VTEzOMUm41YYeW7USIoNSSgkWSnwZQVgcIg93
|
||||
F9X6lIr0Ik6rxHMq2ManiuSh6cMjJMGYGf2/58TySIefrXTe2A3TKQR27OYjfXJO
|
||||
l/H7u+4HS9AVCA7b9NihR5iSho5HrWqNC4Mmuz8D8iFOI2nWcek86StDswtoqDtu
|
||||
yekXblzF5lQY0goqDiks
|
||||
-----END CERTIFICATE-----
|
||||
Bag Attributes
|
||||
localKeyID: 32 25 22 FA 81 B3 BF 25 E2 F7 8F 0B 1B C4 50 70 BB B7 85 96
|
||||
Key Attributes: <No Attributes>
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQD3vtjV/039IljC
|
||||
YGDFzKFjor3l/RRsfWHMB/gSp/WT2R4oOgrGegde38AVnpPKyDgDkVvBS/lMkYbJ
|
||||
yhf6CozDe2sIi42nJI6vJtGzxR1ZeHSaKLpR5kjwrETHhv6VrOA1T1oiKBdbr1ze
|
||||
jGd87dIaH4Kj5xoyUBdByxAqz6sgb+7IrfXyGjWf3JanEd2anV0EVHxJO3RPKYPm
|
||||
YzTWv+VkxsEgQeyHpLuIxmysm76Y+hbRD//GMgCQt3zg/mODyEApxcc1nIThqxXK
|
||||
HqoH/4S4c6Ikb2pYJ743M26N1uLIBcBQ/1saA6m9ZdZqB8jrm8OaEwnQ/ifkMHRZ
|
||||
dZApBvivAgMBAAECggEBAJ8NtLJ27T/1vBxWuepjfL217sroFyOrv4y5FQgNMvnP
|
||||
q6/Ry7cvAupjJjP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ku4jGbKybvpj6FtEP/8YyAJC3fOD+Y4PIQCnF
|
||||
xzWchOGrFcoeqgf/hLhzoiRvalgnvjczbo3W4sgFwFD/WxoDqb1l1moHyOubw5oT
|
||||
CdD+J+QwdFl1kCkG+K8CAwEAAaOBxTCBwjAJBgNVHRMEAjAAMBEGCWCGSAGG+EIB
|
||||
AQQEAwIFoDAzBglghkgBhvhCAQ0EJhYkT3BlblNTTCBHZW5lcmF0ZWQgQ2xpZW50
|
||||
IENlcnRpZmljYXRlMB0GA1UdDgQWBBTACEuCjiL/cFrP+l8hECWctq+Q+TAfBgNV
|
||||
HSMEGDAWgBTWnWbWSXz6II1ddWkqQQp6A1ql6zAOBgNVHQ8BAf8EBAMCBeAwHQYD
|
||||
VR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMA0GCSqGSIb3DQEBCwUAA4IBAQA7
|
||||
vYHdpk9u63dpMKAt5MrKU9dxVn/wuqNaYQMucvQLpcE12fgWMhV2wOHlmk3fJxq7
|
||||
CnD8QVaRbL3OQYWQQDA+sGNSJ9r71WFFET++94Rny6BzTz+dkrvIS4WaL/vLZ17c
|
||||
/gOsMCZUlhodxDcSSkachab3eE/VTEzOMUm41YYeW7USIoNSSgkWSnwZQVgcIg93
|
||||
F9X6lIr0Ik6rxHMq2ManiuSh6cMjJMGYGf2/58TySIefrXTe2A3TKQR27OYjfXJO
|
||||
l/H7u+4HS9AVCA7b9NihR5iSho5HrWqNC4Mmuz8D8iFOI2nWcek86StDswtoqDtu
|
||||
yekXblzF5lQY0goqDiks
|
||||
-----END CERTIFICATE-----
|
||||
|
Binary file not shown.
@ -1,56 +1,58 @@
|
||||
Bag Attributes
|
||||
localKeyID: 01 00 00 00
|
||||
Microsoft CSP Name: Microsoft Strong Cryptographic Provider
|
||||
friendlyName: PvkTmp:76c92422-d6f3-4763-9b80-b423fd921d00
|
||||
Key Attributes
|
||||
X509v3 Key Usage: 80
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvAI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PonZQSsEiJ6jhzaUZr7l5OAEp+0aX0M/h6JbxTcA4CK3Xr
|
||||
X2TAaOCkPc1r0I79ZduKymyMNrWfXHenvFVl57klp9eFRQJ6o+pZB9ysFzPHXbci
|
||||
4VCsX6ECgYBMqAdB8M1apafxXihmDl2FoJmar+LtzCGbqvGPyn772FbGGUxejqG5
|
||||
/89iB9gbtBELbvgEvSisFsXPgOso3Ae9RN2Aro68o50QyPocIv7jFVDPPRsDp6z5
|
||||
XmVRZNIQUO6jPln+6YNLWuAsdmKkN0Z5qoD8DnvK1JZMRQ+ZM5eB6QKBgQCuvz+w
|
||||
VsMyn4uj9o0PSK/gGRQGV7FX2iAwY7g98vrWix+40FlhS3MkWzTZMaXc+uyyV5ff
|
||||
kmtfcwLnhljm0XHBQ9fZzcdX0y1bXAI6oElYk8vIxnG1UEnsOgyrmcCG+zcHC1fE
|
||||
wxhri+TLyx9UfwNlKBOrq0KhYB00nQDUUpFpgQKBgQCPWpNeNQ8hCARnayhzu2fE
|
||||
HEPG1P/resOp0u+c4jy4TeHVa9806wqZlkYNRKNn09Ub5Ajpp05dwdb+JvUSkWwr
|
||||
vOmE94WeLg5FuNzPAQjwAe+Eq54Vk8TdAhdLSu1m2xdBKFtEOk6TQTmRBCiknwhg
|
||||
19TgHd8hEFnz6ZICAeWGbQ==
|
||||
-----END PRIVATE KEY-----
|
||||
Bag Attributes
|
||||
localKeyID: 01 00 00 00
|
||||
subject=/CN=TestRoot
|
||||
issuer=/CN=TestRoot
|
||||
localKeyID: F4 2E C8 1D 29 A0 02 47 B7 93 2B 69 8D 8D D1 33 7A E3 09 30
|
||||
subject=/C=CN/ST=SH/L=SH/O=TianoCore/OU=EDKII/CN=TestRoot/emailAddress=edkii@tianocore.org
|
||||
issuer=/C=CN/ST=SH/L=SH/O=TianoCore/OU=EDKII/CN=TestRoot/emailAddress=edkii@tianocore.org
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC8DCCAdygAwIBAgIQNDAnfwU9lYVDo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VR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4IBAQCV3t+kFNuSIngavTGdHtcv
|
||||
ChARXXRh6DDE8xXpMFT0uwwEeBNdLN2MkpDRnNDQGKOj/IwoWtSRTQjD9hrI3aYI
|
||||
WOIVlfstLYqxMIC9mrbhLCA+3cTHVWXPKBf07tq+d3DVUtYVevutr/3VRZBa5jFC
|
||||
14SzSVZq00fzv2hgiw/ir/Tj7BK54joWEU5Nc3mvR4VMdiaeizLAjsLcJ6bvrJOe
|
||||
oV7PNEXgKsedTdfXN3KX+Fj5tjVI8dEKcn/9TXzpzNhIG0lSU95RAVM1vJDNjIrM
|
||||
QyCnRf8rVbCLLf9VFUuE0MPTkJyUS1XVYuoiq2Jo3VPG3KXdmi2OeXwunORmgIwd
|
||||
-----END CERTIFICATE-----
|
||||
Bag Attributes
|
||||
localKeyID: F4 2E C8 1D 29 A0 02 47 B7 93 2B 69 8D 8D D1 33 7A E3 09 30
|
||||
Key Attributes: <No Attributes>
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC5KSlsYAzXI/Z9
|
||||
7vBi/9nJqlWMgZVWP7dWU7DCghLFO3UjuU3WxFVz86qVqBvzk36eQOQdIpyTBwvX
|
||||
qlvX5BohhNdjWQNQH/UUVZORm/VSsL8OXGg7WVKYllbhq8RDuwVXeEUBn1gVUw4R
|
||||
lC8O8aYZom6GOSszjcfF6+4eM9MylMFZxAyXCxJIXzP2YHR9V8ITLX2ph6M16pGD
|
||||
P2d6kh8BU59iX5kS/XMbLZ4rbDRJr08Hj8Dpa55feTXaKlyI7vZIYdqW40hGoJQc
|
||||
nfZchw7vdAmRDT1a58VMinqsoYW2Z0QXVVI66BFNWKKTAGLqe4Dtz73fdYBLuWVj
|
||||
rQtNdPpZAgMBAAECggEAci5d6wT4Jht5P4N/Ha2kweWWR8UJMFyuVD/bura3mITn
|
||||
4ZW92HjOMWjLg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
|
||||
HwFTn2JfmRL9cxstnitsNEmvTwePwOlrnl95NdoqXIju9khh2pbjSEaglByd9lyH
|
||||
Du90CZENPVrnxUyKeqyhhbZnRBdVUjroEU1YopMAYup7gO3Pvd91gEu5ZWOtC010
|
||||
+lkCAwEAAaNjMGEwHQYDVR0OBBYEFBaq1o4bLUPzLbAkrTZlP7L6sSztMB8GA1Ud
|
||||
IwQYMBaAFBaq1o4bLUPzLbAkrTZlP7L6sSztMA8GA1UdEwEB/wQFMAMBAf8wDgYD
|
||||
VR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4IBAQCV3t+kFNuSIngavTGdHtcv
|
||||
ChARXXRh6DDE8xXpMFT0uwwEeBNdLN2MkpDRnNDQGKOj/IwoWtSRTQjD9hrI3aYI
|
||||
WOIVlfstLYqxMIC9mrbhLCA+3cTHVWXPKBf07tq+d3DVUtYVevutr/3VRZBa5jFC
|
||||
14SzSVZq00fzv2hgiw/ir/Tj7BK54joWEU5Nc3mvR4VMdiaeizLAjsLcJ6bvrJOe
|
||||
oV7PNEXgKsedTdfXN3KX+Fj5tjVI8dEKcn/9TXzpzNhIG0lSU95RAVM1vJDNjIrM
|
||||
QyCnRf8rVbCLLf9VFUuE0MPTkJyUS1XVYuoiq2Jo3VPG3KXdmi2OeXwunORmgIwd
|
||||
-----END CERTIFICATE-----
|
||||
|
@ -1,57 +1,59 @@
|
||||
Bag Attributes
|
||||
localKeyID: 01 00 00 00
|
||||
Microsoft CSP Name: Microsoft Strong Cryptographic Provider
|
||||
friendlyName: PvkTmp:11e8b08d-46fb-45a2-90c4-d458be4a1276
|
||||
Key Attributes
|
||||
X509v3 Key Usage: 80
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCfNn3oUo5iCBXg
|
||||
x1AUxgHG/h23/WyThgYj2NAToG3S51i0MGamyjGP8GbBphRc0ORpIhQE8Va+NPjW
|
||||
cdoh4s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UquRtfJOXsfcGmGG7hG2qcmxs
|
||||
UWVZv92itGhx34ctjQI+VRqGW5ZI7F6BgvHeZHdaoEK8ncnWIIZQD8QgiBLqO8cU
|
||||
a9dNarzaSDo2ytJ/dUVPSJY9oec7Nz1xaWPWfyhjMBa3g39KOd2RO1vxAoGBAMRD
|
||||
Q9r6JSeJwId6diy0FAyhJVEfJux+36tYGVddO5nn7Wf3bW4cGhf4WYr45IJt+njH
|
||||
OVMwsKG3K3FoxVOKCaDT5SjVEtUUZkOvqlspY3iMAWLjgOlQH7uzimuQCfhE+06K
|
||||
wB4D581zHFAX6xL8R4TA4+k59jP+D9o4fue9yGZ5AoGAMn+TsY1IZFSY1fw6TTHq
|
||||
sp9PiYQQqTMjRkzE7GRXbb1rdE6WoLkSk4Dz4u/B9E7YVzTZggYhPisChu6wZPtK
|
||||
IiXBGu8h3GygUGI/WdNRKHW5nst9IZWrtVJ06c87jWqOktbgBnrbqXUG1rgRZr+i
|
||||
n3sJLF+GGwzdp/gCxLMH66M=
|
||||
-----END PRIVATE KEY-----
|
||||
Bag Attributes
|
||||
localKeyID: 01 00 00 00
|
||||
subject=/CN=TestSub
|
||||
issuer=/CN=TestRoot
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDADCCAeygAwIBAgIQs4xkpm0/PYFLyLk1Nd0c0zAJBgUrDgMCHQUAMBMxETAP
|
||||
BgNVBAMTCFRlc3RSb290MB4XDTE2MDgwNDE1MDIwOVoXDTM5MTIzMTIzNTk1OVow
|
||||
EjEQMA4GA1UEAxMHVGVzdFN1YjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
||||
ggEBAJ82fehSjmIIFeDHUBTGAcb+Hbf9bJOGBiPY0BOgbdLnWLQwZqbKMY/wZsGm
|
||||
FFzQ5GkiFATxVr40+NZx2iHixcs6uhbcSzbqxH5zF1HA0XT9jEr/4luhgOZ1R5yB
|
||||
zCqKki/v3ltVCNEsLJP/4uMtez8Hdcz+NziMdruCz4CbAfYNfP1VOwgeZeub8oZn
|
||||
rhVDMVslgmX4q8UCaWYtwv63T32XKIlgv7ctjZqOifOQCJ1VDKUh+yaECVycZ57o
|
||||
xh8/EtBF7ikgiWHJcApmLEGcCVm+J+jclHBMpdEfOSPpWnkqEOyL/fVjniIslAeJ
|
||||
638WXKYgeu2QWkLjvGKd0XqM2l8CAwEAAaNZMFcwDwYDVR0TAQH/BAUwAwEB/zBE
|
||||
BgNVHQEEPTA7gBDOtXrP5SHHa/PsktS/ZSo1oRUwEzERMA8GA1UEAxMIVGVzdFJv
|
||||
b3SCEDQwJ38FPZWFQ6Ck9Qya58owCQYFKw4DAh0FAAOCAQEAFT8uXdMSHCmatVNg
|
||||
LMKsyVA/jJgXGncHmAy59Vjo2+KCIooEuY3NaK527LxB1yi9+UyMe2+Ia4KWcEGY
|
||||
+mb+PDTDrlsYtjIU3aRzDpyXUrkYV/D6vZaw+zsgAquQkCi+WwEYZ4uCSUznlcyt
|
||||
U3p2Rd/+tvQqq5UerPfRBIs6JTUerwRGUQurTNpzqCGClo3zi58yuOEbNIrOzW1D
|
||||
MtQFKUtKkMx4rg6NT9kq/ICXt8k3UIsXh52NTYchkLlsnCgaoKzW2DFqSMFL3KC0
|
||||
NmQtmKaPo3mBIYJT0WDofYzas2TQO8cBiQHGrSqXNFAfI5eUo3qLtsRE+7Z9F2Mw
|
||||
HgNmsA==
|
||||
-----END CERTIFICATE-----
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
Serial Number: 4098 (0x1002)
|
||||
Signature Algorithm: sha256WithRSAEncryption
|
||||
Issuer: C = CN, ST = SH, L = SH, O = TianoCore, OU = EDKII, CN = TestRoot, emailAddress = edkii@tianocore.org
|
||||
Validity
|
||||
Not Before: Apr 10 08:33:45 2017 GMT
|
||||
Not After : Apr 10 08:33:45 2018 GMT
|
||||
Subject: C = CN, ST = SH, O = TianoCore, OU = EDKII, CN = TestSub, emailAddress = edkii@tianocore.org
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
Public-Key: (2048 bit)
|
||||
Modulus:
|
||||
00:c5:3a:af:16:34:9a:14:61:74:8c:39:1a:04:1f:
|
||||
7b:95:d3:40:b7:ea:26:a7:7b:8d:76:d3:86:1b:7c:
|
||||
07:17:d2:56:72:36:13:b4:6c:75:b7:bf:d1:35:d1:
|
||||
31:d5:9a:07:c1:62:4e:aa:3d:bd:d8:40:8b:48:9a:
|
||||
c5:46:c4:c3:10:2c:d4:82:d9:6d:f4:c3:de:85:fa:
|
||||
34:1d:d1:74:7a:5f:16:34:59:2b:2b:03:61:46:62:
|
||||
d7:88:62:59:4d:d8:55:00:52:54:e1:15:5e:a9:ec:
|
||||
d6:e8:51:fd:ef:8e:68:5f:d2:40:d2:61:ef:2c:1d:
|
||||
5b:a7:6e:14:4c:12:bc:60:81:8e:66:c9:84:51:c2:
|
||||
89:51:fc:e5:7f:86:9a:78:a4:c1:f7:0f:a9:a5:97:
|
||||
60:dd:6f:c8:a0:fd:ea:07:2f:01:36:0a:e8:bd:0e:
|
||||
dc:48:2e:85:22:7b:bb:db:68:78:eb:cd:6a:54:07:
|
||||
f7:81:a5:52:8f:f3:5c:09:1e:76:a3:d1:91:8f:ee:
|
||||
86:2c:85:49:99:96:4f:5f:5b:0d:08:ae:d8:20:e8:
|
||||
e3:67:70:c6:ec:0e:0e:bd:bf:3c:f6:db:e4:45:d5:
|
||||
7a:bb:9f:d1:3b:18:89:fc:63:ac:c2:30:b8:fa:bb:
|
||||
8a:24:63:4e:79:58:78:72:ab:27:36:3d:bb:4f:47:
|
||||
d6:ef
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Subject Key Identifier:
|
||||
D6:9D:66:D6:49:7C:FA:20:8D:5D:75:69:2A:41:0A:7A:03:5A:A5:EB
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:16:AA:D6:8E:1B:2D:43:F3:2D:B0:24:AD:36:65:3F:B2:FA:B1:2C:ED
|
||||
|
||||
X509v3 Basic Constraints: critical
|
||||
CA:TRUE
|
||||
X509v3 Key Usage: critical
|
||||
Digital Signature, Certificate Sign, CRL Sign
|
||||
Signature Algorithm: sha256WithRSAEncryption
|
||||
83:3c:ae:b2:fc:99:3d:33:b3:da:ca:26:83:8c:a9:ae:f8:bb:
|
||||
ad:05:37:97:a5:f8:0d:2b:4e:3e:e5:b7:12:68:f8:64:d4:bd:
|
||||
ff:65:7d:57:98:61:cd:47:10:a5:6a:bd:66:89:74:ce:5e:28:
|
||||
29:39:67:c9:1f:54:ec:78:76:b1:dd:04:91:63:b6:8c:2f:86:
|
||||
59:1f:c4:2b:a1:4a:8c:a8:5b:f6:8a:92:f0:83:bb:92:92:5c:
|
||||
b1:1c:18:95:3d:d6:be:6d:79:9d:4f:7b:92:1f:68:f5:1f:cd:
|
||||
f4:37:2d:1e:e3:f6:eb:f2:8a:a4:8d:a1:c5:db:0c:3a:59:01:
|
||||
dc:be:a9:c1:0b:04:ba:e8:02:a9:85:cd:d7:48:0d:f6:60:30:
|
||||
2b:05:ba:e0:c7:d8:9f:23:14:37:04:0a:a7:bc:b6:c8:25:31:
|
||||
e4:9a:41:a5:83:c2:ee:89:d3:fa:a5:7c:ae:a6:14:22:a4:5f:
|
||||
73:03:f2:7b:3c:51:f7:76:2a:0a:cf:ee:71:35:1c:bc:ff:3f:
|
||||
9b:d5:b1:33:e0:b6:fc:2a:c8:ab:84:89:cd:fa:1c:ee:12:8c:
|
||||
07:ba:93:46:50:b3:3f:73:05:be:67:58:60:90:05:2c:d3:b6:
|
||||
19:7c:a4:f0:6e:ee:d4:f2:0e:f5:02:79:5f:2c:28:83:1e:83:
|
||||
c6:92:ba:7c
|
||||
|
@ -1,19 +1,23 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDADCCAeygAwIBAgIQs4xkpm0/PYFLyLk1Nd0c0zAJBgUrDgMCHQUAMBMxETAP
|
||||
BgNVBAMTCFRlc3RSb290MB4XDTE2MDgwN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A0rTj7ltxJo+GTUvf9l
|
||||
fVeYYc1HEKVqvWaJdM5eKCk5Z8kfVOx4drHdBJFjtowvhlkfxCuhSoyoW/aKkvCD
|
||||
u5KSXLEcGJU91r5teZ1Pe5IfaPUfzfQ3LR7j9uvyiqSNocXbDDpZAdy+qcELBLro
|
||||
AqmFzddIDfZgMCsFuuDH2J8jFDcECqe8tsglMeSaQaWDwu6J0/qlfK6mFCKkX3MD
|
||||
8ns8Ufd2KgrP7nE1HLz/P5vVsTPgtvwqyKuEic36HO4SjAe6k0ZQsz9zBb5nWGCQ
|
||||
BSzTthl8pPBu7tTyDvUCeV8sKIMeg8aSunw=
|
||||
-----END CERTIFICATE-----
|
||||
|
@ -64,6 +64,8 @@ if __name__ == '__main__':
|
||||
try:
|
||||
OpenSslPath = os.environ['OPENSSL_PATH']
|
||||
OpenSslCommand = os.path.join(OpenSslPath, OpenSslCommand)
|
||||
if ' ' in OpenSslCommand:
|
||||
OpenSslCommand = '"' + OpenSslCommand + '"'
|
||||
except:
|
||||
pass
|
||||
|
||||
|
@ -85,6 +85,8 @@ if __name__ == '__main__':
|
||||
try:
|
||||
OpenSslPath = os.environ['OPENSSL_PATH']
|
||||
OpenSslCommand = os.path.join(OpenSslPath, OpenSslCommand)
|
||||
if ' ' in OpenSslCommand:
|
||||
OpenSslCommand = '"' + OpenSslCommand + '"'
|
||||
except:
|
||||
pass
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
# build a platform or a module
|
||||
#
|
||||
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
|
||||
# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
@ -54,7 +54,7 @@ import Common.GlobalData as GlobalData
|
||||
# Version and Copyright
|
||||
VersionNumber = "0.60" + ' ' + gBUILD_VERSION
|
||||
__version__ = "%prog Version " + VersionNumber
|
||||
__copyright__ = "Copyright (c) 2007 - 2016, Intel Corporation All rights reserved."
|
||||
__copyright__ = "Copyright (c) 2007 - 2017, Intel Corporation All rights reserved."
|
||||
|
||||
## standard targets of build command
|
||||
gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
|
||||
@ -989,7 +989,6 @@ class Build():
|
||||
self.PostbuildScript = PostbuildList[0]
|
||||
self.Postbuild = ' '.join(PostbuildList)
|
||||
self.Postbuild += self.PassCommandOption(self.BuildTargetList, self.ArchList, self.ToolChainList)
|
||||
#self.LanuchPostbuild()
|
||||
else:
|
||||
EdkLogger.error("Postbuild", POSTBUILD_ERROR, "the postbuild script %s is not exist.\n If you'd like to disable the Postbuild process, please use the format: -D POSTBUILD=\"\" " %(PostbuildList[0]))
|
||||
|
||||
@ -1040,7 +1039,7 @@ class Build():
|
||||
Process = Popen(args, stdout=PIPE, stderr=PIPE)
|
||||
else:
|
||||
args = ' && '.join((self.Prebuild, 'env > ' + PrebuildEnvFile))
|
||||
Process = Popen(args, stdout=PIPE, stderr=PIPE, shell=True, executable="/bin/bash")
|
||||
Process = Popen(args, stdout=PIPE, stderr=PIPE, shell=True)
|
||||
|
||||
# launch two threads to read the STDOUT and STDERR
|
||||
EndOfProcedure = Event()
|
||||
@ -1076,13 +1075,13 @@ class Build():
|
||||
os.environ.update(dict(envs))
|
||||
EdkLogger.info("\n- Prebuild Done -\n")
|
||||
|
||||
def LanuchPostbuild(self):
|
||||
def LaunchPostbuild(self):
|
||||
if self.Postbuild:
|
||||
EdkLogger.info("\n- Postbuild Start -\n")
|
||||
if sys.platform == "win32":
|
||||
Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE)
|
||||
else:
|
||||
Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE, shell=True, executable="/bin/bash")
|
||||
Process = Popen(self.Postbuild, stdout=PIPE, stderr=PIPE, shell=True)
|
||||
# launch two threads to read the STDOUT and STDERR
|
||||
EndOfProcedure = Event()
|
||||
EndOfProcedure.clear()
|
||||
@ -2331,7 +2330,7 @@ def Main():
|
||||
|
||||
if ReturnCode == 0:
|
||||
try:
|
||||
MyBuild.LanuchPostbuild()
|
||||
MyBuild.LaunchPostbuild()
|
||||
Conclusion = "Done"
|
||||
except:
|
||||
Conclusion = "Failed"
|
||||
|
@ -20,7 +20,7 @@
|
||||
PACKAGE_NAME = CryptoPkg
|
||||
PACKAGE_UNI_FILE = CryptoPkg.uni
|
||||
PACKAGE_GUID = 36470E80-36F2-4ba0-8CC8-937C7D9FF888
|
||||
PACKAGE_VERSION = 0.96
|
||||
PACKAGE_VERSION = 0.97
|
||||
|
||||
[Includes]
|
||||
Include
|
||||
|
@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# Cryptographic Library Package for UEFI Security Implementation.
|
||||
#
|
||||
# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -20,7 +20,7 @@
|
||||
[Defines]
|
||||
PLATFORM_NAME = CryptoPkg
|
||||
PLATFORM_GUID = E1063286-6C8C-4c25-AEF0-67A9A5B6E6B6
|
||||
PLATFORM_VERSION = 0.96
|
||||
PLATFORM_VERSION = 0.97
|
||||
DSC_SPECIFICATION = 0x00010005
|
||||
OUTPUT_DIRECTORY = Build/CryptoPkg
|
||||
SUPPORTED_ARCHITECTURES = IA32|X64|IPF|ARM|AARCH64
|
||||
|
@ -1790,10 +1790,10 @@ Arc4Init (
|
||||
If Output is NULL, then return FALSE.
|
||||
If this interface is not supported, then return FALSE.
|
||||
|
||||
@param[in] Arc4Context Pointer to the ARC4 context.
|
||||
@param[in] Input Pointer to the buffer containing the data to be encrypted.
|
||||
@param[in] InputSize Size of the Input buffer in bytes.
|
||||
@param[out] Output Pointer to a buffer that receives the ARC4 encryption output.
|
||||
@param[in, out] Arc4Context Pointer to the ARC4 context.
|
||||
@param[in] Input Pointer to the buffer containing the data to be encrypted.
|
||||
@param[in] InputSize Size of the Input buffer in bytes.
|
||||
@param[out] Output Pointer to a buffer that receives the ARC4 encryption output.
|
||||
|
||||
@retval TRUE ARC4 encryption succeeded.
|
||||
@retval FALSE ARC4 encryption failed.
|
||||
@ -1822,10 +1822,10 @@ Arc4Encrypt (
|
||||
If Output is NULL, then return FALSE.
|
||||
If this interface is not supported, then return FALSE.
|
||||
|
||||
@param[in] Arc4Context Pointer to the ARC4 context.
|
||||
@param[in] Input Pointer to the buffer containing the data to be decrypted.
|
||||
@param[in] InputSize Size of the Input buffer in bytes.
|
||||
@param[out] Output Pointer to a buffer that receives the ARC4 decryption output.
|
||||
@param[in, out] Arc4Context Pointer to the ARC4 context.
|
||||
@param[in] Input Pointer to the buffer containing the data to be decrypted.
|
||||
@param[in] InputSize Size of the Input buffer in bytes.
|
||||
@param[out] Output Pointer to a buffer that receives the ARC4 decryption output.
|
||||
|
||||
@retval TRUE ARC4 decryption succeeded.
|
||||
@retval FALSE ARC4 decryption failed.
|
||||
@ -2511,7 +2511,7 @@ Pkcs7Verify (
|
||||
@retval TRUE The P7Data was correctly formatted for processing.
|
||||
@retval FALSE The P7Data was not correctly formatted for processing.
|
||||
|
||||
*/
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
Pkcs7GetAttachedContent (
|
||||
|
@ -232,7 +232,9 @@ DhGenerateKey (
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BN_bn2bin (DhPubKey, PublicKey);
|
||||
if (PublicKey != NULL) {
|
||||
BN_bn2bin (DhPubKey, PublicKey);
|
||||
}
|
||||
*PublicKeySize = Size;
|
||||
}
|
||||
|
||||
|
@ -558,7 +558,9 @@ Pkcs7GetCertificatesList (
|
||||
}
|
||||
}
|
||||
CtxUntrusted = X509_STORE_CTX_get0_untrusted (CertCtx);
|
||||
(VOID)sk_X509_delete_ptr (CtxUntrusted, Signer);
|
||||
if (CtxUntrusted != NULL) {
|
||||
(VOID)sk_X509_delete_ptr (CtxUntrusted, Signer);
|
||||
}
|
||||
|
||||
//
|
||||
// Build certificates stack chained from Signer's certificate.
|
||||
@ -711,8 +713,10 @@ _Error:
|
||||
}
|
||||
sk_X509_free (Signers);
|
||||
|
||||
X509_STORE_CTX_cleanup (CertCtx);
|
||||
X509_STORE_CTX_free (CertCtx);
|
||||
if (CertCtx != NULL) {
|
||||
X509_STORE_CTX_cleanup (CertCtx);
|
||||
X509_STORE_CTX_free (CertCtx);
|
||||
}
|
||||
|
||||
if (SingleCert != NULL) {
|
||||
free (SingleCert);
|
||||
@ -925,7 +929,7 @@ _Exit:
|
||||
@retval TRUE The P7Data was correctly formatted for processing.
|
||||
@retval FALSE The P7Data was not correctly formatted for processing.
|
||||
|
||||
*/
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
Pkcs7GetAttachedContent (
|
||||
|
@ -7,7 +7,7 @@
|
||||
# buffer overflow or integer overflow.
|
||||
#
|
||||
# Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions,
|
||||
# HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, TDES/ARC4 functions, RSA external
|
||||
# HMAC-MD5 functions, HMAC-SHA1 functions, TDES/ARC4 functions, RSA external
|
||||
# functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and
|
||||
# authenticode signature verification functions are not supported in this instance.
|
||||
#
|
||||
@ -46,7 +46,7 @@
|
||||
Hash/CryptSha512Null.c
|
||||
Hmac/CryptHmacMd5Null.c
|
||||
Hmac/CryptHmacSha1Null.c
|
||||
Hmac/CryptHmacSha256Null.c
|
||||
Hmac/CryptHmacSha256.c
|
||||
Cipher/CryptAes.c
|
||||
Cipher/CryptTdesNull.c
|
||||
Cipher/CryptArc4Null.c
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
This file contains all helper functions on the ATAPI command
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -1053,7 +1053,7 @@ AtapiReadCapacity (
|
||||
if (!EFI_ERROR (Status) && *SResult == SenseNoSenseKey) {
|
||||
if (IdeDev->Type == IdeCdRom) {
|
||||
|
||||
IdeDev->BlkIo.Media->LastBlock = (Data.LastLba3 << 24) |
|
||||
IdeDev->BlkIo.Media->LastBlock = ((UINT32) Data.LastLba3 << 24) |
|
||||
(Data.LastLba2 << 16) |
|
||||
(Data.LastLba1 << 8) |
|
||||
Data.LastLba0;
|
||||
@ -1076,7 +1076,7 @@ AtapiReadCapacity (
|
||||
IdeDev->BlkIo.Media->LastBlock = 0;
|
||||
} else {
|
||||
|
||||
IdeDev->BlkIo.Media->LastBlock = (FormatData.LastLba3 << 24) |
|
||||
IdeDev->BlkIo.Media->LastBlock = ((UINT32) FormatData.LastLba3 << 24) |
|
||||
(FormatData.LastLba2 << 16) |
|
||||
(FormatData.LastLba1 << 8) |
|
||||
FormatData.LastLba0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
Mde UEFI library API implementation.
|
||||
Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE
|
||||
|
||||
Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -474,7 +474,14 @@ InternalPrintGraphic (
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
ASSERT (UgaDraw!= NULL);
|
||||
|
||||
Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
||||
//
|
||||
// Ensure Width * Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow.
|
||||
//
|
||||
if (Blt->Width > DivU64x32 (MAX_UINTN, Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL))) {
|
||||
goto Error;
|
||||
}
|
||||
|
||||
Blt->Image.Bitmap = AllocateZeroPool ((UINT32) Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
|
||||
ASSERT (Blt->Image.Bitmap != NULL);
|
||||
|
||||
//
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The application to show the Boot Manager Menu.
|
||||
|
||||
Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -374,6 +374,7 @@ BootMenuSelectItem (
|
||||
if (BootMenuData == NULL || WantSelectItem >= BootMenuData->ItemCount) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
ASSERT (BootMenuData->ItemCount != 0);
|
||||
SavedAttribute = gST->ConOut->Mode->Attribute;
|
||||
RePaintItems = FALSE;
|
||||
StartCol = BootMenuData->MenuScreen.StartCol;
|
||||
|
@ -18,22 +18,14 @@
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/PrintLib.h>
|
||||
#include <Protocol/LoadedImage.h>
|
||||
#include <Protocol/SimpleFileSystem.h>
|
||||
#include <Protocol/ShellParameters.h>
|
||||
#include <Protocol/Shell.h>
|
||||
#include <Guid/FileInfo.h>
|
||||
#include <Guid/Gpt.h>
|
||||
|
||||
#define IS_HYPHEN(a) ((a) == L'-')
|
||||
#define IS_NULL(a) ((a) == L'\0')
|
||||
|
||||
#define MAX_ARG_NUM 11
|
||||
|
||||
UINTN Argc;
|
||||
CHAR16 **Argv;
|
||||
EFI_SHELL_PROTOCOL *mShellProtocol = NULL;
|
||||
|
||||
/**
|
||||
|
||||
@ -64,273 +56,29 @@ GetArg (
|
||||
}
|
||||
|
||||
/**
|
||||
Return File System Volume containing this shell application.
|
||||
Get shell protocol.
|
||||
|
||||
@return File System Volume containing this shell application.
|
||||
@return Pointer to shell protocol.
|
||||
**/
|
||||
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *
|
||||
GetMyVol (
|
||||
EFI_SHELL_PROTOCOL *
|
||||
GetShellProtocol (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
|
||||
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Vol;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
gImageHandle,
|
||||
&gEfiLoadedImageProtocolGuid,
|
||||
(VOID **)&LoadedImage
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
LoadedImage->DeviceHandle,
|
||||
&gEfiSimpleFileSystemProtocolGuid,
|
||||
(VOID **)&Vol
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return Vol;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
Read a file from this volume.
|
||||
|
||||
@param[in] Vol File System Volume
|
||||
@param[in] FileName The file to be read.
|
||||
@param[out] BufferSize The file buffer size
|
||||
@param[out] Buffer The file buffer
|
||||
|
||||
@retval EFI_SUCCESS Read file successfully
|
||||
@retval EFI_NOT_FOUND File not found
|
||||
**/
|
||||
EFI_STATUS
|
||||
ReadFileFromVol (
|
||||
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Vol,
|
||||
IN CHAR16 *FileName,
|
||||
OUT UINTN *BufferSize,
|
||||
OUT VOID **Buffer
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_FILE_HANDLE RootDir;
|
||||
EFI_FILE_HANDLE Handle;
|
||||
UINTN FileInfoSize;
|
||||
EFI_FILE_INFO *FileInfo;
|
||||
UINTN TempBufferSize;
|
||||
VOID *TempBuffer;
|
||||
|
||||
//
|
||||
// Open the root directory
|
||||
//
|
||||
Status = Vol->OpenVolume (Vol, &RootDir);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Open the file
|
||||
//
|
||||
Status = RootDir->Open (
|
||||
RootDir,
|
||||
&Handle,
|
||||
FileName,
|
||||
EFI_FILE_MODE_READ,
|
||||
0
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
RootDir->Close (RootDir);
|
||||
return Status;
|
||||
}
|
||||
|
||||
RootDir->Close (RootDir);
|
||||
|
||||
//
|
||||
// Get the file information
|
||||
//
|
||||
FileInfoSize = sizeof(EFI_FILE_INFO) + 1024;
|
||||
|
||||
FileInfo = AllocateZeroPool (FileInfoSize);
|
||||
if (FileInfo == NULL) {
|
||||
Handle->Close (Handle);
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = Handle->GetInfo (
|
||||
Handle,
|
||||
&gEfiFileInfoGuid,
|
||||
&FileInfoSize,
|
||||
FileInfo
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
Handle->Close (Handle);
|
||||
gBS->FreePool (FileInfo);
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Allocate buffer for the file data. The last CHAR16 is for L'\0'
|
||||
//
|
||||
TempBufferSize = (UINTN) FileInfo->FileSize + sizeof(CHAR16);
|
||||
TempBuffer = AllocateZeroPool (TempBufferSize);
|
||||
if (TempBuffer == NULL) {
|
||||
Handle->Close (Handle);
|
||||
gBS->FreePool (FileInfo);
|
||||
return Status;
|
||||
}
|
||||
|
||||
gBS->FreePool (FileInfo);
|
||||
|
||||
//
|
||||
// Read the file data to the buffer
|
||||
//
|
||||
Status = Handle->Read (
|
||||
Handle,
|
||||
&TempBufferSize,
|
||||
TempBuffer
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
Handle->Close (Handle);
|
||||
gBS->FreePool (TempBuffer);
|
||||
return Status;
|
||||
}
|
||||
|
||||
Handle->Close (Handle);
|
||||
|
||||
*BufferSize = TempBufferSize;
|
||||
*Buffer = TempBuffer;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Read a file.
|
||||
If ScanFs is FLASE, it will use this Vol as default Fs.
|
||||
If ScanFs is TRUE, it will scan all FS and check the file.
|
||||
If there is only one file match the name, it will be read.
|
||||
If there is more than one file match the name, it will return Error.
|
||||
|
||||
@param[in,out] ThisVol File System Volume
|
||||
@param[in] FileName The file to be read.
|
||||
@param[out] BufferSize The file buffer size
|
||||
@param[out] Buffer The file buffer
|
||||
@param[in] ScanFs Need Scan all FS
|
||||
|
||||
@retval EFI_SUCCESS Read file successfully
|
||||
@retval EFI_NOT_FOUND File not found
|
||||
@retval EFI_NO_MAPPING There is duplicated files found
|
||||
**/
|
||||
EFI_STATUS
|
||||
ReadFileToBufferEx (
|
||||
IN OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **ThisVol,
|
||||
IN CHAR16 *FileName,
|
||||
OUT UINTN *BufferSize,
|
||||
OUT VOID **Buffer,
|
||||
IN BOOLEAN ScanFs
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Vol;
|
||||
UINTN TempBufferSize;
|
||||
VOID *TempBuffer;
|
||||
UINTN NoHandles;
|
||||
EFI_HANDLE *HandleBuffer;
|
||||
UINTN Index;
|
||||
|
||||
//
|
||||
// Check parameters
|
||||
//
|
||||
if ((FileName == NULL) || (Buffer == NULL) || (ThisVol == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// not scan fs
|
||||
//
|
||||
if (!ScanFs) {
|
||||
if (*ThisVol == NULL) {
|
||||
*ThisVol = GetMyVol ();
|
||||
if (*ThisVol == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Read file directly from Vol
|
||||
//
|
||||
return ReadFileFromVol (*ThisVol, FileName, BufferSize, Buffer);
|
||||
}
|
||||
|
||||
//
|
||||
// need scan fs
|
||||
//
|
||||
|
||||
//
|
||||
// Get all Vol handle
|
||||
//
|
||||
Status = gBS->LocateHandleBuffer (
|
||||
ByProtocol,
|
||||
&gEfiSimpleFileSystemProtocolGuid,
|
||||
NULL,
|
||||
&NoHandles,
|
||||
&HandleBuffer
|
||||
);
|
||||
if (EFI_ERROR (Status) && (NoHandles == 0)) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
//
|
||||
// Walk through each Vol
|
||||
//
|
||||
*ThisVol = NULL;
|
||||
*BufferSize = 0;
|
||||
*Buffer = NULL;
|
||||
for (Index = 0; Index < NoHandles; Index++) {
|
||||
Status = gBS->HandleProtocol (
|
||||
HandleBuffer[Index],
|
||||
&gEfiSimpleFileSystemProtocolGuid,
|
||||
(VOID **)&Vol
|
||||
if (mShellProtocol == NULL) {
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiShellProtocolGuid,
|
||||
NULL,
|
||||
(VOID **) &mShellProtocol
|
||||
);
|
||||
if (EFI_ERROR(Status)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Status = ReadFileFromVol (Vol, FileName, &TempBufferSize, &TempBuffer);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Read file OK, check duplication
|
||||
//
|
||||
if (*ThisVol != NULL) {
|
||||
//
|
||||
// Find the duplicated file
|
||||
//
|
||||
gBS->FreePool (TempBuffer);
|
||||
gBS->FreePool (*Buffer);
|
||||
Print (L"Duplicated FileName found!\n");
|
||||
return EFI_NO_MAPPING;
|
||||
} else {
|
||||
//
|
||||
// Record value
|
||||
//
|
||||
*ThisVol = Vol;
|
||||
*BufferSize = TempBufferSize;
|
||||
*Buffer = TempBuffer;
|
||||
}
|
||||
if (EFI_ERROR (Status)) {
|
||||
mShellProtocol = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Scan Fs done
|
||||
//
|
||||
if (*ThisVol == NULL) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
//
|
||||
// Done
|
||||
//
|
||||
return EFI_SUCCESS;
|
||||
return mShellProtocol;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -341,7 +89,8 @@ ReadFileToBufferEx (
|
||||
@param[out] Buffer The file buffer
|
||||
|
||||
@retval EFI_SUCCESS Read file successfully
|
||||
@retval EFI_NOT_FOUND File not found
|
||||
@retval EFI_NOT_FOUND Shell protocol or file not found
|
||||
@retval others Read file failed
|
||||
**/
|
||||
EFI_STATUS
|
||||
ReadFileToBuffer (
|
||||
@ -350,9 +99,64 @@ ReadFileToBuffer (
|
||||
OUT VOID **Buffer
|
||||
)
|
||||
{
|
||||
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Vol;
|
||||
Vol = NULL;
|
||||
return ReadFileToBufferEx(&Vol, FileName, BufferSize, Buffer, FALSE);
|
||||
EFI_STATUS Status;
|
||||
EFI_SHELL_PROTOCOL *ShellProtocol;
|
||||
SHELL_FILE_HANDLE Handle;
|
||||
UINT64 FileSize;
|
||||
UINTN TempBufferSize;
|
||||
VOID *TempBuffer;
|
||||
|
||||
ShellProtocol = GetShellProtocol();
|
||||
if (ShellProtocol == NULL) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
//
|
||||
// Open file by FileName.
|
||||
//
|
||||
Status = ShellProtocol->OpenFileByName (
|
||||
FileName,
|
||||
&Handle,
|
||||
EFI_FILE_MODE_READ
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Get the file size.
|
||||
//
|
||||
Status = ShellProtocol->GetFileSize (Handle, &FileSize);
|
||||
if (EFI_ERROR (Status)) {
|
||||
ShellProtocol->CloseFile (Handle);
|
||||
return Status;
|
||||
}
|
||||
|
||||
TempBufferSize = (UINTN) FileSize;
|
||||
TempBuffer = AllocateZeroPool (TempBufferSize);
|
||||
if (TempBuffer == NULL) {
|
||||
ShellProtocol->CloseFile (Handle);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// Read the file data to the buffer
|
||||
//
|
||||
Status = ShellProtocol->ReadFile (
|
||||
Handle,
|
||||
&TempBufferSize,
|
||||
TempBuffer
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
ShellProtocol->CloseFile (Handle);
|
||||
return Status;
|
||||
}
|
||||
|
||||
ShellProtocol->CloseFile (Handle);
|
||||
|
||||
*BufferSize = TempBufferSize;
|
||||
*Buffer = TempBuffer;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -363,6 +167,8 @@ ReadFileToBuffer (
|
||||
@param[in] Buffer The file buffer
|
||||
|
||||
@retval EFI_SUCCESS Write file successfully
|
||||
@retval EFI_NOT_FOUND Shell protocol not found
|
||||
@retval others Write file failed
|
||||
**/
|
||||
EFI_STATUS
|
||||
WriteFileFromBuffer (
|
||||
@ -372,79 +178,69 @@ WriteFileFromBuffer (
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_FILE_HANDLE RootDir;
|
||||
EFI_FILE_HANDLE Handle;
|
||||
EFI_SHELL_PROTOCOL *ShellProtocol;
|
||||
SHELL_FILE_HANDLE Handle;
|
||||
EFI_FILE_INFO *FileInfo;
|
||||
UINTN TempBufferSize;
|
||||
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Vol;
|
||||
|
||||
Vol = GetMyVol();
|
||||
if (Vol == NULL) {
|
||||
ShellProtocol = GetShellProtocol();
|
||||
if (ShellProtocol == NULL) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
//
|
||||
// Open the root directory
|
||||
// Open file by FileName.
|
||||
//
|
||||
Status = Vol->OpenVolume (Vol, &RootDir);
|
||||
Status = ShellProtocol->OpenFileByName (
|
||||
FileName,
|
||||
&Handle,
|
||||
EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Open the file
|
||||
// Empty the file contents.
|
||||
//
|
||||
Status = RootDir->Open (
|
||||
RootDir,
|
||||
&Handle,
|
||||
FileName,
|
||||
EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE| EFI_FILE_MODE_CREATE,
|
||||
0
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
RootDir->Close (RootDir);
|
||||
return Status;
|
||||
FileInfo = ShellProtocol->GetFileInfo (Handle);
|
||||
if (FileInfo == NULL) {
|
||||
ShellProtocol->CloseFile (Handle);
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// Delete file
|
||||
// If the file size is already 0, then it has been empty.
|
||||
//
|
||||
Status = Handle->Delete(Handle);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return Status;
|
||||
if (FileInfo->FileSize != 0) {
|
||||
//
|
||||
// Set the file size to 0.
|
||||
//
|
||||
FileInfo->FileSize = 0;
|
||||
Status = ShellProtocol->SetFileInfo (Handle, FileInfo);
|
||||
if (EFI_ERROR (Status)) {
|
||||
FreePool (FileInfo);
|
||||
ShellProtocol->CloseFile (Handle);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Open the file again
|
||||
//
|
||||
Status = RootDir->Open (
|
||||
RootDir,
|
||||
&Handle,
|
||||
FileName,
|
||||
EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE| EFI_FILE_MODE_CREATE,
|
||||
0
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
RootDir->Close (RootDir);
|
||||
return Status;
|
||||
}
|
||||
|
||||
RootDir->Close (RootDir);
|
||||
FreePool (FileInfo);
|
||||
|
||||
//
|
||||
// Write the file data from the buffer
|
||||
//
|
||||
TempBufferSize = BufferSize;
|
||||
Status = Handle->Write (
|
||||
Handle,
|
||||
&TempBufferSize,
|
||||
Buffer
|
||||
);
|
||||
Status = ShellProtocol->WriteFile (
|
||||
Handle,
|
||||
&TempBufferSize,
|
||||
Buffer
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
Handle->Close (Handle);
|
||||
ShellProtocol->CloseFile (Handle);
|
||||
return Status;
|
||||
}
|
||||
|
||||
Handle->Close (Handle);
|
||||
ShellProtocol->CloseFile (Handle);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@ -21,11 +21,7 @@
|
||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/PrintLib.h>
|
||||
#include <Protocol/LoadedImage.h>
|
||||
#include <Protocol/SimpleFileSystem.h>
|
||||
#include <Protocol/GraphicsOutput.h>
|
||||
#include <Guid/FileInfo.h>
|
||||
#include <Guid/Gpt.h>
|
||||
#include <Guid/GlobalVariable.h>
|
||||
#include <Guid/CapsuleReport.h>
|
||||
#include <Guid/SystemResourceTable.h>
|
||||
@ -117,7 +113,8 @@ DumpEsrtData (
|
||||
@param[out] Buffer The file buffer
|
||||
|
||||
@retval EFI_SUCCESS Read file successfully
|
||||
@retval EFI_NOT_FOUND File not found
|
||||
@retval EFI_NOT_FOUND Shell protocol or file not found
|
||||
@retval others Read file failed
|
||||
**/
|
||||
EFI_STATUS
|
||||
ReadFileToBuffer (
|
||||
@ -134,6 +131,8 @@ ReadFileToBuffer (
|
||||
@param[in] Buffer The file buffer
|
||||
|
||||
@retval EFI_SUCCESS Write file successfully
|
||||
@retval EFI_NOT_FOUND Shell protocol not found
|
||||
@retval others Write file failed
|
||||
**/
|
||||
EFI_STATUS
|
||||
WriteFileFromBuffer (
|
||||
|
@ -4,7 +4,7 @@
|
||||
# This application can trigger capsule update process. It can also
|
||||
# generate capsule image, or dump capsule variable information.
|
||||
#
|
||||
# Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -40,8 +40,6 @@
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
[Guids]
|
||||
gEfiFileInfoGuid ## CONSUMES ## GUID
|
||||
gEfiPartTypeSystemPartGuid ## CONSUMES ## GUID
|
||||
gEfiGlobalVariableGuid ## CONSUMES ## GUID
|
||||
gEfiCapsuleReportGuid ## CONSUMES ## GUID
|
||||
gEfiFmpCapsuleGuid ## CONSUMES ## GUID
|
||||
@ -51,11 +49,10 @@
|
||||
gEfiSystemResourceTableGuid ## CONSUMES ## GUID
|
||||
|
||||
[Protocols]
|
||||
gEfiLoadedImageProtocolGuid ## CONSUMES
|
||||
gEfiSimpleFileSystemProtocolGuid ## CONSUMES
|
||||
gEfiGraphicsOutputProtocolGuid ## CONSUMES
|
||||
gEfiFirmwareManagementProtocolGuid ## CONSUMES
|
||||
gEfiShellParametersProtocolGuid ## CONSUMES
|
||||
gEfiShellProtocolGuid ## CONSUMES
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
||||
|
@ -266,8 +266,8 @@ GetDriverNameString (
|
||||
//
|
||||
// Method 1: Get the name string from image PDB
|
||||
//
|
||||
if (ImageStruct->Header.Length > sizeof (SMM_CORE_IMAGE_DATABASE_STRUCTURE)) {
|
||||
GetShortPdbFileName ((CHAR8 *) (ImageStruct + 1), mNameString);
|
||||
if (ImageStruct->PdbStringOffset != 0) {
|
||||
GetShortPdbFileName ((CHAR8 *) ((UINTN) ImageStruct + ImageStruct->PdbStringOffset), mNameString);
|
||||
return mNameString;
|
||||
}
|
||||
|
||||
@ -348,15 +348,17 @@ DumpSmmLoadedImage(
|
||||
if (ImageStruct->Header.Signature == SMM_CORE_IMAGE_DATABASE_SIGNATURE) {
|
||||
NameString = GetDriverNameString (ImageStruct);
|
||||
Print(L" <Image Name=\"%a\"", NameString);
|
||||
Print(L" Base=\"0x%x\" Size=\"0x%x\"", ImageStruct->ImageBase, ImageStruct->ImageSize);
|
||||
Print(L" Base=\"0x%lx\" Size=\"0x%lx\"", ImageStruct->ImageBase, ImageStruct->ImageSize);
|
||||
if (ImageStruct->EntryPoint != 0) {
|
||||
Print(L" EntryPoint=\"0x%x\"", ImageStruct->EntryPoint);
|
||||
Print(L" EntryPoint=\"0x%lx\"", ImageStruct->EntryPoint);
|
||||
}
|
||||
Print(L" FvFile=\"%g\"", &ImageStruct->FileGuid);
|
||||
Print(L" RefId=\"0x%x\"", ImageStruct->ImageRef);
|
||||
Print(L">\n");
|
||||
PdbString = (CHAR8 *)((UINTN)ImageStruct + ImageStruct->PdbStringOffset);
|
||||
Print(L" <Pdb>%a</Pdb>\n", PdbString);
|
||||
if (ImageStruct->PdbStringOffset != 0) {
|
||||
PdbString = (CHAR8 *)((UINTN)ImageStruct + ImageStruct->PdbStringOffset);
|
||||
Print(L" <Pdb>%a</Pdb>\n", PdbString);
|
||||
}
|
||||
Print(L" </Image>\n");
|
||||
}
|
||||
|
||||
@ -535,8 +537,10 @@ DumpSmiChildContext (
|
||||
IN UINTN ContextSize
|
||||
)
|
||||
{
|
||||
CHAR16 *Str;
|
||||
|
||||
if (CompareGuid (HandlerType, &gEfiSmmSwDispatch2ProtocolGuid)) {
|
||||
Print(L" SwSmi=\"0x%x\"", ((EFI_SMM_SW_REGISTER_CONTEXT *)Context)->SwSmiInputValue);
|
||||
Print(L" SwSmi=\"0x%lx\"", ((SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT *)Context)->SwSmiInputValue);
|
||||
} else if (CompareGuid (HandlerType, &gEfiSmmSxDispatch2ProtocolGuid)) {
|
||||
Print(L" SxType=\"%a\"", SxTypeToString(((EFI_SMM_SX_REGISTER_CONTEXT *)Context)->Type));
|
||||
Print(L" SxPhase=\"%a\"", SxPhaseToString(((EFI_SMM_SX_REGISTER_CONTEXT *)Context)->Phase));
|
||||
@ -555,7 +559,11 @@ DumpSmiChildContext (
|
||||
Print(L" IoTrapType=\"%a\"", IoTrapTypeToString(((EFI_SMM_IO_TRAP_REGISTER_CONTEXT *)Context)->Type));
|
||||
} else if (CompareGuid (HandlerType, &gEfiSmmUsbDispatch2ProtocolGuid)) {
|
||||
Print(L" UsbType=\"0x%x\"", UsbTypeToString(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT *)Context)->Type));
|
||||
Print(L" UsbDevicePath=\"%s\"", ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL *)(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT *)Context) + 1), TRUE, TRUE));
|
||||
Str = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL *)(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT *)Context) + 1), TRUE, TRUE);
|
||||
Print(L" UsbDevicePath=\"%s\"", Str);
|
||||
if (Str != NULL) {
|
||||
FreePool (Str);
|
||||
}
|
||||
} else {
|
||||
Print(L" Context=\"");
|
||||
InternalDumpData (Context, ContextSize);
|
||||
@ -601,14 +609,14 @@ DumpSmiHandler(
|
||||
Print(L" <Pdb>%a</Pdb>\n", (UINT8 *)ImageStruct + ImageStruct->PdbStringOffset);
|
||||
}
|
||||
Print(L" </Module>\n");
|
||||
Print(L" <Handler Address=\"0x%x\">\n", SmiHandlerStruct->Handler);
|
||||
Print(L" <Handler Address=\"0x%lx\">\n", SmiHandlerStruct->Handler);
|
||||
if (ImageStruct != NULL) {
|
||||
Print(L" <RVA>0x%x</RVA>\n", SmiHandlerStruct->Handler - ImageStruct->ImageBase);
|
||||
Print(L" <RVA>0x%x</RVA>\n", (UINTN) (SmiHandlerStruct->Handler - ImageStruct->ImageBase));
|
||||
}
|
||||
Print(L" </Handler>\n", SmiHandlerStruct->Handler);
|
||||
Print(L" <Caller Address=\"0x%x\">\n", SmiHandlerStruct->CallerAddr);
|
||||
Print(L" <Caller Address=\"0x%lx\">\n", SmiHandlerStruct->CallerAddr);
|
||||
if (ImageStruct != NULL) {
|
||||
Print(L" <RVA>0x%x</RVA>\n", SmiHandlerStruct->CallerAddr - ImageStruct->ImageBase);
|
||||
Print(L" <RVA>0x%x</RVA>\n", (UINTN) (SmiHandlerStruct->CallerAddr - ImageStruct->ImageBase));
|
||||
}
|
||||
Print(L" </Caller>\n", SmiHandlerStruct->Handler);
|
||||
SmiHandlerStruct = (VOID *)((UINTN)SmiHandlerStruct + SmiHandlerStruct->Length);
|
||||
|
@ -2140,7 +2140,7 @@ ReadCapacity (
|
||||
|
||||
if (MediaInfo->DeviceType == IdeCDROM) {
|
||||
|
||||
MediaInfo->LastBlock = (Data.LastLba3 << 24) | (Data.LastLba2 << 16) | (Data.LastLba1 << 8) | Data.LastLba0;
|
||||
MediaInfo->LastBlock = ((UINT32) Data.LastLba3 << 24) | (Data.LastLba2 << 16) | (Data.LastLba1 << 8) | Data.LastLba0;
|
||||
MediaInfo->MediaPresent = TRUE;
|
||||
//
|
||||
// Because the user data portion in the sector of the Data CD supported
|
||||
@ -2161,7 +2161,7 @@ ReadCapacity (
|
||||
MediaInfo2->MediaPresent = FALSE;
|
||||
MediaInfo2->LastBlock = 0;
|
||||
} else {
|
||||
MediaInfo->LastBlock = (FormatData.LastLba3 << 24) |
|
||||
MediaInfo->LastBlock = ((UINT32) FormatData.LastLba3 << 24) |
|
||||
(FormatData.LastLba2 << 16) |
|
||||
(FormatData.LastLba1 << 8) |
|
||||
FormatData.LastLba0;
|
||||
|
@ -603,7 +603,7 @@ NvmExpressPassThru (
|
||||
Private->SqTdbl[QueueId].Sqt ^= 1;
|
||||
}
|
||||
Data = ReadUnaligned32 ((UINT32*)&Private->SqTdbl[QueueId]);
|
||||
PciIo->Mem.Write (
|
||||
Status = PciIo->Mem.Write (
|
||||
PciIo,
|
||||
EfiPciIoWidthUint32,
|
||||
NVME_BAR,
|
||||
@ -612,6 +612,10 @@ NvmExpressPassThru (
|
||||
&Data
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
//
|
||||
// For non-blocking requests, return directly if the command is placed
|
||||
// in the submission queue.
|
||||
@ -695,7 +699,7 @@ NvmExpressPassThru (
|
||||
}
|
||||
|
||||
Data = ReadUnaligned32 ((UINT32*)&Private->CqHdbl[QueueId]);
|
||||
PciIo->Mem.Write (
|
||||
Status = PciIo->Mem.Write (
|
||||
PciIo,
|
||||
EfiPciIoWidthUint32,
|
||||
NVME_BAR,
|
||||
|
@ -2,7 +2,7 @@
|
||||
UfsHcDxe driver is used to provide platform-dependent info, mainly UFS host controller
|
||||
MMIO base, to upper layer UFS drivers.
|
||||
|
||||
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -32,7 +32,6 @@ EFI_DRIVER_BINDING_PROTOCOL gUfsHcDriverBinding = {
|
||||
//
|
||||
UFS_HOST_CONTROLLER_PRIVATE_DATA gUfsHcTemplate = {
|
||||
UFS_HC_PRIVATE_DATA_SIGNATURE, // Signature
|
||||
NULL, // Handle
|
||||
{ // UfsHcProtocol
|
||||
UfsHcGetMmioBar,
|
||||
UfsHcAllocateBuffer,
|
||||
@ -672,13 +671,12 @@ Done:
|
||||
//
|
||||
// Restore original PCI attributes
|
||||
//
|
||||
Status = PciIo->Attributes (
|
||||
PciIo,
|
||||
EfiPciIoAttributeOperationSet,
|
||||
Private->PciAttributes,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
PciIo->Attributes (
|
||||
PciIo,
|
||||
EfiPciIoAttributeOperationSet,
|
||||
Private->PciAttributes,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
|
@ -2,7 +2,7 @@
|
||||
UfsHcDxe driver is used to provide platform-dependent info, mainly UFS host controller
|
||||
MMIO base, to upper layer UFS drivers.
|
||||
|
||||
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -49,11 +49,10 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gUfsHcComponentName2;
|
||||
typedef struct _UFS_HOST_CONTROLLER_PRIVATE_DATA UFS_HOST_CONTROLLER_PRIVATE_DATA;
|
||||
|
||||
//
|
||||
// Nvme private data structure.
|
||||
// Ufs host controller private data structure.
|
||||
//
|
||||
struct _UFS_HOST_CONTROLLER_PRIVATE_DATA {
|
||||
UINT32 Signature;
|
||||
EFI_HANDLE Handle;
|
||||
|
||||
EDKII_UFS_HOST_CONTROLLER_PROTOCOL UfsHc;
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
|
@ -1319,6 +1319,7 @@ XhciDelAsyncIntTransfer (
|
||||
LIST_ENTRY *Next;
|
||||
URB *Urb;
|
||||
EFI_USB_DATA_DIRECTION Direction;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Direction = ((EpNum & 0x80) != 0) ? EfiUsbDataIn : EfiUsbDataOut;
|
||||
EpNum &= 0x0F;
|
||||
@ -1330,6 +1331,15 @@ XhciDelAsyncIntTransfer (
|
||||
if ((Urb->Ep.BusAddr == BusAddr) &&
|
||||
(Urb->Ep.EpAddr == EpNum) &&
|
||||
(Urb->Ep.Direction == Direction)) {
|
||||
//
|
||||
// Device doesn't finish the IntTransfer until real data comes
|
||||
// So the TRB should be removed as well.
|
||||
//
|
||||
Status = XhcDequeueTrbFromEndpoint (Xhc, Urb);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "XhciDelAsyncIntTransfer: XhcDequeueTrbFromEndpoint failed\n"));
|
||||
}
|
||||
|
||||
RemoveEntryList (&Urb->UrbList);
|
||||
FreePool (Urb->Data);
|
||||
XhcFreeUrb (Xhc, Urb);
|
||||
@ -1354,9 +1364,20 @@ XhciDelAllAsyncIntTransfers (
|
||||
LIST_ENTRY *Entry;
|
||||
LIST_ENTRY *Next;
|
||||
URB *Urb;
|
||||
EFI_STATUS Status;
|
||||
|
||||
EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Xhc->AsyncIntTransfers) {
|
||||
Urb = EFI_LIST_CONTAINER (Entry, URB, UrbList);
|
||||
|
||||
//
|
||||
// Device doesn't finish the IntTransfer until real data comes
|
||||
// So the TRB should be removed as well.
|
||||
//
|
||||
Status = XhcDequeueTrbFromEndpoint (Xhc, Urb);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "XhciDelAllAsyncIntTransfers: XhcDequeueTrbFromEndpoint failed\n"));
|
||||
}
|
||||
|
||||
RemoveEntryList (&Urb->UrbList);
|
||||
FreePool (Urb->Data);
|
||||
XhcFreeUrb (Xhc, Urb);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
SCSI disk driver that layers on every SCSI IO protocol in the system.
|
||||
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -2754,7 +2754,7 @@ GetMediaInfo (
|
||||
UINT8 *Ptr;
|
||||
|
||||
if (!ScsiDiskDevice->Cdb16Byte) {
|
||||
ScsiDiskDevice->BlkIo.Media->LastBlock = (Capacity10->LastLba3 << 24) |
|
||||
ScsiDiskDevice->BlkIo.Media->LastBlock = ((UINT32) Capacity10->LastLba3 << 24) |
|
||||
(Capacity10->LastLba2 << 16) |
|
||||
(Capacity10->LastLba1 << 8) |
|
||||
Capacity10->LastLba0;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -737,11 +737,11 @@ UfsBlockIoPeimGetMediaInfo (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
Private->Media[DeviceIndex].LastBlock = (Capacity16.LastLba3 << 24) | (Capacity16.LastLba2 << 16) | (Capacity16.LastLba1 << 8) | Capacity16.LastLba0;
|
||||
Private->Media[DeviceIndex].LastBlock = ((UINT32)Capacity16.LastLba3 << 24) | (Capacity16.LastLba2 << 16) | (Capacity16.LastLba1 << 8) | Capacity16.LastLba0;
|
||||
Private->Media[DeviceIndex].LastBlock |= LShiftU64 ((UINT64)Capacity16.LastLba7, 56) | LShiftU64((UINT64)Capacity16.LastLba6, 48) | LShiftU64 ((UINT64)Capacity16.LastLba5, 40) | LShiftU64 ((UINT64)Capacity16.LastLba4, 32);
|
||||
Private->Media[DeviceIndex].BlockSize = (Capacity16.BlockSize3 << 24) | (Capacity16.BlockSize2 << 16) | (Capacity16.BlockSize1 << 8) | Capacity16.BlockSize0;
|
||||
} else {
|
||||
Private->Media[DeviceIndex].LastBlock = (Capacity.LastLba3 << 24) | (Capacity.LastLba2 << 16) | (Capacity.LastLba1 << 8) | Capacity.LastLba0;
|
||||
Private->Media[DeviceIndex].LastBlock = ((UINT32)Capacity.LastLba3 << 24) | (Capacity.LastLba2 << 16) | (Capacity.LastLba1 << 8) | Capacity.LastLba0;
|
||||
Private->Media[DeviceIndex].BlockSize = (Capacity.BlockSize3 << 24) | (Capacity.BlockSize2 << 16) | (Capacity.BlockSize1 << 8) | Capacity.BlockSize0;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -479,10 +479,10 @@ UfsPassThruGetTargetLun (
|
||||
}
|
||||
|
||||
//
|
||||
// Check whether the DevicePath belongs to SCSI_DEVICE_PATH
|
||||
// Check whether the DevicePath belongs to UFS_DEVICE_PATH
|
||||
//
|
||||
if ((DevicePath->Type != MESSAGING_DEVICE_PATH) || (DevicePath->SubType != MSG_UFS_DP) ||
|
||||
(DevicePathNodeLength(DevicePath) != sizeof(SCSI_DEVICE_PATH))) {
|
||||
(DevicePathNodeLength(DevicePath) != sizeof(UFS_DEVICE_PATH))) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
@ -729,6 +729,48 @@ UfsPassThruDriverBindingSupported (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Finishes device initialization by setting fDeviceInit flag and waiting untill device responds by
|
||||
clearing it.
|
||||
|
||||
@param[in] Private Pointer to the UFS_PASS_THRU_PRIVATE_DATA.
|
||||
|
||||
@retval EFI_SUCCESS The operation succeeds.
|
||||
@retval Others The operation fails.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UfsFinishDeviceInitialization (
|
||||
IN UFS_PASS_THRU_PRIVATE_DATA *Private
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 DeviceInitStatus;
|
||||
UINT8 Timeout;
|
||||
|
||||
DeviceInitStatus = 0xFF;
|
||||
|
||||
//
|
||||
// The host enables the device initialization completion by setting fDeviceInit flag.
|
||||
//
|
||||
Status = UfsSetFlag (Private, UfsFlagDevInit);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
Timeout = 5;
|
||||
do {
|
||||
Status = UfsReadFlag (Private, UfsFlagDevInit, &DeviceInitStatus);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
MicroSecondDelay (1);
|
||||
Timeout--;
|
||||
} while (DeviceInitStatus != 0 && Timeout != 0);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Starts a device controller or a bus controller.
|
||||
|
||||
@ -777,14 +819,14 @@ UfsPassThruDriverBindingStart (
|
||||
UFS_PASS_THRU_PRIVATE_DATA *Private;
|
||||
UINTN UfsHcBase;
|
||||
UINT32 Index;
|
||||
UFS_CONFIG_DESC Config;
|
||||
UFS_UNIT_DESC UnitDescriptor;
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
UfsHc = NULL;
|
||||
Private = NULL;
|
||||
UfsHcBase = 0;
|
||||
|
||||
DEBUG ((EFI_D_INFO, "==UfsPassThru Start== Controller = %x\n", Controller));
|
||||
DEBUG ((DEBUG_INFO, "==UfsPassThru Start== Controller = %x\n", Controller));
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
@ -796,7 +838,7 @@ UfsPassThruDriverBindingStart (
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Open Ufs Host Controller Protocol Error, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Open Ufs Host Controller Protocol Error, Status = %r\n", Status));
|
||||
goto Error;
|
||||
}
|
||||
|
||||
@ -805,7 +847,7 @@ UfsPassThruDriverBindingStart (
|
||||
//
|
||||
Status = UfsHc->GetUfsHcMmioBar (UfsHc, &UfsHcBase);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Get Ufs Host Controller Mmio Bar Error, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Get Ufs Host Controller Mmio Bar Error, Status = %r\n", Status));
|
||||
goto Error;
|
||||
}
|
||||
|
||||
@ -814,7 +856,7 @@ UfsPassThruDriverBindingStart (
|
||||
//
|
||||
Private = AllocateCopyPool (sizeof (UFS_PASS_THRU_PRIVATE_DATA), &gUfsPassThruTemplate);
|
||||
if (Private == NULL) {
|
||||
DEBUG ((EFI_D_ERROR, "Unable to allocate Ufs Pass Thru private data\n"));
|
||||
DEBUG ((DEBUG_ERROR, "Unable to allocate Ufs Pass Thru private data\n"));
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Error;
|
||||
}
|
||||
@ -829,7 +871,7 @@ UfsPassThruDriverBindingStart (
|
||||
//
|
||||
Status = UfsControllerInit (Private);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Ufs Host Controller Initialization Error, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Ufs Host Controller Initialization Error, Status = %r\n", Status));
|
||||
goto Error;
|
||||
}
|
||||
|
||||
@ -840,25 +882,13 @@ UfsPassThruDriverBindingStart (
|
||||
//
|
||||
Status = UfsExecNopCmds (Private);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Ufs Sending NOP IN command Error, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Status = %r\n", Status));
|
||||
goto Error;
|
||||
}
|
||||
|
||||
//
|
||||
// The host enables the device initialization completion by setting fDeviceInit flag.
|
||||
//
|
||||
Status = UfsSetFlag (Private, UfsFlagDevInit);
|
||||
Status = UfsFinishDeviceInitialization (Private);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Ufs Set fDeviceInit Flag Error, Status = %r\n", Status));
|
||||
goto Error;
|
||||
}
|
||||
|
||||
//
|
||||
// Get Ufs Device's Lun Info by reading Configuration Descriptor.
|
||||
//
|
||||
Status = UfsRwDeviceDesc (Private, TRUE, UfsConfigDesc, 0, 0, &Config, sizeof (UFS_CONFIG_DESC));
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Ufs Get Configuration Descriptor Error, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Device failed to finish initialization, Status = %r\n", Status));
|
||||
goto Error;
|
||||
}
|
||||
|
||||
@ -867,9 +897,14 @@ UfsPassThruDriverBindingStart (
|
||||
// TODO: Parse device descriptor to decide if exposing RPMB LUN to upper layer for authentication access.
|
||||
//
|
||||
for (Index = 0; Index < 8; Index++) {
|
||||
if (Config.UnitDescConfParams[Index].LunEn != 0) {
|
||||
Status = UfsRwDeviceDesc (Private, TRUE, UfsUnitDesc, (UINT8) Index, 0, &UnitDescriptor, sizeof (UFS_UNIT_DESC));
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "Failed to read unit descriptor, index = %X, status = %r\n", Index, Status));
|
||||
continue;
|
||||
}
|
||||
if (UnitDescriptor.LunEn == 0x1) {
|
||||
DEBUG ((DEBUG_INFO, "UFS LUN %X is enabled\n", Index));
|
||||
Private->Luns.BitMask |= (BIT0 << Index);
|
||||
DEBUG ((EFI_D_INFO, "Ufs Lun %d is enabled\n", Index));
|
||||
}
|
||||
}
|
||||
|
||||
@ -884,7 +919,7 @@ UfsPassThruDriverBindingStart (
|
||||
&Private->TimerEvent
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Ufs Create Async Tasks Event Error, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Ufs Create Async Tasks Event Error, Status = %r\n", Status));
|
||||
goto Error;
|
||||
}
|
||||
|
||||
@ -894,7 +929,7 @@ UfsPassThruDriverBindingStart (
|
||||
UFS_HC_ASYNC_TIMER
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Ufs Set Periodic Timer Error, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Ufs Set Periodic Timer Error, Status = %r\n", Status));
|
||||
goto Error;
|
||||
}
|
||||
|
||||
@ -986,7 +1021,7 @@ UfsPassThruDriverBindingStop (
|
||||
LIST_ENTRY *Entry;
|
||||
LIST_ENTRY *NextEntry;
|
||||
|
||||
DEBUG ((EFI_D_INFO, "==UfsPassThru Stop== Controller Controller = %x\n", Controller));
|
||||
DEBUG ((DEBUG_INFO, "==UfsPassThru Stop== Controller Controller = %x\n", Controller));
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
|
@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -122,16 +122,13 @@ typedef struct {
|
||||
|
||||
typedef struct _UFS_DEVICE_MANAGEMENT_REQUEST_PACKET {
|
||||
UINT64 Timeout;
|
||||
VOID *InDataBuffer;
|
||||
VOID *OutDataBuffer;
|
||||
VOID *DataBuffer;
|
||||
UINT8 Opcode;
|
||||
UINT8 DescId;
|
||||
UINT8 Index;
|
||||
UINT8 Selector;
|
||||
UINT32 InTransferLength;
|
||||
UINT32 OutTransferLength;
|
||||
UINT32 TransferLength;
|
||||
UINT8 DataDirection;
|
||||
UINT8 Ocs;
|
||||
} UFS_DEVICE_MANAGEMENT_REQUEST_PACKET;
|
||||
|
||||
//
|
||||
@ -716,6 +713,25 @@ UfsSetFlag (
|
||||
IN UINT8 FlagId
|
||||
);
|
||||
|
||||
/**
|
||||
Read specified flag from a UFS device.
|
||||
|
||||
@param[in] Private The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure.
|
||||
@param[in] FlagId The ID of flag to be read.
|
||||
@param[out] Value The flag's value.
|
||||
|
||||
@retval EFI_SUCCESS The flag was read successfully.
|
||||
@retval EFI_DEVICE_ERROR A device error occurred while attempting to read the flag.
|
||||
@retval EFI_TIMEOUT A timeout occurred while waiting for the completion of reading the flag.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UfsReadFlag (
|
||||
IN UFS_PASS_THRU_PRIVATE_DATA *Private,
|
||||
IN UINT8 FlagId,
|
||||
OUT UINT8 *Value
|
||||
);
|
||||
|
||||
/**
|
||||
Read or write specified device descriptor of a UFS device.
|
||||
|
||||
@ -743,6 +759,31 @@ UfsRwDeviceDesc (
|
||||
IN UINT32 DescSize
|
||||
);
|
||||
|
||||
/**
|
||||
Read or write specified attribute of a UFS device.
|
||||
|
||||
@param[in] Private The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure.
|
||||
@param[in] Read The boolean variable to show r/w direction.
|
||||
@param[in] AttrId The ID of Attribute.
|
||||
@param[in] Index The Index of Attribute.
|
||||
@param[in] Selector The Selector of Attribute.
|
||||
@param[in, out] Attributes The value of Attribute to be read or written.
|
||||
|
||||
@retval EFI_SUCCESS The Attribute was read/written successfully.
|
||||
@retval EFI_DEVICE_ERROR A device error occurred while attempting to r/w the Attribute.
|
||||
@retval EFI_TIMEOUT A timeout occurred while waiting for the completion of r/w the Attribute.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UfsRwAttributes (
|
||||
IN UFS_PASS_THRU_PRIVATE_DATA *Private,
|
||||
IN BOOLEAN Read,
|
||||
IN UINT8 AttrId,
|
||||
IN UINT8 Index,
|
||||
IN UINT8 Selector,
|
||||
IN OUT UINT32 *Attributes
|
||||
);
|
||||
|
||||
/**
|
||||
Sends NOP IN cmd to a UFS device for initialization process request.
|
||||
For more details, please refer to UFS 2.0 spec Figure 13.3.
|
||||
|
@ -157,34 +157,34 @@ DumpUicCmdExecResult (
|
||||
case 0x00:
|
||||
break;
|
||||
case 0x01:
|
||||
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - INVALID_MIB_ATTRIBUTE\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - INVALID_MIB_ATTRIBUTE\n"));
|
||||
break;
|
||||
case 0x02:
|
||||
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - INVALID_MIB_ATTRIBUTE_VALUE\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - INVALID_MIB_ATTRIBUTE_VALUE\n"));
|
||||
break;
|
||||
case 0x03:
|
||||
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - READ_ONLY_MIB_ATTRIBUTE\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - READ_ONLY_MIB_ATTRIBUTE\n"));
|
||||
break;
|
||||
case 0x04:
|
||||
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - WRITE_ONLY_MIB_ATTRIBUTE\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - WRITE_ONLY_MIB_ATTRIBUTE\n"));
|
||||
break;
|
||||
case 0x05:
|
||||
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - BAD_INDEX\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - BAD_INDEX\n"));
|
||||
break;
|
||||
case 0x06:
|
||||
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - LOCKED_MIB_ATTRIBUTE\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - LOCKED_MIB_ATTRIBUTE\n"));
|
||||
break;
|
||||
case 0x07:
|
||||
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - BAD_TEST_FEATURE_INDEX\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - BAD_TEST_FEATURE_INDEX\n"));
|
||||
break;
|
||||
case 0x08:
|
||||
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - PEER_COMMUNICATION_FAILURE\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - PEER_COMMUNICATION_FAILURE\n"));
|
||||
break;
|
||||
case 0x09:
|
||||
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - BUSY\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - BUSY\n"));
|
||||
break;
|
||||
case 0x0A:
|
||||
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - DME_FAILURE\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - DME_FAILURE\n"));
|
||||
break;
|
||||
default :
|
||||
ASSERT (FALSE);
|
||||
@ -195,7 +195,7 @@ DumpUicCmdExecResult (
|
||||
case 0x00:
|
||||
break;
|
||||
case 0x01:
|
||||
DEBUG ((EFI_D_VERBOSE, "UIC control command fails - FAILURE\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "UIC control command fails - FAILURE\n"));
|
||||
break;
|
||||
default :
|
||||
ASSERT (FALSE);
|
||||
@ -217,34 +217,34 @@ DumpQueryResponseResult (
|
||||
{
|
||||
switch (Result) {
|
||||
case 0xF6:
|
||||
DEBUG ((EFI_D_VERBOSE, "Query Response with Parameter Not Readable\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "Query Response with Parameter Not Readable\n"));
|
||||
break;
|
||||
case 0xF7:
|
||||
DEBUG ((EFI_D_VERBOSE, "Query Response with Parameter Not Writeable\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "Query Response with Parameter Not Writeable\n"));
|
||||
break;
|
||||
case 0xF8:
|
||||
DEBUG ((EFI_D_VERBOSE, "Query Response with Parameter Already Written\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "Query Response with Parameter Already Written\n"));
|
||||
break;
|
||||
case 0xF9:
|
||||
DEBUG ((EFI_D_VERBOSE, "Query Response with Invalid Length\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "Query Response with Invalid Length\n"));
|
||||
break;
|
||||
case 0xFA:
|
||||
DEBUG ((EFI_D_VERBOSE, "Query Response with Invalid Value\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "Query Response with Invalid Value\n"));
|
||||
break;
|
||||
case 0xFB:
|
||||
DEBUG ((EFI_D_VERBOSE, "Query Response with Invalid Selector\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "Query Response with Invalid Selector\n"));
|
||||
break;
|
||||
case 0xFC:
|
||||
DEBUG ((EFI_D_VERBOSE, "Query Response with Invalid Index\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "Query Response with Invalid Index\n"));
|
||||
break;
|
||||
case 0xFD:
|
||||
DEBUG ((EFI_D_VERBOSE, "Query Response with Invalid Idn\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "Query Response with Invalid Idn\n"));
|
||||
break;
|
||||
case 0xFE:
|
||||
DEBUG ((EFI_D_VERBOSE, "Query Response with Invalid Opcode\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "Query Response with Invalid Opcode\n"));
|
||||
break;
|
||||
case 0xFF:
|
||||
DEBUG ((EFI_D_VERBOSE, "Query Response with General Failure\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "Query Response with General Failure\n"));
|
||||
break;
|
||||
default :
|
||||
ASSERT (FALSE);
|
||||
@ -402,7 +402,7 @@ UfsInitUtpPrdt (
|
||||
|
||||
if ((BufferSize & (BIT0 | BIT1)) != 0) {
|
||||
BufferSize &= ~(BIT0 | BIT1);
|
||||
DEBUG ((EFI_D_WARN, "UfsInitUtpPrdt: The BufferSize [%d] is not dword-aligned!\n", BufferSize));
|
||||
DEBUG ((DEBUG_WARN, "UfsInitUtpPrdt: The BufferSize [%d] is not dword-aligned!\n", BufferSize));
|
||||
}
|
||||
|
||||
if (BufferSize == 0) {
|
||||
@ -602,32 +602,13 @@ UfsCreateDMCommandDesc (
|
||||
}
|
||||
|
||||
DataDirection = Packet->DataDirection;
|
||||
if (DataDirection == UfsDataIn) {
|
||||
DataSize = Packet->InTransferLength;
|
||||
Data = Packet->InDataBuffer;
|
||||
} else if (DataDirection == UfsDataOut) {
|
||||
DataSize = Packet->OutTransferLength;
|
||||
Data = Packet->OutDataBuffer;
|
||||
} else {
|
||||
DataSize = 0;
|
||||
Data = NULL;
|
||||
}
|
||||
|
||||
if (((Opcode != UtpQueryFuncOpcodeSetFlag) && (Opcode != UtpQueryFuncOpcodeClrFlag) && (Opcode != UtpQueryFuncOpcodeTogFlag))
|
||||
&& ((DataSize == 0) || (Data == NULL))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (((Opcode == UtpQueryFuncOpcodeSetFlag) || (Opcode == UtpQueryFuncOpcodeClrFlag) || (Opcode == UtpQueryFuncOpcodeTogFlag))
|
||||
&& ((DataSize != 0) || (Data != NULL))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if ((Opcode == UtpQueryFuncOpcodeWrAttr) && (DataSize != sizeof (UINT32))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
DataSize = Packet->TransferLength;
|
||||
Data = Packet->DataBuffer;
|
||||
|
||||
if ((Opcode == UtpQueryFuncOpcodeWrDesc) || (Opcode == UtpQueryFuncOpcodeRdDesc)) {
|
||||
if (DataSize == 0 || Data == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
TotalLen = ROUNDUP8 (sizeof (UTP_QUERY_REQ_UPIU)) + ROUNDUP8 (sizeof (UTP_QUERY_RESP_UPIU)) + ROUNDUP8 (DataSize);
|
||||
} else {
|
||||
TotalLen = ROUNDUP8 (sizeof (UTP_QUERY_REQ_UPIU)) + ROUNDUP8 (sizeof (UTP_QUERY_RESP_UPIU));
|
||||
@ -867,6 +848,183 @@ UfsStopExecCmd (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Extracts return data from query response upiu.
|
||||
|
||||
@param[in] Packet Pointer to the UFS_DEVICE_MANAGEMENT_REQUEST_PACKET.
|
||||
@param[in] QueryResp Pointer to the query response.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER Packet or QueryResp are empty or opcode is invalid.
|
||||
@retval EFI_SUCCESS Data extracted.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UfsGetReturnDataFromQueryResponse (
|
||||
IN UFS_DEVICE_MANAGEMENT_REQUEST_PACKET *Packet,
|
||||
IN UTP_QUERY_RESP_UPIU *QueryResp
|
||||
)
|
||||
{
|
||||
UINT16 ReturnDataSize;
|
||||
UINT32 ReturnData;
|
||||
|
||||
if (Packet == NULL || QueryResp == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
switch (Packet->Opcode) {
|
||||
case UtpQueryFuncOpcodeRdDesc:
|
||||
ReturnDataSize = QueryResp->Tsf.Length;
|
||||
SwapLittleEndianToBigEndian ((UINT8*)&ReturnDataSize, sizeof (UINT16));
|
||||
CopyMem (Packet->DataBuffer, (QueryResp + 1), ReturnDataSize);
|
||||
Packet->TransferLength = ReturnDataSize;
|
||||
break;
|
||||
case UtpQueryFuncOpcodeWrDesc:
|
||||
ReturnDataSize = QueryResp->Tsf.Length;
|
||||
SwapLittleEndianToBigEndian ((UINT8*)&ReturnDataSize, sizeof (UINT16));
|
||||
Packet->TransferLength = ReturnDataSize;
|
||||
break;
|
||||
case UtpQueryFuncOpcodeRdFlag:
|
||||
case UtpQueryFuncOpcodeSetFlag:
|
||||
case UtpQueryFuncOpcodeClrFlag:
|
||||
case UtpQueryFuncOpcodeTogFlag:
|
||||
CopyMem (Packet->DataBuffer, &QueryResp->Tsf.Value, sizeof (UINT8));
|
||||
break;
|
||||
case UtpQueryFuncOpcodeRdAttr:
|
||||
case UtpQueryFuncOpcodeWrAttr:
|
||||
ReturnData = QueryResp->Tsf.Value;
|
||||
SwapLittleEndianToBigEndian ((UINT8*) &ReturnData, sizeof (UINT32));
|
||||
CopyMem (Packet->DataBuffer, &ReturnData, sizeof (UINT32));
|
||||
break;
|
||||
default:
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Creates Transfer Request descriptor and sends Query Request to the device.
|
||||
|
||||
@param[in] Private Pointer to the UFS_PASS_THRU_PRIVATE_DATA.
|
||||
@param[in] Packet Pointer to the UFS_DEVICE_MANAGEMENT_REQUEST_PACKET.
|
||||
|
||||
@retval EFI_SUCCESS The device descriptor was read/written successfully.
|
||||
@retval EFI_DEVICE_ERROR A device error occurred while attempting to r/w the device descriptor.
|
||||
@retval EFI_TIMEOUT A timeout occurred while waiting for the completion of r/w the device descriptor.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UfsSendDmRequestRetry (
|
||||
IN UFS_PASS_THRU_PRIVATE_DATA *Private,
|
||||
IN UFS_DEVICE_MANAGEMENT_REQUEST_PACKET *Packet
|
||||
)
|
||||
{
|
||||
UINT8 Slot;
|
||||
UTP_TRD *Trd;
|
||||
VOID *CmdDescHost;
|
||||
VOID *CmdDescMapping;
|
||||
UINT32 CmdDescSize;
|
||||
EDKII_UFS_HOST_CONTROLLER_PROTOCOL *UfsHc;
|
||||
UTP_QUERY_RESP_UPIU *QueryResp;
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Find out which slot of transfer request list is available.
|
||||
//
|
||||
Status = UfsFindAvailableSlotInTrl (Private, &Slot);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
Trd = ((UTP_TRD*)Private->UtpTrlBase) + Slot;
|
||||
//
|
||||
// Fill transfer request descriptor to this slot.
|
||||
//
|
||||
Status = UfsCreateDMCommandDesc (Private, Packet, Trd, &CmdDescHost, &CmdDescMapping);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "Failed to create DM command descriptor\n"));
|
||||
return Status;
|
||||
}
|
||||
|
||||
UfsHc = Private->UfsHostController;
|
||||
QueryResp = (UTP_QUERY_RESP_UPIU*)((UINT8*)CmdDescHost + Trd->RuO * sizeof (UINT32));
|
||||
ASSERT (QueryResp != NULL);
|
||||
CmdDescSize = Trd->RuO * sizeof (UINT32) + Trd->RuL * sizeof (UINT32);
|
||||
|
||||
//
|
||||
// Start to execute the transfer request.
|
||||
//
|
||||
UfsStartExecCmd (Private, Slot);
|
||||
|
||||
//
|
||||
// Wait for the completion of the transfer request.
|
||||
//
|
||||
Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0, 0, Packet->Timeout);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (Trd->Ocs != 0 || QueryResp->QueryResp != UfsUtpQueryResponseSuccess) {
|
||||
DEBUG ((DEBUG_ERROR, "Failed to send query request, OCS = %X, QueryResp = %X\n", Trd->Ocs, QueryResp->QueryResp));
|
||||
DumpQueryResponseResult (QueryResp->QueryResp);
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
Status = UfsGetReturnDataFromQueryResponse (Packet, QueryResp);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "Failed to get return data from query response\n"));
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
Exit:
|
||||
UfsHc->Flush (UfsHc);
|
||||
|
||||
UfsStopExecCmd (Private, Slot);
|
||||
|
||||
if (CmdDescMapping != NULL) {
|
||||
UfsHc->Unmap (UfsHc, CmdDescMapping);
|
||||
}
|
||||
if (CmdDescHost != NULL) {
|
||||
UfsHc->FreeBuffer (UfsHc, EFI_SIZE_TO_PAGES (CmdDescSize), CmdDescHost);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Sends Query Request to the device. Query is sent until device responds correctly or counter runs out.
|
||||
|
||||
@param[in] Private Pointer to the UFS_PASS_THRU_PRIVATE_DATA.
|
||||
@param[in] Packet Pointer to the UFS_DEVICE_MANAGEMENT_PACKET.
|
||||
|
||||
@retval EFI_SUCCESS The device responded correctly to the Query request.
|
||||
@retval EFI_DEVICE_ERROR A device error occurred while waiting for the response from the device.
|
||||
@retval EFI_TIMEOUT A timeout occurred while waiting for the completion of the operation.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UfsSendDmRequest (
|
||||
IN UFS_PASS_THRU_PRIVATE_DATA *Private,
|
||||
IN UFS_DEVICE_MANAGEMENT_REQUEST_PACKET *Packet
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 Retry;
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
|
||||
for (Retry = 0; Retry < 5; Retry ++) {
|
||||
Status = UfsSendDmRequestRetry (Private, Packet);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG ((DEBUG_ERROR, "Failed to get response from the device after %d retries\n", Retry));
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Read or write specified device descriptor of a UFS device.
|
||||
|
||||
@ -894,106 +1052,25 @@ UfsRwDeviceDesc (
|
||||
IN UINT32 DescSize
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UFS_DEVICE_MANAGEMENT_REQUEST_PACKET Packet;
|
||||
UINT8 Slot;
|
||||
UTP_TRD *Trd;
|
||||
UTP_QUERY_RESP_UPIU *QueryResp;
|
||||
UINT32 CmdDescSize;
|
||||
UINT16 ReturnDataSize;
|
||||
VOID *CmdDescHost;
|
||||
VOID *CmdDescMapping;
|
||||
EDKII_UFS_HOST_CONTROLLER_PROTOCOL *UfsHc;
|
||||
|
||||
ZeroMem (&Packet, sizeof (UFS_DEVICE_MANAGEMENT_REQUEST_PACKET));
|
||||
|
||||
if (Read) {
|
||||
Packet.DataDirection = UfsDataIn;
|
||||
Packet.InDataBuffer = Descriptor;
|
||||
Packet.InTransferLength = DescSize;
|
||||
Packet.Opcode = UtpQueryFuncOpcodeRdDesc;
|
||||
} else {
|
||||
Packet.DataDirection = UfsDataOut;
|
||||
Packet.OutDataBuffer = Descriptor;
|
||||
Packet.OutTransferLength = DescSize;
|
||||
Packet.Opcode = UtpQueryFuncOpcodeWrDesc;
|
||||
}
|
||||
Packet.DataBuffer = Descriptor;
|
||||
Packet.TransferLength = DescSize;
|
||||
Packet.DescId = DescId;
|
||||
Packet.Index = Index;
|
||||
Packet.Selector = Selector;
|
||||
Packet.Timeout = UFS_TIMEOUT;
|
||||
|
||||
//
|
||||
// Find out which slot of transfer request list is available.
|
||||
//
|
||||
Status = UfsFindAvailableSlotInTrl (Private, &Slot);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
Trd = ((UTP_TRD*)Private->UtpTrlBase) + Slot;
|
||||
//
|
||||
// Fill transfer request descriptor to this slot.
|
||||
//
|
||||
Status = UfsCreateDMCommandDesc (Private, &Packet, Trd, &CmdDescHost, &CmdDescMapping);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Check the transfer request result.
|
||||
//
|
||||
UfsHc = Private->UfsHostController;
|
||||
QueryResp = (UTP_QUERY_RESP_UPIU*)((UINT8*)CmdDescHost + Trd->RuO * sizeof (UINT32));
|
||||
ASSERT (QueryResp != NULL);
|
||||
CmdDescSize = Trd->RuO * sizeof (UINT32) + Trd->RuL * sizeof (UINT32);
|
||||
|
||||
//
|
||||
// Start to execute the transfer request.
|
||||
//
|
||||
UfsStartExecCmd (Private, Slot);
|
||||
|
||||
//
|
||||
// Wait for the completion of the transfer request.
|
||||
//
|
||||
Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << Slot, 0, Packet.Timeout);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (QueryResp->QueryResp != 0) {
|
||||
DumpQueryResponseResult (QueryResp->QueryResp);
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (Trd->Ocs == 0) {
|
||||
ReturnDataSize = QueryResp->Tsf.Length;
|
||||
SwapLittleEndianToBigEndian ((UINT8*)&ReturnDataSize, sizeof (UINT16));
|
||||
|
||||
if (Read) {
|
||||
CopyMem (Packet.InDataBuffer, (QueryResp + 1), ReturnDataSize);
|
||||
Packet.InTransferLength = ReturnDataSize;
|
||||
} else {
|
||||
Packet.OutTransferLength = ReturnDataSize;
|
||||
}
|
||||
} else {
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
Exit:
|
||||
UfsHc->Flush (UfsHc);
|
||||
|
||||
UfsStopExecCmd (Private, Slot);
|
||||
|
||||
if (CmdDescMapping != NULL) {
|
||||
UfsHc->Unmap (UfsHc, CmdDescMapping);
|
||||
}
|
||||
if (CmdDescHost != NULL) {
|
||||
UfsHc->FreeBuffer (UfsHc, EFI_SIZE_TO_PAGES (CmdDescSize), CmdDescHost);
|
||||
}
|
||||
|
||||
return Status;
|
||||
return UfsSendDmRequest (Private, &Packet);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1021,16 +1098,7 @@ UfsRwAttributes (
|
||||
IN OUT UINT32 *Attributes
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UFS_DEVICE_MANAGEMENT_REQUEST_PACKET Packet;
|
||||
UINT8 Slot;
|
||||
UTP_TRD *Trd;
|
||||
UTP_QUERY_RESP_UPIU *QueryResp;
|
||||
UINT32 CmdDescSize;
|
||||
UINT32 ReturnData;
|
||||
VOID *CmdDescHost;
|
||||
VOID *CmdDescMapping;
|
||||
EDKII_UFS_HOST_CONTROLLER_PROTOCOL *UfsHc;
|
||||
|
||||
ZeroMem (&Packet, sizeof (UFS_DEVICE_MANAGEMENT_REQUEST_PACKET));
|
||||
|
||||
@ -1041,77 +1109,13 @@ UfsRwAttributes (
|
||||
Packet.DataDirection = UfsDataOut;
|
||||
Packet.Opcode = UtpQueryFuncOpcodeWrAttr;
|
||||
}
|
||||
Packet.DataBuffer = Attributes;
|
||||
Packet.DescId = AttrId;
|
||||
Packet.Index = Index;
|
||||
Packet.Selector = Selector;
|
||||
Packet.Timeout = UFS_TIMEOUT;
|
||||
|
||||
//
|
||||
// Find out which slot of transfer request list is available.
|
||||
//
|
||||
Status = UfsFindAvailableSlotInTrl (Private, &Slot);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
Trd = ((UTP_TRD*)Private->UtpTrlBase) + Slot;
|
||||
//
|
||||
// Fill transfer request descriptor to this slot.
|
||||
//
|
||||
Status = UfsCreateDMCommandDesc (Private, &Packet, Trd, &CmdDescHost, &CmdDescMapping);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Check the transfer request result.
|
||||
//
|
||||
UfsHc = Private->UfsHostController;
|
||||
QueryResp = (UTP_QUERY_RESP_UPIU*)((UINT8*)CmdDescHost + Trd->RuO * sizeof (UINT32));
|
||||
ASSERT (QueryResp != NULL);
|
||||
CmdDescSize = Trd->RuO * sizeof (UINT32) + Trd->RuL * sizeof (UINT32);
|
||||
|
||||
//
|
||||
// Start to execute the transfer request.
|
||||
//
|
||||
UfsStartExecCmd (Private, Slot);
|
||||
|
||||
//
|
||||
// Wait for the completion of the transfer request.
|
||||
//
|
||||
Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << Slot, 0, Packet.Timeout);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (QueryResp->QueryResp != 0) {
|
||||
DumpQueryResponseResult (QueryResp->QueryResp);
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (Trd->Ocs == 0) {
|
||||
ReturnData = QueryResp->Tsf.Value;
|
||||
SwapLittleEndianToBigEndian ((UINT8*)&ReturnData, sizeof (UINT32));
|
||||
*Attributes = ReturnData;
|
||||
} else {
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
Exit:
|
||||
UfsHc->Flush (UfsHc);
|
||||
|
||||
UfsStopExecCmd (Private, Slot);
|
||||
|
||||
if (CmdDescMapping != NULL) {
|
||||
UfsHc->Unmap (UfsHc, CmdDescMapping);
|
||||
}
|
||||
|
||||
if (CmdDescHost != NULL) {
|
||||
UfsHc->FreeBuffer (UfsHc, EFI_SIZE_TO_PAGES (CmdDescSize), CmdDescHost);
|
||||
}
|
||||
|
||||
return Status;
|
||||
return UfsSendDmRequest (Private, &Packet);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1135,15 +1139,7 @@ UfsRwFlags (
|
||||
IN OUT UINT8 *Value
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UFS_DEVICE_MANAGEMENT_REQUEST_PACKET Packet;
|
||||
UINT8 Slot;
|
||||
UTP_TRD *Trd;
|
||||
UTP_QUERY_RESP_UPIU *QueryResp;
|
||||
UINT32 CmdDescSize;
|
||||
VOID *CmdDescHost;
|
||||
VOID *CmdDescMapping;
|
||||
EDKII_UFS_HOST_CONTROLLER_PROTOCOL *UfsHc;
|
||||
|
||||
if (Value == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@ -1165,74 +1161,13 @@ UfsRwFlags (
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
Packet.DataBuffer = Value;
|
||||
Packet.DescId = FlagId;
|
||||
Packet.Index = 0;
|
||||
Packet.Selector = 0;
|
||||
Packet.Timeout = UFS_TIMEOUT;
|
||||
|
||||
//
|
||||
// Find out which slot of transfer request list is available.
|
||||
//
|
||||
Status = UfsFindAvailableSlotInTrl (Private, &Slot);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Fill transfer request descriptor to this slot.
|
||||
//
|
||||
Trd = ((UTP_TRD*)Private->UtpTrlBase) + Slot;
|
||||
Status = UfsCreateDMCommandDesc (Private, &Packet, Trd, &CmdDescHost, &CmdDescMapping);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Check the transfer request result.
|
||||
//
|
||||
UfsHc = Private->UfsHostController;
|
||||
QueryResp = (UTP_QUERY_RESP_UPIU*)((UINT8*)CmdDescHost + Trd->RuO * sizeof (UINT32));
|
||||
ASSERT (QueryResp != NULL);
|
||||
CmdDescSize = Trd->RuO * sizeof (UINT32) + Trd->RuL * sizeof (UINT32);
|
||||
|
||||
//
|
||||
// Start to execute the transfer request.
|
||||
//
|
||||
UfsStartExecCmd (Private, Slot);
|
||||
|
||||
//
|
||||
// Wait for the completion of the transfer request.
|
||||
//
|
||||
Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << Slot, 0, Packet.Timeout);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (QueryResp->QueryResp != 0) {
|
||||
DumpQueryResponseResult (QueryResp->QueryResp);
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (Trd->Ocs == 0) {
|
||||
*Value = (UINT8)QueryResp->Tsf.Value;
|
||||
} else {
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
Exit:
|
||||
UfsHc->Flush (UfsHc);
|
||||
|
||||
UfsStopExecCmd (Private, Slot);
|
||||
|
||||
if (CmdDescMapping != NULL) {
|
||||
UfsHc->Unmap (UfsHc, CmdDescMapping);
|
||||
}
|
||||
if (CmdDescHost != NULL) {
|
||||
UfsHc->FreeBuffer (UfsHc, EFI_SIZE_TO_PAGES (CmdDescSize), CmdDescHost);
|
||||
}
|
||||
|
||||
return Status;
|
||||
return UfsSendDmRequest (Private, &Packet);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1559,7 +1494,7 @@ UfsExecScsiCmds (
|
||||
//
|
||||
Packet->TargetStatus = Response->Status;
|
||||
if (Response->Response != 0) {
|
||||
DEBUG ((EFI_D_ERROR, "UfsExecScsiCmds() fails with Target Failure\n"));
|
||||
DEBUG ((DEBUG_ERROR, "UfsExecScsiCmds() fails with Target Failure\n"));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Exit;
|
||||
}
|
||||
@ -1717,7 +1652,7 @@ UfsExecUicCommands (
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_INFO, "UfsPassThruDxe: found a attached UFS device\n"));
|
||||
DEBUG ((DEBUG_INFO, "UfsPassThruDxe: found a attached UFS device\n"));
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@ -2084,29 +2019,29 @@ UfsControllerInit (
|
||||
|
||||
Status = UfsEnableHostController (Private);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "UfsControllerInit: Enable Host Controller Fails, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "UfsControllerInit: Enable Host Controller Fails, Status = %r\n", Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = UfsDeviceDetection (Private);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "UfsControllerInit: Device Detection Fails, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "UfsControllerInit: Device Detection Fails, Status = %r\n", Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = UfsInitTaskManagementRequestList (Private);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "UfsControllerInit: Task management list initialization Fails, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "UfsControllerInit: Task management list initialization Fails, Status = %r\n", Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = UfsInitTransferRequestList (Private);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "UfsControllerInit: Transfer list initialization Fails, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "UfsControllerInit: Transfer list initialization Fails, Status = %r\n", Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_INFO, "UfsControllerInit Finished\n"));
|
||||
DEBUG ((DEBUG_INFO, "UfsControllerInit Finished\n"));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -2167,7 +2102,7 @@ UfsControllerStop (
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_INFO, "UfsController is stopped\n"));
|
||||
DEBUG ((DEBUG_INFO, "UfsController is stopped\n"));
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@ -2274,7 +2209,7 @@ ProcessAsyncTaskList (
|
||||
// case.
|
||||
//
|
||||
Packet->HostAdapterStatus = EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR;
|
||||
DEBUG ((EFI_D_VERBOSE, "ProcessAsyncTaskList(): Signal Event %p UfsMmioRead32() Error.\n", TransReq->CallerEvent));
|
||||
DEBUG ((DEBUG_VERBOSE, "ProcessAsyncTaskList(): Signal Event %p UfsMmioRead32() Error.\n", TransReq->CallerEvent));
|
||||
SignalCallerEvent (Private, TransReq);
|
||||
continue;
|
||||
}
|
||||
@ -2291,7 +2226,7 @@ ProcessAsyncTaskList (
|
||||
// Timeout occurs.
|
||||
//
|
||||
Packet->HostAdapterStatus = EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND;
|
||||
DEBUG ((EFI_D_VERBOSE, "ProcessAsyncTaskList(): Signal Event %p EFI_TIMEOUT.\n", TransReq->CallerEvent));
|
||||
DEBUG ((DEBUG_VERBOSE, "ProcessAsyncTaskList(): Signal Event %p EFI_TIMEOUT.\n", TransReq->CallerEvent));
|
||||
SignalCallerEvent (Private, TransReq);
|
||||
continue;
|
||||
}
|
||||
@ -2316,7 +2251,7 @@ ProcessAsyncTaskList (
|
||||
//
|
||||
Packet->TargetStatus = Response->Status;
|
||||
if (Response->Response != 0) {
|
||||
DEBUG ((EFI_D_VERBOSE, "ProcessAsyncTaskList(): Signal Event %p Target Failure.\n", TransReq->CallerEvent));
|
||||
DEBUG ((DEBUG_VERBOSE, "ProcessAsyncTaskList(): Signal Event %p Target Failure.\n", TransReq->CallerEvent));
|
||||
SignalCallerEvent (Private, TransReq);
|
||||
continue;
|
||||
}
|
||||
@ -2336,12 +2271,12 @@ ProcessAsyncTaskList (
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DEBUG ((EFI_D_VERBOSE, "ProcessAsyncTaskList(): Signal Event %p Target Device Error.\n", TransReq->CallerEvent));
|
||||
DEBUG ((DEBUG_VERBOSE, "ProcessAsyncTaskList(): Signal Event %p Target Device Error.\n", TransReq->CallerEvent));
|
||||
SignalCallerEvent (Private, TransReq);
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_VERBOSE, "ProcessAsyncTaskList(): Signal Event %p Success.\n", TransReq->CallerEvent));
|
||||
DEBUG ((DEBUG_VERBOSE, "ProcessAsyncTaskList(): Signal Event %p Success.\n", TransReq->CallerEvent));
|
||||
SignalCallerEvent (Private, TransReq);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Pei USB ATATPI command implementations.
|
||||
|
||||
Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions
|
||||
@ -274,7 +274,7 @@ PeiUsbReadCapacity (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
LastBlock = (Data.LastLba3 << 24) | (Data.LastLba2 << 16) | (Data.LastLba1 << 8) | Data.LastLba0;
|
||||
LastBlock = ((UINT32) Data.LastLba3 << 24) | (Data.LastLba2 << 16) | (Data.LastLba1 << 8) | Data.LastLba0;
|
||||
|
||||
if (LastBlock == 0xFFFFFFFF) {
|
||||
DEBUG ((EFI_D_INFO, "The usb device LBA count is larger than 0xFFFFFFFF!\n"));
|
||||
@ -346,7 +346,7 @@ PeiUsbReadFormattedCapacity (
|
||||
PeiBotDevice->Media2.LastBlock = 0;
|
||||
|
||||
} else {
|
||||
LastBlock = (FormatData.LastLba3 << 24) | (FormatData.LastLba2 << 16) | (FormatData.LastLba1 << 8) | FormatData.LastLba0;
|
||||
LastBlock = ((UINT32) FormatData.LastLba3 << 24) | (FormatData.LastLba2 << 16) | (FormatData.LastLba1 << 8) | FormatData.LastLba0;
|
||||
if (LastBlock == 0xFFFFFFFF) {
|
||||
DEBUG ((EFI_D_INFO, "The usb device LBA count is larger than 0xFFFFFFFF!\n"));
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Usb bus enumeration support.
|
||||
|
||||
Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -53,28 +53,33 @@ UsbGetEndpointDesc (
|
||||
|
||||
@param UsbIf The USB interface to free.
|
||||
|
||||
@retval EFI_ACCESS_DENIED The interface is still occupied.
|
||||
@retval EFI_SUCCESS The interface is freed.
|
||||
**/
|
||||
VOID
|
||||
EFI_STATUS
|
||||
UsbFreeInterface (
|
||||
IN USB_INTERFACE *UsbIf
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
UsbCloseHostProtoByChild (UsbIf->Device->Bus, UsbIf->Handle);
|
||||
|
||||
gBS->UninstallMultipleProtocolInterfaces (
|
||||
UsbIf->Handle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
UsbIf->DevicePath,
|
||||
&gEfiUsbIoProtocolGuid,
|
||||
&UsbIf->UsbIo,
|
||||
NULL
|
||||
);
|
||||
|
||||
if (UsbIf->DevicePath != NULL) {
|
||||
FreePool (UsbIf->DevicePath);
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
UsbIf->Handle,
|
||||
&gEfiDevicePathProtocolGuid, UsbIf->DevicePath,
|
||||
&gEfiUsbIoProtocolGuid, &UsbIf->UsbIo,
|
||||
NULL
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
if (UsbIf->DevicePath != NULL) {
|
||||
FreePool (UsbIf->DevicePath);
|
||||
}
|
||||
FreePool (UsbIf);
|
||||
} else {
|
||||
UsbOpenHostProtoByChild (UsbIf->Device->Bus, UsbIf->Handle);
|
||||
}
|
||||
|
||||
FreePool (UsbIf);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
@ -525,7 +530,13 @@ UsbRemoveConfig (
|
||||
|
||||
Status = UsbDisconnectDriver (UsbIf);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
UsbFreeInterface (UsbIf);
|
||||
Status = UsbFreeInterface (UsbIf);
|
||||
if (EFI_ERROR (Status)) {
|
||||
UsbConnectDriver (UsbIf);
|
||||
}
|
||||
}
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Device->Interfaces[Index] = NULL;
|
||||
} else {
|
||||
ReturnStatus = Status;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Wrapper function for usb host controller interface.
|
||||
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -1364,10 +1364,10 @@ UsbBusRecursivelyConnectWantedUsbIo (
|
||||
//
|
||||
// Recursively connect the wanted Usb Io handle
|
||||
//
|
||||
DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL before connect is %d\n", (UINT32)UsbGetCurrentTpl ()));
|
||||
DEBUG ((EFI_D_INFO, "UsbBusRecursivelyConnectWantedUsbIo: TPL before connect is %d\n", (UINT32)UsbGetCurrentTpl ()));
|
||||
Status = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE);
|
||||
UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR (Status);
|
||||
DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL after connect is %d\n", (UINT32)UsbGetCurrentTpl()));
|
||||
DEBUG ((EFI_D_INFO, "UsbBusRecursivelyConnectWantedUsbIo: TPL after connect is %d\n", (UINT32)UsbGetCurrentTpl()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -773,7 +773,7 @@ FvIsBeingProcesssed (
|
||||
for (Link = mFvHandleList.ForwardLink; Link != &mFvHandleList; Link = Link->ForwardLink) {
|
||||
KnownHandle = CR(Link, KNOWN_HANDLE, Link, KNOWN_HANDLE_SIGNATURE);
|
||||
if (CompareGuid (&FvNameGuid, &KnownHandle->FvNameGuid)) {
|
||||
DEBUG ((EFI_D_ERROR, "FvImage on FvHandle %p and %p has the same FvNameGuid %g.\n", FvHandle, KnownHandle->Handle, FvNameGuid));
|
||||
DEBUG ((EFI_D_ERROR, "FvImage on FvHandle %p and %p has the same FvNameGuid %g.\n", FvHandle, KnownHandle->Handle, &FvNameGuid));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1647,6 +1647,12 @@ CoreStartImage (
|
||||
//
|
||||
PERF_START (NULL, "StartImage:", NULL, Tick);
|
||||
PERF_END (NULL, "StartImage:", NULL, 0);
|
||||
|
||||
//
|
||||
// Pop the current start image context
|
||||
//
|
||||
mCurrentImage = LastImage;
|
||||
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
Image->JumpContext = ALIGN_POINTER (Image->JumpBuffer, BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT);
|
||||
|
@ -576,6 +576,11 @@ SplitRecord (
|
||||
TempRecord.NumberOfPages = EfiSizeToPages (PhysicalEnd - PhysicalStart);
|
||||
} while ((ImageRecord != NULL) && (PhysicalStart < PhysicalEnd));
|
||||
|
||||
//
|
||||
// The logic in function SplitTable() ensures that TotalNewRecordCount will not be zero if the
|
||||
// code reaches here.
|
||||
//
|
||||
ASSERT (TotalNewRecordCount != 0);
|
||||
return TotalNewRecordCount - 1;
|
||||
}
|
||||
|
||||
|
@ -596,7 +596,7 @@ SmmLoadImage (
|
||||
}
|
||||
CopyMem (DriverEntry->LoadedImage->FilePath, FilePath, GetDevicePathSize (FilePath));
|
||||
|
||||
DriverEntry->LoadedImage->ImageBase = (VOID *)(UINTN)DriverEntry->ImageBuffer;
|
||||
DriverEntry->LoadedImage->ImageBase = (VOID *)(UINTN) ImageContext.ImageAddress;
|
||||
DriverEntry->LoadedImage->ImageSize = ImageContext.ImageSize;
|
||||
DriverEntry->LoadedImage->ImageCodeType = EfiRuntimeServicesCode;
|
||||
DriverEntry->LoadedImage->ImageDataType = EfiRuntimeServicesData;
|
||||
@ -615,7 +615,7 @@ SmmLoadImage (
|
||||
}
|
||||
CopyMem (DriverEntry->SmmLoadedImage.FilePath, FilePath, GetDevicePathSize(FilePath));
|
||||
|
||||
DriverEntry->SmmLoadedImage.ImageBase = (VOID *)(UINTN)DriverEntry->ImageBuffer;
|
||||
DriverEntry->SmmLoadedImage.ImageBase = (VOID *)(UINTN) ImageContext.ImageAddress;
|
||||
DriverEntry->SmmLoadedImage.ImageSize = ImageContext.ImageSize;
|
||||
DriverEntry->SmmLoadedImage.ImageCodeType = EfiRuntimeServicesCode;
|
||||
DriverEntry->SmmLoadedImage.ImageDataType = EfiRuntimeServicesData;
|
||||
|
@ -1196,12 +1196,28 @@ extern LIST_ENTRY mSmmMemoryMap;
|
||||
//
|
||||
#define MAX_POOL_INDEX (MAX_POOL_SHIFT - MIN_POOL_SHIFT + 1)
|
||||
|
||||
#define POOL_HEAD_SIGNATURE SIGNATURE_32('p','h','d','0')
|
||||
|
||||
typedef struct {
|
||||
UINTN Size;
|
||||
BOOLEAN Available;
|
||||
EFI_MEMORY_TYPE Type;
|
||||
UINT32 Signature;
|
||||
BOOLEAN Available;
|
||||
EFI_MEMORY_TYPE Type;
|
||||
UINTN Size;
|
||||
} POOL_HEADER;
|
||||
|
||||
#define POOL_TAIL_SIGNATURE SIGNATURE_32('p','t','a','l')
|
||||
|
||||
typedef struct {
|
||||
UINT32 Signature;
|
||||
UINT32 Reserved;
|
||||
UINTN Size;
|
||||
} POOL_TAIL;
|
||||
|
||||
#define POOL_OVERHEAD (sizeof(POOL_HEADER) + sizeof(POOL_TAIL))
|
||||
|
||||
#define HEAD_TO_TAIL(a) \
|
||||
((POOL_TAIL *) (((CHAR8 *) (a)) + (a)->Size - sizeof(POOL_TAIL)));
|
||||
|
||||
typedef struct {
|
||||
POOL_HEADER Header;
|
||||
LIST_ENTRY Link;
|
||||
|
@ -263,6 +263,7 @@ EFI_PHYSICAL_ADDRESS mSmramCacheBase;
|
||||
UINT64 mSmramCacheSize;
|
||||
|
||||
EFI_SMM_COMMUNICATE_HEADER mCommunicateHeader;
|
||||
EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE *mLMFAConfigurationTable = NULL;
|
||||
|
||||
//
|
||||
// Table of Protocol notification and GUIDed Event notifications that the SMM IPL requires
|
||||
@ -841,7 +842,7 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||
|
||||
FixLoadingAddress = 0;
|
||||
Status = EFI_NOT_FOUND;
|
||||
SmramBase = mCurrentSmramRange->CpuStart;
|
||||
SmramBase = mLMFAConfigurationTable->SmramBase;
|
||||
//
|
||||
// Get PeHeader pointer
|
||||
//
|
||||
@ -1519,7 +1520,6 @@ SmmIplEntry (
|
||||
UINT64 MaxSize;
|
||||
VOID *Registration;
|
||||
UINT64 SmmCodeSize;
|
||||
EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE *LMFAConfigurationTable;
|
||||
EFI_CPU_ARCH_PROTOCOL *CpuArch;
|
||||
EFI_STATUS SetAttrStatus;
|
||||
EFI_SMRAM_DESCRIPTOR *SmramRangeSmmDriver;
|
||||
@ -1623,14 +1623,14 @@ SmmIplEntry (
|
||||
//
|
||||
Status = EfiGetSystemConfigurationTable (
|
||||
&gLoadFixedAddressConfigurationTableGuid,
|
||||
(VOID **) &LMFAConfigurationTable
|
||||
(VOID **) &mLMFAConfigurationTable
|
||||
);
|
||||
if (!EFI_ERROR (Status) && LMFAConfigurationTable != NULL) {
|
||||
LMFAConfigurationTable->SmramBase = mCurrentSmramRange->CpuStart;
|
||||
if (!EFI_ERROR (Status) && mLMFAConfigurationTable != NULL) {
|
||||
mLMFAConfigurationTable->SmramBase = mCurrentSmramRange->CpuStart;
|
||||
//
|
||||
// Print the SMRAM base
|
||||
//
|
||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: TSEG BASE is %x. \n", LMFAConfigurationTable->SmramBase));
|
||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: TSEG BASE is %x. \n", mLMFAConfigurationTable->SmramBase));
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
SMM Memory pool management functions.
|
||||
|
||||
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials are licensed and made available
|
||||
under the terms and conditions of the BSD License which accompanies this
|
||||
distribution. The full text of the license may be found at
|
||||
@ -133,9 +133,11 @@ InternalAllocPoolByIndex (
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
FREE_POOL_HEADER *Hdr;
|
||||
POOL_TAIL *Tail;
|
||||
EFI_PHYSICAL_ADDRESS Address;
|
||||
SMM_POOL_TYPE SmmPoolType;
|
||||
|
||||
Address = 0;
|
||||
SmmPoolType = UefiMemoryTypeToSmmPoolType(PoolType);
|
||||
|
||||
ASSERT (PoolIndex <= MAX_POOL_INDEX);
|
||||
@ -153,18 +155,26 @@ InternalAllocPoolByIndex (
|
||||
} else {
|
||||
Status = InternalAllocPoolByIndex (PoolType, PoolIndex + 1, &Hdr);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Hdr->Header.Signature = 0;
|
||||
Hdr->Header.Size >>= 1;
|
||||
Hdr->Header.Available = TRUE;
|
||||
Hdr->Header.Type = PoolType;
|
||||
Hdr->Header.Type = 0;
|
||||
Tail = HEAD_TO_TAIL(&Hdr->Header);
|
||||
Tail->Signature = 0;
|
||||
Tail->Size = 0;
|
||||
InsertHeadList (&mSmmPoolLists[SmmPoolType][PoolIndex], &Hdr->Link);
|
||||
Hdr = (FREE_POOL_HEADER*)((UINT8*)Hdr + Hdr->Header.Size);
|
||||
}
|
||||
}
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Hdr->Header.Signature = POOL_HEAD_SIGNATURE;
|
||||
Hdr->Header.Size = MIN_POOL_SIZE << PoolIndex;
|
||||
Hdr->Header.Available = FALSE;
|
||||
Hdr->Header.Type = PoolType;
|
||||
Tail = HEAD_TO_TAIL(&Hdr->Header);
|
||||
Tail->Signature = POOL_TAIL_SIGNATURE;
|
||||
Tail->Size = Hdr->Header.Size;
|
||||
}
|
||||
|
||||
*FreePoolHdr = Hdr;
|
||||
@ -175,13 +185,15 @@ InternalAllocPoolByIndex (
|
||||
Internal Function. Free a pool by specified PoolIndex.
|
||||
|
||||
@param FreePoolHdr The pool to free.
|
||||
@param PoolTail The pointer to the pool tail.
|
||||
|
||||
@retval EFI_SUCCESS Pool successfully freed.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
InternalFreePoolByIndex (
|
||||
IN FREE_POOL_HEADER *FreePoolHdr
|
||||
IN FREE_POOL_HEADER *FreePoolHdr,
|
||||
IN POOL_TAIL *PoolTail
|
||||
)
|
||||
{
|
||||
UINTN PoolIndex;
|
||||
@ -194,7 +206,11 @@ InternalFreePoolByIndex (
|
||||
SmmPoolType = UefiMemoryTypeToSmmPoolType(FreePoolHdr->Header.Type);
|
||||
|
||||
PoolIndex = (UINTN) (HighBitSet32 ((UINT32)FreePoolHdr->Header.Size) - MIN_POOL_SHIFT);
|
||||
FreePoolHdr->Header.Signature = 0;
|
||||
FreePoolHdr->Header.Available = TRUE;
|
||||
FreePoolHdr->Header.Type = 0;
|
||||
PoolTail->Signature = 0;
|
||||
PoolTail->Size = 0;
|
||||
ASSERT (PoolIndex < MAX_POOL_INDEX);
|
||||
InsertHeadList (&mSmmPoolLists[SmmPoolType][PoolIndex], &FreePoolHdr->Link);
|
||||
return EFI_SUCCESS;
|
||||
@ -222,17 +238,23 @@ SmmInternalAllocatePool (
|
||||
)
|
||||
{
|
||||
POOL_HEADER *PoolHdr;
|
||||
POOL_TAIL *PoolTail;
|
||||
FREE_POOL_HEADER *FreePoolHdr;
|
||||
EFI_STATUS Status;
|
||||
EFI_PHYSICAL_ADDRESS Address;
|
||||
UINTN PoolIndex;
|
||||
|
||||
Address = 0;
|
||||
|
||||
if (PoolType != EfiRuntimeServicesCode &&
|
||||
PoolType != EfiRuntimeServicesData) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Size += sizeof (*PoolHdr);
|
||||
//
|
||||
// Adjust the size by the pool header & tail overhead
|
||||
//
|
||||
Size += POOL_OVERHEAD;
|
||||
if (Size > MAX_POOL_SIZE) {
|
||||
Size = EFI_SIZE_TO_PAGES (Size);
|
||||
Status = SmmInternalAllocatePages (AllocateAnyPages, PoolType, Size, &Address);
|
||||
@ -241,9 +263,13 @@ SmmInternalAllocatePool (
|
||||
}
|
||||
|
||||
PoolHdr = (POOL_HEADER*)(UINTN)Address;
|
||||
PoolHdr->Signature = POOL_HEAD_SIGNATURE;
|
||||
PoolHdr->Size = EFI_PAGES_TO_SIZE (Size);
|
||||
PoolHdr->Available = FALSE;
|
||||
PoolHdr->Type = PoolType;
|
||||
PoolTail = HEAD_TO_TAIL(PoolHdr);
|
||||
PoolTail->Signature = POOL_TAIL_SIGNATURE;
|
||||
PoolTail->Size = PoolHdr->Size;
|
||||
*Buffer = PoolHdr + 1;
|
||||
return Status;
|
||||
}
|
||||
@ -314,13 +340,30 @@ SmmInternalFreePool (
|
||||
)
|
||||
{
|
||||
FREE_POOL_HEADER *FreePoolHdr;
|
||||
POOL_TAIL *PoolTail;
|
||||
|
||||
if (Buffer == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
FreePoolHdr = (FREE_POOL_HEADER*)((POOL_HEADER*)Buffer - 1);
|
||||
ASSERT (FreePoolHdr->Header.Signature == POOL_HEAD_SIGNATURE);
|
||||
ASSERT (!FreePoolHdr->Header.Available);
|
||||
PoolTail = HEAD_TO_TAIL(&FreePoolHdr->Header);
|
||||
ASSERT (PoolTail->Signature == POOL_TAIL_SIGNATURE);
|
||||
ASSERT (FreePoolHdr->Header.Size == PoolTail->Size);
|
||||
|
||||
if (FreePoolHdr->Header.Signature != POOL_HEAD_SIGNATURE) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (PoolTail->Signature != POOL_TAIL_SIGNATURE) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (FreePoolHdr->Header.Size != PoolTail->Size) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (FreePoolHdr->Header.Size > MAX_POOL_SIZE) {
|
||||
ASSERT (((UINTN)FreePoolHdr & EFI_PAGE_MASK) == 0);
|
||||
@ -330,7 +373,7 @@ SmmInternalFreePool (
|
||||
EFI_SIZE_TO_PAGES (FreePoolHdr->Header.Size)
|
||||
);
|
||||
}
|
||||
return InternalFreePoolByIndex (FreePoolHdr);
|
||||
return InternalFreePoolByIndex (FreePoolHdr, PoolTail);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,14 +33,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#include "PiSmmCore.h"
|
||||
|
||||
#define GET_OCCUPIED_SIZE(ActualSize, Alignment) \
|
||||
((ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) & ((Alignment) - 1)))
|
||||
|
||||
typedef struct {
|
||||
EFI_GUID FileGuid;
|
||||
UINTN ImageRef;
|
||||
UINTN EntryPoint;
|
||||
UINTN ImageBase;
|
||||
UINTN ImageSize;
|
||||
UINTN PdbStringSize;
|
||||
CHAR8 *PdbString;
|
||||
EFI_GUID FileGuid;
|
||||
PHYSICAL_ADDRESS EntryPoint;
|
||||
PHYSICAL_ADDRESS ImageBase;
|
||||
UINT64 ImageSize;
|
||||
UINT32 ImageRef;
|
||||
UINT16 PdbStringSize;
|
||||
CHAR8 *PdbString;
|
||||
} IMAGE_STRUCT;
|
||||
|
||||
/**
|
||||
@ -89,8 +92,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED LIST_ENTRY *mSmmCoreSmiEntryList = &mSmiEntry
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED LIST_ENTRY *mSmmCoreHardwareSmiEntryList = &mHardwareSmiEntryList;
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED IMAGE_STRUCT *mImageStruct;
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED UINTN mImageStructCountMax;
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED UINTN mImageStructCount;
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED UINT32 mImageStructCountMax;
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED UINT32 mImageStructCount;
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED VOID *mSmiHandlerProfileDatabase;
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED UINTN mSmiHandlerProfileDatabaseSize;
|
||||
@ -162,11 +165,11 @@ GetDriverGuid (
|
||||
**/
|
||||
VOID
|
||||
AddImageStruct(
|
||||
IN UINTN ImageBase,
|
||||
IN UINTN ImageSize,
|
||||
IN UINTN EntryPoint,
|
||||
IN EFI_GUID *Guid,
|
||||
IN CHAR8 *PdbString
|
||||
IN PHYSICAL_ADDRESS ImageBase,
|
||||
IN UINT64 ImageSize,
|
||||
IN PHYSICAL_ADDRESS EntryPoint,
|
||||
IN EFI_GUID *Guid,
|
||||
IN CHAR8 *PdbString
|
||||
)
|
||||
{
|
||||
UINTN PdbStringSize;
|
||||
@ -185,7 +188,7 @@ AddImageStruct(
|
||||
PdbStringSize = AsciiStrSize(PdbString);
|
||||
mImageStruct[mImageStructCount].PdbString = AllocateCopyPool (PdbStringSize, PdbString);
|
||||
if (mImageStruct[mImageStructCount].PdbString != NULL) {
|
||||
mImageStruct[mImageStructCount].PdbStringSize = PdbStringSize;
|
||||
mImageStruct[mImageStructCount].PdbStringSize = (UINT16) PdbStringSize;
|
||||
}
|
||||
}
|
||||
|
||||
@ -222,7 +225,7 @@ AddressToImageStruct(
|
||||
|
||||
@return image reference index
|
||||
**/
|
||||
UINTN
|
||||
UINT32
|
||||
AddressToImageRef(
|
||||
IN UINTN Address
|
||||
)
|
||||
@ -233,7 +236,7 @@ AddressToImageRef(
|
||||
if (ImageStruct != NULL) {
|
||||
return ImageStruct->ImageRef;
|
||||
}
|
||||
return (UINTN)-1;
|
||||
return (UINT32)-1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -252,11 +255,11 @@ GetSmmLoadedImage(
|
||||
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
|
||||
CHAR16 *PathStr;
|
||||
EFI_SMM_DRIVER_ENTRY *LoadedImagePrivate;
|
||||
UINTN EntryPoint;
|
||||
PHYSICAL_ADDRESS EntryPoint;
|
||||
VOID *EntryPointInImage;
|
||||
EFI_GUID Guid;
|
||||
CHAR8 *PdbString;
|
||||
UINTN RealImageBase;
|
||||
PHYSICAL_ADDRESS RealImageBase;
|
||||
|
||||
HandleBufferSize = 0;
|
||||
HandleBuffer = NULL;
|
||||
@ -286,7 +289,7 @@ GetSmmLoadedImage(
|
||||
}
|
||||
|
||||
NoHandles = HandleBufferSize/sizeof(EFI_HANDLE);
|
||||
mImageStructCountMax = NoHandles;
|
||||
mImageStructCountMax = (UINT32) NoHandles;
|
||||
mImageStruct = AllocateZeroPool(mImageStructCountMax * sizeof(IMAGE_STRUCT));
|
||||
if (mImageStruct == NULL) {
|
||||
goto Done;
|
||||
@ -309,8 +312,8 @@ GetSmmLoadedImage(
|
||||
LoadedImagePrivate = BASE_CR(LoadedImage, EFI_SMM_DRIVER_ENTRY, SmmLoadedImage);
|
||||
RealImageBase = (UINTN)LoadedImage->ImageBase;
|
||||
if (LoadedImagePrivate->Signature == EFI_SMM_DRIVER_ENTRY_SIGNATURE) {
|
||||
EntryPoint = (UINTN)LoadedImagePrivate->ImageEntryPoint;
|
||||
if ((EntryPoint != 0) && ((EntryPoint < (UINTN)LoadedImage->ImageBase) || (EntryPoint >= ((UINTN)LoadedImage->ImageBase + (UINTN)LoadedImage->ImageSize)))) {
|
||||
EntryPoint = LoadedImagePrivate->ImageEntryPoint;
|
||||
if ((EntryPoint != 0) && ((EntryPoint < (UINTN)LoadedImage->ImageBase) || (EntryPoint >= ((UINTN)LoadedImage->ImageBase + LoadedImage->ImageSize)))) {
|
||||
//
|
||||
// If the EntryPoint is not in the range of image buffer, it should come from emulation environment.
|
||||
// So patch ImageBuffer here to align the EntryPoint.
|
||||
@ -320,9 +323,9 @@ GetSmmLoadedImage(
|
||||
RealImageBase = (UINTN)LoadedImage->ImageBase + EntryPoint - (UINTN)EntryPointInImage;
|
||||
}
|
||||
}
|
||||
DEBUG ((DEBUG_INFO, "(0x%x - 0x%x", RealImageBase, (UINTN)LoadedImage->ImageSize));
|
||||
DEBUG ((DEBUG_INFO, "(0x%lx - 0x%lx", RealImageBase, LoadedImage->ImageSize));
|
||||
if (EntryPoint != 0) {
|
||||
DEBUG ((DEBUG_INFO, ", EntryPoint:0x%x", EntryPoint));
|
||||
DEBUG ((DEBUG_INFO, ", EntryPoint:0x%lx", EntryPoint));
|
||||
}
|
||||
DEBUG ((DEBUG_INFO, ")\n"));
|
||||
|
||||
@ -334,7 +337,7 @@ GetSmmLoadedImage(
|
||||
}
|
||||
DEBUG ((DEBUG_INFO, " (%s)\n", PathStr));
|
||||
|
||||
AddImageStruct((UINTN)RealImageBase, (UINTN)LoadedImage->ImageSize, EntryPoint, &Guid, PdbString);
|
||||
AddImageStruct(RealImageBase, LoadedImage->ImageSize, EntryPoint, &Guid, PdbString);
|
||||
}
|
||||
|
||||
Done:
|
||||
@ -356,8 +359,10 @@ DumpSmiChildContext (
|
||||
IN UINTN ContextSize
|
||||
)
|
||||
{
|
||||
CHAR16 *Str;
|
||||
|
||||
if (CompareGuid (HandlerType, &gEfiSmmSwDispatch2ProtocolGuid)) {
|
||||
DEBUG ((DEBUG_INFO, " SwSmi - 0x%x\n", ((EFI_SMM_SW_REGISTER_CONTEXT *)Context)->SwSmiInputValue));
|
||||
DEBUG ((DEBUG_INFO, " SwSmi - 0x%lx\n", ((SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT *)Context)->SwSmiInputValue));
|
||||
} else if (CompareGuid (HandlerType, &gEfiSmmSxDispatch2ProtocolGuid)) {
|
||||
DEBUG ((DEBUG_INFO, " SxType - 0x%x\n", ((EFI_SMM_SX_REGISTER_CONTEXT *)Context)->Type));
|
||||
DEBUG ((DEBUG_INFO, " SxPhase - 0x%x\n", ((EFI_SMM_SX_REGISTER_CONTEXT *)Context)->Phase));
|
||||
@ -376,7 +381,11 @@ DumpSmiChildContext (
|
||||
DEBUG ((DEBUG_INFO, " IoTrapType - 0x%x\n", ((EFI_SMM_IO_TRAP_REGISTER_CONTEXT *)Context)->Type));
|
||||
} else if (CompareGuid (HandlerType, &gEfiSmmUsbDispatch2ProtocolGuid)) {
|
||||
DEBUG ((DEBUG_INFO, " UsbType - 0x%x\n", ((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT *)Context)->Type));
|
||||
DEBUG ((DEBUG_INFO, " UsbDevicePath - %s\n", ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL *)(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT *)Context) + 1), TRUE, TRUE)));
|
||||
Str = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL *)(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT *)Context) + 1), TRUE, TRUE);
|
||||
DEBUG ((DEBUG_INFO, " UsbDevicePath - %s\n", Str));
|
||||
if (Str != NULL) {
|
||||
FreePool (Str);
|
||||
}
|
||||
} else {
|
||||
DEBUG ((DEBUG_INFO, " Context - "));
|
||||
InternalDumpData (Context, ContextSize);
|
||||
@ -416,12 +425,12 @@ DumpSmiHandlerOnSmiEntry(
|
||||
}
|
||||
DEBUG ((DEBUG_INFO, " Handler - 0x%x", SmiHandler->Handler));
|
||||
if (ImageStruct != NULL) {
|
||||
DEBUG ((DEBUG_INFO, " <== RVA - 0x%x", (UINTN)SmiHandler->Handler - ImageStruct->ImageBase));
|
||||
DEBUG ((DEBUG_INFO, " <== RVA - 0x%x", (UINTN)SmiHandler->Handler - (UINTN) ImageStruct->ImageBase));
|
||||
}
|
||||
DEBUG ((DEBUG_INFO, "\n"));
|
||||
DEBUG ((DEBUG_INFO, " CallerAddr - 0x%x", SmiHandler->CallerAddr));
|
||||
if (ImageStruct != NULL) {
|
||||
DEBUG ((DEBUG_INFO, " <== RVA - 0x%x", SmiHandler->CallerAddr - ImageStruct->ImageBase));
|
||||
DEBUG ((DEBUG_INFO, " <== RVA - 0x%x", SmiHandler->CallerAddr - (UINTN) ImageStruct->ImageBase));
|
||||
}
|
||||
DEBUG ((DEBUG_INFO, "\n"));
|
||||
}
|
||||
@ -527,11 +536,11 @@ GetSmmImageDatabaseSize(
|
||||
)
|
||||
{
|
||||
UINTN Size;
|
||||
UINTN Index;
|
||||
UINT32 Index;
|
||||
|
||||
Size = (sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE)) * mImageStructCount;
|
||||
Size = 0;
|
||||
for (Index = 0; Index < mImageStructCount; Index++) {
|
||||
Size += mImageStruct[Index].PdbStringSize;
|
||||
Size += sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE) + GET_OCCUPIED_SIZE (mImageStruct[Index].PdbStringSize, sizeof (UINT64));
|
||||
}
|
||||
return Size;
|
||||
}
|
||||
@ -558,7 +567,7 @@ GetSmmSmiHandlerSizeOnSmiEntry(
|
||||
ListEntry != &SmiEntry->SmiHandlers;
|
||||
ListEntry = ListEntry->ForwardLink) {
|
||||
SmiHandler = CR(ListEntry, SMI_HANDLER, Link, SMI_HANDLER_SIGNATURE);
|
||||
Size += sizeof(SMM_CORE_SMI_HANDLER_STRUCTURE) + SmiHandler->ContextSize;
|
||||
Size += sizeof(SMM_CORE_SMI_HANDLER_STRUCTURE) + GET_OCCUPIED_SIZE (SmiHandler->ContextSize, sizeof (UINT64));
|
||||
}
|
||||
|
||||
return Size;
|
||||
@ -634,21 +643,25 @@ GetSmmImageDatabaseData (
|
||||
if (Size >= ExpectedSize) {
|
||||
return 0;
|
||||
}
|
||||
if (sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE) + mImageStruct[Index].PdbStringSize > ExpectedSize - Size) {
|
||||
if (sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE) + GET_OCCUPIED_SIZE (mImageStruct[Index].PdbStringSize, sizeof (UINT64)) > ExpectedSize - Size) {
|
||||
return 0;
|
||||
}
|
||||
ImageStruct->Header.Signature = SMM_CORE_IMAGE_DATABASE_SIGNATURE;
|
||||
ImageStruct->Header.Length = (UINT32)(sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE) + mImageStruct[Index].PdbStringSize);
|
||||
ImageStruct->Header.Length = (UINT32)(sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE) + GET_OCCUPIED_SIZE (mImageStruct[Index].PdbStringSize, sizeof (UINT64)));
|
||||
ImageStruct->Header.Revision = SMM_CORE_IMAGE_DATABASE_REVISION;
|
||||
CopyGuid(&ImageStruct->FileGuid, &mImageStruct[Index].FileGuid);
|
||||
ImageStruct->ImageRef = mImageStruct[Index].ImageRef;
|
||||
ImageStruct->EntryPoint = mImageStruct[Index].EntryPoint;
|
||||
ImageStruct->ImageBase = mImageStruct[Index].ImageBase;
|
||||
ImageStruct->ImageSize = mImageStruct[Index].ImageSize;
|
||||
ImageStruct->PdbStringOffset = sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE);
|
||||
CopyMem ((VOID *)((UINTN)ImageStruct + ImageStruct->PdbStringOffset), mImageStruct[Index].PdbString, mImageStruct[Index].PdbStringSize);
|
||||
if (mImageStruct[Index].PdbStringSize != 0) {
|
||||
ImageStruct->PdbStringOffset = sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE);
|
||||
CopyMem ((VOID *)((UINTN)ImageStruct + ImageStruct->PdbStringOffset), mImageStruct[Index].PdbString, mImageStruct[Index].PdbStringSize);
|
||||
} else {
|
||||
ImageStruct->PdbStringOffset = 0;
|
||||
}
|
||||
ImageStruct = (SMM_CORE_IMAGE_DATABASE_STRUCTURE *)((UINTN)ImageStruct + ImageStruct->Header.Length);
|
||||
Size += sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE) + mImageStruct[Index].PdbStringSize;
|
||||
Size += sizeof(SMM_CORE_IMAGE_DATABASE_STRUCTURE) + GET_OCCUPIED_SIZE (mImageStruct[Index].PdbStringSize, sizeof (UINT64));
|
||||
}
|
||||
|
||||
if (ExpectedSize != Size) {
|
||||
@ -672,7 +685,7 @@ GetSmmSmiHandlerDataOnSmiEntry(
|
||||
IN SMI_ENTRY *SmiEntry,
|
||||
IN OUT VOID *Data,
|
||||
IN UINTN MaxSize,
|
||||
OUT UINTN *Count
|
||||
OUT UINT32 *Count
|
||||
)
|
||||
{
|
||||
SMM_CORE_SMI_HANDLER_STRUCTURE *SmiHandlerStruct;
|
||||
@ -692,11 +705,11 @@ GetSmmSmiHandlerDataOnSmiEntry(
|
||||
*Count = 0;
|
||||
return 0;
|
||||
}
|
||||
if (sizeof(SMM_CORE_SMI_HANDLER_STRUCTURE) + SmiHandler->ContextSize > MaxSize - Size) {
|
||||
if (sizeof(SMM_CORE_SMI_HANDLER_STRUCTURE) + GET_OCCUPIED_SIZE (SmiHandler->ContextSize, sizeof (UINT64)) > MaxSize - Size) {
|
||||
*Count = 0;
|
||||
return 0;
|
||||
}
|
||||
SmiHandlerStruct->Length = (UINT32)(sizeof(SMM_CORE_SMI_HANDLER_STRUCTURE) + SmiHandler->ContextSize);
|
||||
SmiHandlerStruct->Length = (UINT32)(sizeof(SMM_CORE_SMI_HANDLER_STRUCTURE) + GET_OCCUPIED_SIZE (SmiHandler->ContextSize, sizeof (UINT64)));
|
||||
SmiHandlerStruct->CallerAddr = (UINTN)SmiHandler->CallerAddr;
|
||||
SmiHandlerStruct->Handler = (UINTN)SmiHandler->Handler;
|
||||
SmiHandlerStruct->ImageRef = AddressToImageRef((UINTN)SmiHandler->Handler);
|
||||
@ -707,7 +720,7 @@ GetSmmSmiHandlerDataOnSmiEntry(
|
||||
} else {
|
||||
SmiHandlerStruct->ContextBufferOffset = 0;
|
||||
}
|
||||
Size += sizeof(SMM_CORE_SMI_HANDLER_STRUCTURE) + SmiHandler->ContextSize;
|
||||
Size += sizeof(SMM_CORE_SMI_HANDLER_STRUCTURE) + GET_OCCUPIED_SIZE (SmiHandler->ContextSize, sizeof (UINT64));
|
||||
SmiHandlerStruct = (SMM_CORE_SMI_HANDLER_STRUCTURE *)((UINTN)SmiHandlerStruct + SmiHandlerStruct->Length);
|
||||
*Count = *Count + 1;
|
||||
}
|
||||
@ -738,7 +751,7 @@ GetSmmSmiDatabaseData(
|
||||
SMI_ENTRY *SmiEntry;
|
||||
UINTN Size;
|
||||
UINTN SmiHandlerSize;
|
||||
UINTN SmiHandlerCount;
|
||||
UINT32 SmiHandlerCount;
|
||||
|
||||
SmiStruct = Data;
|
||||
Size = 0;
|
||||
@ -1122,6 +1135,36 @@ ConvertSmiHandlerUsbContext (
|
||||
return SmiHandlerUsbContext;
|
||||
}
|
||||
|
||||
/**
|
||||
Convert EFI_SMM_SW_REGISTER_CONTEXT to SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT.
|
||||
|
||||
@param SwContext A pointer to EFI_SMM_SW_REGISTER_CONTEXT
|
||||
@param SwContextSize The size of EFI_SMM_SW_REGISTER_CONTEXT in bytes
|
||||
@param SmiHandlerSwContextSize The size of SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT in bytes
|
||||
|
||||
@return SmiHandlerSwContext A pointer to SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT
|
||||
**/
|
||||
SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT *
|
||||
ConvertSmiHandlerSwContext (
|
||||
IN EFI_SMM_SW_REGISTER_CONTEXT *SwContext,
|
||||
IN UINTN SwContextSize,
|
||||
OUT UINTN *SmiHandlerSwContextSize
|
||||
)
|
||||
{
|
||||
SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT *SmiHandlerSwContext;
|
||||
|
||||
ASSERT (SwContextSize == sizeof(EFI_SMM_SW_REGISTER_CONTEXT));
|
||||
|
||||
SmiHandlerSwContext = AllocatePool (sizeof (SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT));
|
||||
if (SmiHandlerSwContext == NULL) {
|
||||
*SmiHandlerSwContextSize = 0;
|
||||
return NULL;
|
||||
}
|
||||
SmiHandlerSwContext->SwSmiInputValue = SwContext->SwSmiInputValue;
|
||||
*SmiHandlerSwContextSize = sizeof (SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT);
|
||||
return SmiHandlerSwContext;
|
||||
}
|
||||
|
||||
/**
|
||||
This function is called by SmmChildDispatcher module to report
|
||||
a new SMI handler is registered, to SmmCore.
|
||||
@ -1176,6 +1219,8 @@ SmiHandlerProfileRegisterHandler (
|
||||
if (Context != NULL) {
|
||||
if (CompareGuid (HandlerGuid, &gEfiSmmUsbDispatch2ProtocolGuid)) {
|
||||
SmiHandler->Context = ConvertSmiHandlerUsbContext (Context, ContextSize, &SmiHandler->ContextSize);
|
||||
} else if (CompareGuid (HandlerGuid, &gEfiSmmSwDispatch2ProtocolGuid)) {
|
||||
SmiHandler->Context = ConvertSmiHandlerSwContext (Context, ContextSize, &SmiHandler->ContextSize);
|
||||
} else {
|
||||
SmiHandler->Context = AllocateCopyPool (ContextSize, Context);
|
||||
}
|
||||
@ -1251,6 +1296,8 @@ SmiHandlerProfileUnregisterHandler (
|
||||
if (Context != NULL) {
|
||||
if (CompareGuid (HandlerGuid, &gEfiSmmUsbDispatch2ProtocolGuid)) {
|
||||
SearchContext = ConvertSmiHandlerUsbContext (Context, ContextSize, &SearchContextSize);
|
||||
} else if (CompareGuid (HandlerGuid, &gEfiSmmSwDispatch2ProtocolGuid)) {
|
||||
SearchContext = ConvertSmiHandlerSwContext (Context, ContextSize, &SearchContextSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,12 +25,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include <Protocol/SmmSxDispatch2.h>
|
||||
#include <Protocol/SmmUsbDispatch2.h>
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct {
|
||||
UINT32 Signature;
|
||||
UINT32 Length;
|
||||
UINT32 Revision;
|
||||
UINT8 Reserved[4];
|
||||
} SMM_CORE_DATABASE_COMMON_HEADER;
|
||||
|
||||
#define SMM_CORE_IMAGE_DATABASE_SIGNATURE SIGNATURE_32 ('S','C','I','D')
|
||||
@ -39,12 +38,12 @@ typedef struct {
|
||||
typedef struct {
|
||||
SMM_CORE_DATABASE_COMMON_HEADER Header;
|
||||
EFI_GUID FileGuid;
|
||||
UINTN ImageRef;
|
||||
UINTN EntryPoint;
|
||||
UINTN ImageBase;
|
||||
UINTN ImageSize;
|
||||
PHYSICAL_ADDRESS EntryPoint;
|
||||
PHYSICAL_ADDRESS ImageBase;
|
||||
UINT64 ImageSize;
|
||||
UINT32 ImageRef;
|
||||
UINT16 PdbStringOffset;
|
||||
UINT8 Reserved2[6];
|
||||
UINT8 Reserved[2];
|
||||
//CHAR8 PdbString[];
|
||||
} SMM_CORE_IMAGE_DATABASE_STRUCTURE;
|
||||
|
||||
@ -64,7 +63,7 @@ typedef enum {
|
||||
// NULL
|
||||
// Context for SmmCoreSmiHandlerCategoryHardwareHandler:
|
||||
// (NOTE: The context field should NOT include any data pointer.)
|
||||
// gEfiSmmSwDispatch2ProtocolGuid: EFI_SMM_SW_REGISTER_CONTEXT
|
||||
// gEfiSmmSwDispatch2ProtocolGuid: (EFI_SMM_SW_REGISTER_CONTEXT => SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT)
|
||||
// gEfiSmmSxDispatch2ProtocolGuid: EFI_SMM_SX_REGISTER_CONTEXT
|
||||
// gEfiSmmPowerButtonDispatch2ProtocolGuid: EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT
|
||||
// gEfiSmmStandbyButtonDispatch2ProtocolGuid: EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT
|
||||
@ -81,21 +80,25 @@ typedef struct {
|
||||
} SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT;
|
||||
|
||||
typedef struct {
|
||||
UINT32 Length;
|
||||
UINTN CallerAddr;
|
||||
UINTN Handler;
|
||||
UINTN ImageRef;
|
||||
UINT16 ContextBufferOffset;
|
||||
UINT8 Reserved2[2];
|
||||
UINT32 ContextBufferSize;
|
||||
//UINT8 ContextBuffer[];
|
||||
UINT64 SwSmiInputValue;
|
||||
} SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT;
|
||||
|
||||
typedef struct {
|
||||
UINT32 Length;
|
||||
UINT32 ImageRef;
|
||||
PHYSICAL_ADDRESS CallerAddr;
|
||||
PHYSICAL_ADDRESS Handler;
|
||||
UINT16 ContextBufferOffset;
|
||||
UINT8 Reserved[2];
|
||||
UINT32 ContextBufferSize;
|
||||
//UINT8 ContextBuffer[];
|
||||
} SMM_CORE_SMI_HANDLER_STRUCTURE;
|
||||
|
||||
typedef struct {
|
||||
SMM_CORE_DATABASE_COMMON_HEADER Header;
|
||||
UINT32 HandlerCategory;
|
||||
EFI_GUID HandlerType;
|
||||
UINTN HandlerCount;
|
||||
UINT32 HandlerCategory;
|
||||
UINT32 HandlerCount;
|
||||
//SMM_CORE_SMI_HANDLER_STRUCTURE Handler[HandlerCount];
|
||||
} SMM_CORE_SMI_DATABASE_STRUCTURE;
|
||||
|
||||
@ -144,8 +147,6 @@ typedef struct {
|
||||
|
||||
#define SMI_HANDLER_PROFILE_GUID {0x49174342, 0x7108, 0x409b, {0x8b, 0xbe, 0x65, 0xfd, 0xa8, 0x53, 0x89, 0xf5}}
|
||||
|
||||
#pragma pack()
|
||||
|
||||
extern EFI_GUID gSmiHandlerProfileGuid;
|
||||
|
||||
typedef struct _SMI_HANDLER_PROFILE_PROTOCOL SMI_HANDLER_PROFILE_PROTOCOL;
|
||||
|
@ -1302,7 +1302,7 @@ BootMaintCallback (
|
||||
} else if ((QuestionId >= CON_OUT_DEVICE_QUESTION_ID) && (QuestionId < CON_OUT_DEVICE_QUESTION_ID + MAX_MENU_NUMBER)) {
|
||||
UpdateConsoleContent (L"ConOut", CurrentFakeNVMap);
|
||||
} else if ((QuestionId >= CON_ERR_DEVICE_QUESTION_ID) && (QuestionId < CON_ERR_DEVICE_QUESTION_ID + MAX_MENU_NUMBER)) {
|
||||
UpdateConsoleContent (L"ConErr", CurrentFakeNVMap);
|
||||
UpdateConsoleContent (L"ErrOut", CurrentFakeNVMap);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1031,6 +1031,7 @@ GetConsoleInCheck (
|
||||
BM_MENU_ENTRY *NewMenuEntry;
|
||||
UINT8 *ConInCheck;
|
||||
BM_CONSOLE_CONTEXT *NewConsoleContext;
|
||||
BM_TERMINAL_CONTEXT *NewTerminalContext;
|
||||
|
||||
ASSERT (CallbackData != NULL);
|
||||
|
||||
@ -1041,6 +1042,13 @@ GetConsoleInCheck (
|
||||
NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
ConInCheck[Index] = NewConsoleContext->IsActive;
|
||||
}
|
||||
|
||||
for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
|
||||
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
|
||||
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
ASSERT (Index + ConsoleInpMenu.MenuNumber < MAX_MENU_NUMBER);
|
||||
ConInCheck[Index + ConsoleInpMenu.MenuNumber] = NewTerminalContext->IsConIn;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1060,6 +1068,7 @@ GetConsoleOutCheck (
|
||||
BM_MENU_ENTRY *NewMenuEntry;
|
||||
UINT8 *ConOutCheck;
|
||||
BM_CONSOLE_CONTEXT *NewConsoleContext;
|
||||
BM_TERMINAL_CONTEXT *NewTerminalContext;
|
||||
|
||||
ASSERT (CallbackData != NULL);
|
||||
ConOutCheck = &CallbackData->BmmFakeNvData.ConsoleOutCheck[0];
|
||||
@ -1069,6 +1078,13 @@ GetConsoleOutCheck (
|
||||
NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
ConOutCheck[Index] = NewConsoleContext->IsActive;
|
||||
}
|
||||
|
||||
for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
|
||||
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
|
||||
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
ASSERT (Index + ConsoleOutMenu.MenuNumber < MAX_MENU_NUMBER);
|
||||
ConOutCheck[Index + ConsoleOutMenu.MenuNumber] = NewTerminalContext->IsConOut;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1088,6 +1104,7 @@ GetConsoleErrCheck (
|
||||
BM_MENU_ENTRY *NewMenuEntry;
|
||||
UINT8 *ConErrCheck;
|
||||
BM_CONSOLE_CONTEXT *NewConsoleContext;
|
||||
BM_TERMINAL_CONTEXT *NewTerminalContext;
|
||||
|
||||
ASSERT (CallbackData != NULL);
|
||||
ConErrCheck = &CallbackData->BmmFakeNvData.ConsoleErrCheck[0];
|
||||
@ -1097,6 +1114,13 @@ GetConsoleErrCheck (
|
||||
NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
ConErrCheck[Index] = NewConsoleContext->IsActive;
|
||||
}
|
||||
|
||||
for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
|
||||
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
|
||||
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
|
||||
ASSERT (Index + ConsoleErrMenu.MenuNumber < MAX_MENU_NUMBER);
|
||||
ConErrCheck[Index + ConsoleErrMenu.MenuNumber] = NewTerminalContext->IsStdErr;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -126,6 +126,7 @@ BrotliDecompress (
|
||||
BrotliState * BroState;
|
||||
VOID * Temp;
|
||||
|
||||
TotalOut = 0;
|
||||
AvailableOut = FILE_BUFFER_SIZE;
|
||||
Result = BROTLI_RESULT_ERROR;
|
||||
BroState = BrotliCreateState(BrAlloc, BrFree, BuffInfo);
|
||||
|
@ -802,6 +802,7 @@ static BROTLI_INLINE uint32_t ReadBlockLength(const HuffmanCode* table,
|
||||
uint32_t code;
|
||||
uint32_t nbits;
|
||||
code = ReadSymbol(table, br);
|
||||
if (code >= BROTLI_NUM_BLOCK_LEN_SYMBOLS) code = BROTLI_NUM_BLOCK_LEN_SYMBOLS - 1;
|
||||
nbits = kBlockLengthPrefixCode[code].nbits; /* nbits == 2..24 */
|
||||
return kBlockLengthPrefixCode[code].offset + BrotliReadBits(br, nbits);
|
||||
}
|
||||
@ -854,6 +855,7 @@ static BROTLI_NOINLINE void InverseMoveToFrontTransform(
|
||||
uint32_t i = 4;
|
||||
uint32_t upper_bound = state->mtf_upper_bound;
|
||||
uint8_t* mtf = &state->mtf[4]; /* Make mtf[-1] addressable. */
|
||||
uint8_t* mtft = &state->mtf[3];
|
||||
/* Load endian-aware constant. */
|
||||
const uint8_t b0123[4] = {0, 1, 2, 3};
|
||||
uint32_t pattern;
|
||||
@ -872,13 +874,13 @@ static BROTLI_NOINLINE void InverseMoveToFrontTransform(
|
||||
for (i = 0; i < v_len; ++i) {
|
||||
int index = v[i];
|
||||
uint8_t value = mtf[index];
|
||||
upper_bound |= v[i];
|
||||
upper_bound |= (uint32_t)v[i];
|
||||
v[i] = value;
|
||||
mtf[-1] = value;
|
||||
do {
|
||||
mtft[0] = value;
|
||||
while (index >= 0) {
|
||||
mtft[index + 1] = mtft[index];
|
||||
index--;
|
||||
mtf[index + 1] = mtf[index];
|
||||
} while (index >= 0);
|
||||
}
|
||||
}
|
||||
/* Remember amount of elements to be reinitialized. */
|
||||
state->mtf_upper_bound = upper_bound;
|
||||
@ -1498,6 +1500,7 @@ static BROTLI_INLINE BROTLI_BOOL ReadCommandInternal(
|
||||
return BROTLI_FALSE;
|
||||
}
|
||||
}
|
||||
if (cmd_code >= BROTLI_NUM_COMMAND_SYMBOLS) cmd_code = BROTLI_NUM_COMMAND_SYMBOLS - 1;
|
||||
v = kCmdLut[cmd_code];
|
||||
s->distance_code = v.distance_code;
|
||||
s->distance_context = v.context;
|
||||
@ -2209,7 +2212,9 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
|
||||
}
|
||||
s->max_distance = s->max_backward_distance;
|
||||
if (s->state == BROTLI_STATE_COMMAND_POST_WRITE_1) {
|
||||
memcpy(s->ringbuffer, s->ringbuffer_end, (size_t)s->pos);
|
||||
if (s->ringbuffer != 0) {
|
||||
memcpy(s->ringbuffer, s->ringbuffer_end, (size_t)s->pos);
|
||||
}
|
||||
if (s->meta_block_remaining_len == 0) {
|
||||
/* Next metablock, if any */
|
||||
s->state = BROTLI_STATE_METABLOCK_DONE;
|
||||
|
@ -540,9 +540,12 @@ CreateDeviceManagerForm(
|
||||
// Update the network device form titile.
|
||||
//
|
||||
if (NextShowFormId == NETWORK_DEVICE_FORM_ID) {
|
||||
String = HiiGetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NULL);
|
||||
NewStringLen = StrLen(mSelectedMacAddrString) * 2;
|
||||
NewStringLen += (StrLen(String) + 2) * 2;
|
||||
String = HiiGetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE_HEAD), NULL);
|
||||
if (String == NULL) {
|
||||
return;
|
||||
}
|
||||
NewStringLen = StrLen (mSelectedMacAddrString) * 2;
|
||||
NewStringLen += (StrLen (String) + 2) * 2;
|
||||
NewStringTitle = AllocatePool (NewStringLen);
|
||||
UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, mSelectedMacAddrString);
|
||||
HiiSetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL);
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// String definitions for the Device Manager.
|
||||
//
|
||||
// Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
// which accompanies this distribution. The full text of the license may be found at
|
||||
@ -42,7 +42,8 @@
|
||||
#language fr-FR ""
|
||||
#string STR_EXIT_STRING #language en-US "Press ESC to exit."
|
||||
#language fr-FR "Press ESC to exit."
|
||||
#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US "Network Device"
|
||||
#string STR_FORM_NETWORK_DEVICE_TITLE_HEAD #language en-US "Network Device"
|
||||
#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US "Network Device"
|
||||
#language fr-FR "Network Device"
|
||||
#string STR_FORM_NETWORK_DEVICE_HELP #language en-US "Network Device Help..."
|
||||
#language fr-FR "Network Device Help..."
|
||||
|
@ -1028,6 +1028,12 @@ IpIoListenHandlerDpc (
|
||||
}
|
||||
|
||||
if (IpIo->IpVersion == IP_VERSION_4) {
|
||||
if (IP4_IS_LOCAL_BROADCAST (EFI_IP4 (RxData->Ip4RxData.Header->SourceAddress))) {
|
||||
//
|
||||
// The source address is a broadcast address, discard it.
|
||||
//
|
||||
goto CleanUp;
|
||||
}
|
||||
if ((EFI_IP4 (RxData->Ip4RxData.Header->SourceAddress) != 0) &&
|
||||
(IpIo->SubnetMask != 0) &&
|
||||
IP4_NET_EQUAL (IpIo->StationIp, EFI_NTOHL (((EFI_IP4_RECEIVE_DATA *) RxData)->Header->SourceAddress), IpIo->SubnetMask) &&
|
||||
|
@ -1546,26 +1546,35 @@ BmGetNextLoadOptionDevicePath (
|
||||
//
|
||||
return BmExpandUriDevicePath (FilePath, FullPath);
|
||||
} else {
|
||||
for (Node = FilePath; !IsDevicePathEnd (Node); Node = NextDevicePathNode (Node)) {
|
||||
if ((DevicePathType (Node) == MESSAGING_DEVICE_PATH) &&
|
||||
((DevicePathSubType (Node) == MSG_USB_CLASS_DP) || (DevicePathSubType (Node) == MSG_USB_WWID_DP))) {
|
||||
break;
|
||||
Node = FilePath;
|
||||
Status = gBS->LocateDevicePath (&gEfiUsbIoProtocolGuid, &Node, &Handle);
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// Only expand the USB WWID/Class device path
|
||||
// when FilePath doesn't point to a physical UsbIo controller.
|
||||
// Otherwise, infinite recursion will happen.
|
||||
//
|
||||
for (Node = FilePath; !IsDevicePathEnd (Node); Node = NextDevicePathNode (Node)) {
|
||||
if ((DevicePathType (Node) == MESSAGING_DEVICE_PATH) &&
|
||||
((DevicePathSubType (Node) == MSG_USB_CLASS_DP) || (DevicePathSubType (Node) == MSG_USB_WWID_DP))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Expand the USB WWID/Class device path
|
||||
//
|
||||
if (!IsDevicePathEnd (Node)) {
|
||||
if (FilePath == Node) {
|
||||
//
|
||||
// Boot Option device path starts with USB Class or USB WWID device path.
|
||||
// For Boot Option device path which doesn't begin with the USB Class or
|
||||
// USB WWID device path, it's not needed to connect again here.
|
||||
//
|
||||
BmConnectUsbShortFormDevicePath (FilePath);
|
||||
//
|
||||
// Expand the USB WWID/Class device path
|
||||
//
|
||||
if (!IsDevicePathEnd (Node)) {
|
||||
if (FilePath == Node) {
|
||||
//
|
||||
// Boot Option device path starts with USB Class or USB WWID device path.
|
||||
// For Boot Option device path which doesn't begin with the USB Class or
|
||||
// USB WWID device path, it's not needed to connect again here.
|
||||
//
|
||||
BmConnectUsbShortFormDevicePath (FilePath);
|
||||
}
|
||||
return BmExpandUsbDevicePath (FilePath, FullPath, Node);
|
||||
}
|
||||
return BmExpandUsbDevicePath (FilePath, FullPath, Node);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -382,13 +382,13 @@ BmGetNetworkDescription (
|
||||
|
||||
//
|
||||
// The PXE device path is like:
|
||||
// ....../Mac(...)[/Vlan(...)]
|
||||
// ....../Mac(...)[/Vlan(...)]/IPv4(...)
|
||||
// ....../Mac(...)[/Vlan(...)]/IPv6(...)
|
||||
// ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]
|
||||
// ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)
|
||||
// ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)
|
||||
//
|
||||
// The HTTP device path is like:
|
||||
// ....../Mac(...)[/Vlan(...)]/IPv4(...)/Uri(...)
|
||||
// ....../Mac(...)[/Vlan(...)]/IPv6(...)/Uri(...)
|
||||
// ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)/Uri(...)
|
||||
// ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)/Uri(...)
|
||||
//
|
||||
while (!IsDevicePathEnd (DevicePath) &&
|
||||
((DevicePathType (DevicePath) != MESSAGING_DEVICE_PATH) ||
|
||||
@ -404,6 +404,9 @@ BmGetNetworkDescription (
|
||||
Mac = (MAC_ADDR_DEVICE_PATH *) DevicePath;
|
||||
DevicePath = NextDevicePathNode (DevicePath);
|
||||
|
||||
//
|
||||
// Locate the optional Vlan node
|
||||
//
|
||||
if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
|
||||
(DevicePathSubType (DevicePath) == MSG_VLAN_DP)
|
||||
) {
|
||||
@ -413,6 +416,18 @@ BmGetNetworkDescription (
|
||||
Vlan = NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// Skip the optional Wi-Fi node
|
||||
//
|
||||
if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
|
||||
(DevicePathSubType (DevicePath) == MSG_WIFI_DP)
|
||||
) {
|
||||
DevicePath = NextDevicePathNode (DevicePath);
|
||||
}
|
||||
|
||||
//
|
||||
// Locate the IP node
|
||||
//
|
||||
if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
|
||||
((DevicePathSubType (DevicePath) == MSG_IPv4_DP) ||
|
||||
(DevicePathSubType (DevicePath) == MSG_IPv6_DP))
|
||||
@ -423,6 +438,9 @@ BmGetNetworkDescription (
|
||||
Ip = NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// Locate the URI node
|
||||
//
|
||||
if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&
|
||||
(DevicePathSubType (DevicePath) == MSG_URI_DP)
|
||||
) {
|
||||
|
@ -42,7 +42,7 @@ VOID *mBmTxtInExRegistration = NULL;
|
||||
**/
|
||||
UINTN
|
||||
BmSizeOfKeyOption (
|
||||
EFI_BOOT_MANAGER_KEY_OPTION *KeyOption
|
||||
IN CONST EFI_BOOT_MANAGER_KEY_OPTION *KeyOption
|
||||
)
|
||||
{
|
||||
return OFFSET_OF (EFI_BOOT_MANAGER_KEY_OPTION, Keys)
|
||||
@ -61,8 +61,8 @@ BmSizeOfKeyOption (
|
||||
**/
|
||||
BOOLEAN
|
||||
BmIsKeyOptionValid (
|
||||
IN EFI_BOOT_MANAGER_KEY_OPTION *KeyOption,
|
||||
IN UINTN KeyOptionSize
|
||||
IN CONST EFI_BOOT_MANAGER_KEY_OPTION *KeyOption,
|
||||
IN UINTN KeyOptionSize
|
||||
)
|
||||
{
|
||||
UINT16 OptionName[BM_OPTION_NAME_LEN];
|
||||
@ -158,16 +158,15 @@ BmCollectKeyOptions (
|
||||
{
|
||||
UINTN Index;
|
||||
BM_COLLECT_KEY_OPTIONS_PARAM *Param;
|
||||
EFI_BOOT_MANAGER_KEY_OPTION *KeyOption;
|
||||
VOID *KeyOption;
|
||||
UINT16 OptionNumber;
|
||||
UINTN KeyOptionSize;
|
||||
|
||||
Param = (BM_COLLECT_KEY_OPTIONS_PARAM *) Context;
|
||||
|
||||
if (BmIsKeyOptionVariable (Name, Guid, &OptionNumber)) {
|
||||
GetEfiGlobalVariable2 (Name, (VOID**) &KeyOption, &KeyOptionSize);
|
||||
GetEfiGlobalVariable2 (Name, &KeyOption, &KeyOptionSize);
|
||||
ASSERT (KeyOption != NULL);
|
||||
KeyOption->OptionNumber = OptionNumber;
|
||||
if (BmIsKeyOptionValid (KeyOption, KeyOptionSize)) {
|
||||
Param->KeyOptions = ReallocatePool (
|
||||
Param->KeyOptionCount * sizeof (EFI_BOOT_MANAGER_KEY_OPTION),
|
||||
@ -179,12 +178,13 @@ BmCollectKeyOptions (
|
||||
// Insert the key option in order
|
||||
//
|
||||
for (Index = 0; Index < Param->KeyOptionCount; Index++) {
|
||||
if (KeyOption->OptionNumber < Param->KeyOptions[Index].OptionNumber) {
|
||||
if (OptionNumber < Param->KeyOptions[Index].OptionNumber) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
CopyMem (&Param->KeyOptions[Index + 1], &Param->KeyOptions[Index], (Param->KeyOptionCount - Index) * sizeof (EFI_BOOT_MANAGER_KEY_OPTION));
|
||||
CopyMem (&Param->KeyOptions[Index], KeyOption, BmSizeOfKeyOption (KeyOption));
|
||||
CopyMem (&Param->KeyOptions[Index], KeyOption, KeyOptionSize);
|
||||
Param->KeyOptions[Index].OptionNumber = OptionNumber;
|
||||
Param->KeyOptionCount++;
|
||||
}
|
||||
FreePool (KeyOption);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Logo DXE Driver, install Edkii Platform Logo protocol.
|
||||
|
||||
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -133,7 +133,10 @@ InitializeLogo (
|
||||
NULL,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "HII Image Package with logo not found in PE/COFF resource section\n"));
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Publish HII package list to HII Database.
|
||||
|
@ -24,7 +24,7 @@
|
||||
PACKAGE_NAME = MdeModulePkg
|
||||
PACKAGE_UNI_FILE = MdeModulePkg.uni
|
||||
PACKAGE_GUID = BA0D78D6-2CAF-414b-BD4D-B6762A894288
|
||||
PACKAGE_VERSION = 0.96
|
||||
PACKAGE_VERSION = 0.97
|
||||
|
||||
[Includes]
|
||||
Include
|
||||
|
@ -2,7 +2,7 @@
|
||||
# EFI/PI Reference Module Package for All Architectures
|
||||
#
|
||||
# (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
|
||||
# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
@ -17,7 +17,7 @@
|
||||
[Defines]
|
||||
PLATFORM_NAME = MdeModule
|
||||
PLATFORM_GUID = 587CE499-6CBE-43cd-94E2-186218569478
|
||||
PLATFORM_VERSION = 0.96
|
||||
PLATFORM_VERSION = 0.97
|
||||
DSC_SPECIFICATION = 0x00010005
|
||||
OUTPUT_DIRECTORY = Build/MdeModule
|
||||
SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM|AARCH64
|
||||
|
@ -103,7 +103,7 @@ S3BootScriptExecutorEntryFunction (
|
||||
//
|
||||
// X64 S3 Resume
|
||||
//
|
||||
DEBUG ((EFI_D_ERROR, "Call AsmDisablePaging64() to return to S3 Resume in PEI Phase\n"));
|
||||
DEBUG ((DEBUG_INFO, "Call AsmDisablePaging64() to return to S3 Resume in PEI Phase\n"));
|
||||
PeiS3ResumeState->AsmTransferControl = (EFI_PHYSICAL_ADDRESS)(UINTN)AsmTransferControl32;
|
||||
|
||||
if ((Facs != NULL) &&
|
||||
@ -128,7 +128,7 @@ S3BootScriptExecutorEntryFunction (
|
||||
//
|
||||
// IA32 S3 Resume
|
||||
//
|
||||
DEBUG ((EFI_D_ERROR, "Call SwitchStack() to return to S3 Resume in PEI Phase\n"));
|
||||
DEBUG ((DEBUG_INFO, "Call SwitchStack() to return to S3 Resume in PEI Phase\n"));
|
||||
PeiS3ResumeState->AsmTransferControl = (EFI_PHYSICAL_ADDRESS)(UINTN)AsmTransferControl;
|
||||
|
||||
SwitchStack (
|
||||
@ -160,7 +160,7 @@ S3BootScriptExecutorEntryFunction (
|
||||
//
|
||||
// X64 long mode waking vector
|
||||
//
|
||||
DEBUG (( EFI_D_ERROR, "Transfer to 64bit OS waking vector - %x\r\n", (UINTN)Facs->XFirmwareWakingVector));
|
||||
DEBUG ((DEBUG_INFO, "Transfer to 64bit OS waking vector - %x\r\n", (UINTN)Facs->XFirmwareWakingVector));
|
||||
if (FeaturePcdGet (PcdDxeIplSwitchToLongMode)) {
|
||||
SwitchStack (
|
||||
(SWITCH_STACK_ENTRY_POINT)(UINTN)Facs->XFirmwareWakingVector,
|
||||
@ -177,7 +177,7 @@ S3BootScriptExecutorEntryFunction (
|
||||
//
|
||||
// IA32 protected mode waking vector (Page disabled)
|
||||
//
|
||||
DEBUG (( EFI_D_ERROR, "Transfer to 32bit OS waking vector - %x\r\n", (UINTN)Facs->XFirmwareWakingVector));
|
||||
DEBUG ((DEBUG_INFO, "Transfer to 32bit OS waking vector - %x\r\n", (UINTN)Facs->XFirmwareWakingVector));
|
||||
if (FeaturePcdGet (PcdDxeIplSwitchToLongMode)) {
|
||||
AsmDisablePaging64 (
|
||||
0x10,
|
||||
@ -199,7 +199,7 @@ S3BootScriptExecutorEntryFunction (
|
||||
//
|
||||
// 16bit Realmode waking vector
|
||||
//
|
||||
DEBUG (( EFI_D_ERROR, "Transfer to 16bit OS waking vector - %x\r\n", (UINTN)Facs->FirmwareWakingVector));
|
||||
DEBUG ((DEBUG_INFO, "Transfer to 16bit OS waking vector - %x\r\n", (UINTN)Facs->FirmwareWakingVector));
|
||||
AsmTransferControl (Facs->FirmwareWakingVector, 0x0);
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
Set a IDT entry for interrupt vector 3 for debug purpose for x64 platform
|
||||
|
||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
|
||||
|
||||
|
||||
@ -234,7 +234,7 @@ PageFaultHandler (
|
||||
UINTN PTIndex;
|
||||
|
||||
PFAddress = AsmReadCr2 ();
|
||||
DEBUG ((EFI_D_ERROR, "BootScript - PageFaultHandler: Cr2 - %lx\n", PFAddress));
|
||||
DEBUG ((DEBUG_INFO, "BootScript - PageFaultHandler: Cr2 - %lx\n", PFAddress));
|
||||
|
||||
if (PFAddress >= mPhyMask + SIZE_4KB) {
|
||||
return FALSE;
|
||||
|
@ -5,7 +5,7 @@
|
||||
for Firmware Basic Boot Performance Record and other boot performance records,
|
||||
and install FPDT to ACPI table.
|
||||
|
||||
Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -876,7 +876,7 @@ FirmwarePerformanceDxeEntryPoint (
|
||||
//
|
||||
// SEC Performance Data Hob not found, ResetEnd in ACPI FPDT table will be 0.
|
||||
//
|
||||
DEBUG ((EFI_D_ERROR, "FPDT: WARNING: SEC Performance Data Hob not found, ResetEnd will be set to 0!\n"));
|
||||
DEBUG ((DEBUG_WARN, "FPDT: WARNING: SEC Performance Data Hob not found, ResetEnd will be set to 0!\n"));
|
||||
}
|
||||
|
||||
if (FeaturePcdGet (PcdFirmwarePerformanceDataTableS3Support)) {
|
||||
|
@ -407,7 +407,7 @@ S3AllocatePageTablesBuffer (
|
||||
}
|
||||
|
||||
TotalPageTableSize += ExtraPageTablePages;
|
||||
DEBUG ((EFI_D_ERROR, "AcpiS3ContextSave TotalPageTableSize - 0x%x pages\n", TotalPageTableSize));
|
||||
DEBUG ((DEBUG_INFO, "AcpiS3ContextSave TotalPageTableSize - 0x%x pages\n", TotalPageTableSize));
|
||||
|
||||
//
|
||||
// By architecture only one PageMapLevel4 exists - so lets allocate storage for it.
|
||||
|
@ -763,7 +763,7 @@ GetCapsuleDescriptors (
|
||||
(VOID *) &CapsuleDataPtr64
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Capsule -- capsule variable not set\n"));
|
||||
DEBUG ((DEBUG_INFO, "Capsule -- capsule variable not set\n"));
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
//
|
||||
|
@ -2,7 +2,7 @@
|
||||
Create the variable to save the base address of page table and stack
|
||||
for transferring into long mode in IA32 capsule PEI.
|
||||
|
||||
Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -160,7 +160,7 @@ PrepareContextForCapsulePei (
|
||||
TotalPagesNum = NumberOfPml4EntriesNeeded + 1;
|
||||
}
|
||||
TotalPagesNum += ExtraPageTablePages;
|
||||
DEBUG ((EFI_D_ERROR, "CapsuleRuntimeDxe X64 TotalPagesNum - 0x%x pages\n", TotalPagesNum));
|
||||
DEBUG ((DEBUG_INFO, "CapsuleRuntimeDxe X64 TotalPagesNum - 0x%x pages\n", TotalPagesNum));
|
||||
|
||||
LongModeBuffer.PageTableAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateReservedMemoryBelow4G (EFI_PAGES_TO_SIZE (TotalPagesNum));
|
||||
ASSERT (LongModeBuffer.PageTableAddress != 0);
|
||||
|
@ -993,6 +993,49 @@ TerminalDriverBindingStop (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Compare a device path data structure to that of all the nodes of a
|
||||
second device path instance.
|
||||
|
||||
@param Multi A pointer to a multi-instance device path data structure.
|
||||
@param Single A pointer to a single-instance device path data structure.
|
||||
|
||||
@retval TRUE If the Single is contained within Multi.
|
||||
@retval FALSE The Single is not match within Multi.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
MatchDevicePaths (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *Multi,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *Single
|
||||
)
|
||||
{
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePathInst;
|
||||
UINTN Size;
|
||||
|
||||
DevicePath = Multi;
|
||||
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
|
||||
//
|
||||
// Search for the match of 'Single' in 'Multi'
|
||||
//
|
||||
while (DevicePathInst != NULL) {
|
||||
//
|
||||
// If the single device path is found in multiple device paths,
|
||||
// return success
|
||||
//
|
||||
if (CompareMem (Single, DevicePathInst, Size) == 0) {
|
||||
FreePool (DevicePathInst);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
FreePool (DevicePathInst);
|
||||
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Update terminal device path in Console Device Environment Variables.
|
||||
|
||||
@ -1018,8 +1061,12 @@ TerminalUpdateConsoleDevVariable (
|
||||
//
|
||||
// Get global variable and its size according to the name given.
|
||||
//
|
||||
GetEfiGlobalVariable2 (VariableName, (VOID**)&Variable, NULL);
|
||||
if (Variable == NULL) {
|
||||
Status = GetEfiGlobalVariable2 (VariableName, (VOID**)&Variable, NULL);
|
||||
if (Status == EFI_NOT_FOUND) {
|
||||
Status = EFI_SUCCESS;
|
||||
Variable = NULL;
|
||||
}
|
||||
if (EFI_ERROR (Status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1028,17 +1075,21 @@ TerminalUpdateConsoleDevVariable (
|
||||
//
|
||||
for (TerminalType = 0; TerminalType < ARRAY_SIZE (mTerminalType); TerminalType++) {
|
||||
SetTerminalDevicePath (TerminalType, ParentDevicePath, &TempDevicePath);
|
||||
NewVariable = AppendDevicePathInstance (Variable, TempDevicePath);
|
||||
ASSERT (NewVariable != NULL);
|
||||
if (Variable != NULL) {
|
||||
FreePool (Variable);
|
||||
}
|
||||
|
||||
if (TempDevicePath != NULL) {
|
||||
if (!MatchDevicePaths (Variable, TempDevicePath)) {
|
||||
NewVariable = AppendDevicePathInstance (Variable, TempDevicePath);
|
||||
if (NewVariable != NULL) {
|
||||
if (Variable != NULL) {
|
||||
FreePool (Variable);
|
||||
}
|
||||
Variable = NewVariable;
|
||||
}
|
||||
}
|
||||
|
||||
FreePool (TempDevicePath);
|
||||
}
|
||||
|
||||
Variable = NewVariable;
|
||||
}
|
||||
|
||||
VariableSize = GetDevicePathSize (Variable);
|
||||
|
@ -877,7 +877,7 @@ UpdateSkipInfoForMenu (
|
||||
CHAR16 *OutputString;
|
||||
UINT16 GlyphWidth;
|
||||
|
||||
Width = (UINT16) gOptionBlockWidth;
|
||||
Width = (UINT16) gOptionBlockWidth - 1;
|
||||
GlyphWidth = 1;
|
||||
Row = 1;
|
||||
|
||||
|
@ -105,7 +105,7 @@ GetImageIdOrAddress (
|
||||
case EFI_HII_IIBT_IMAGE_8BIT_TRANS:
|
||||
Length = sizeof (EFI_HII_IIBT_IMAGE_8BIT_BLOCK) - sizeof (UINT8) +
|
||||
BITMAP_LEN_8_BIT (
|
||||
ReadUnaligned16 (&((EFI_HII_IIBT_IMAGE_8BIT_BLOCK *) CurrentImageBlock)->Bitmap.Width),
|
||||
(UINT32) ReadUnaligned16 (&((EFI_HII_IIBT_IMAGE_8BIT_BLOCK *) CurrentImageBlock)->Bitmap.Width),
|
||||
ReadUnaligned16 (&((EFI_HII_IIBT_IMAGE_8BIT_BLOCK *) CurrentImageBlock)->Bitmap.Height)
|
||||
);
|
||||
ImageIdCurrent++;
|
||||
@ -115,7 +115,7 @@ GetImageIdOrAddress (
|
||||
case EFI_HII_IIBT_IMAGE_24BIT_TRANS:
|
||||
Length = sizeof (EFI_HII_IIBT_IMAGE_24BIT_BLOCK) - sizeof (EFI_HII_RGB_PIXEL) +
|
||||
BITMAP_LEN_24_BIT (
|
||||
ReadUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) CurrentImageBlock)->Bitmap.Width),
|
||||
(UINT32) ReadUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) CurrentImageBlock)->Bitmap.Width),
|
||||
ReadUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) CurrentImageBlock)->Bitmap.Height)
|
||||
);
|
||||
ImageIdCurrent++;
|
||||
@ -453,7 +453,7 @@ Output8bitPixel (
|
||||
// Convert the pixel from 8 bits to corresponding color.
|
||||
//
|
||||
for (Ypos = 0; Ypos < Image->Height; Ypos++) {
|
||||
OffsetY = BITMAP_LEN_8_BIT (Image->Width, Ypos);
|
||||
OffsetY = BITMAP_LEN_8_BIT ((UINT32) Image->Width, Ypos);
|
||||
//
|
||||
// All bits are meaningful since the bitmap is 8 bits per pixel.
|
||||
//
|
||||
@ -493,7 +493,7 @@ Output24bitPixel (
|
||||
BitMapPtr = Image->Bitmap;
|
||||
|
||||
for (Ypos = 0; Ypos < Image->Height; Ypos++) {
|
||||
OffsetY = BITMAP_LEN_8_BIT (Image->Width, Ypos);
|
||||
OffsetY = BITMAP_LEN_8_BIT ((UINT32) Image->Width, Ypos);
|
||||
CopyRgbToGopPixel (&BitMapPtr[OffsetY], &Data[OffsetY], Image->Width);
|
||||
}
|
||||
|
||||
@ -650,7 +650,7 @@ HiiNewImage (
|
||||
}
|
||||
|
||||
NewBlockSize = sizeof (EFI_HII_IIBT_IMAGE_24BIT_BLOCK) - sizeof (EFI_HII_RGB_PIXEL) +
|
||||
BITMAP_LEN_24_BIT (Image->Width, Image->Height);
|
||||
BITMAP_LEN_24_BIT ((UINT32) Image->Width, Image->Height);
|
||||
|
||||
//
|
||||
// Get the image package in the package list,
|
||||
@ -753,7 +753,7 @@ HiiNewImage (
|
||||
}
|
||||
WriteUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) ImageBlocks)->Bitmap.Width, Image->Width);
|
||||
WriteUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) ImageBlocks)->Bitmap.Height, Image->Height);
|
||||
CopyGopToRgbPixel (((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) ImageBlocks)->Bitmap.Bitmap, Image->Bitmap, Image->Width * Image->Height);
|
||||
CopyGopToRgbPixel (((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) ImageBlocks)->Bitmap.Bitmap, Image->Bitmap, (UINT32) Image->Width * Image->Height);
|
||||
|
||||
//
|
||||
// Append the block end
|
||||
@ -896,7 +896,7 @@ IGetImage (
|
||||
//
|
||||
CopyMem (&Iibt1bit, CurrentImageBlock, sizeof (EFI_HII_IIBT_IMAGE_1BIT_BLOCK));
|
||||
ImageLength = sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) *
|
||||
(Iibt1bit.Bitmap.Width * Iibt1bit.Bitmap.Height);
|
||||
((UINT32) Iibt1bit.Bitmap.Width * Iibt1bit.Bitmap.Height);
|
||||
Image->Bitmap = AllocateZeroPool (ImageLength);
|
||||
if (Image->Bitmap == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
@ -947,7 +947,7 @@ IGetImage (
|
||||
case EFI_HII_IIBT_IMAGE_24BIT:
|
||||
Width = ReadUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) CurrentImageBlock)->Bitmap.Width);
|
||||
Height = ReadUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) CurrentImageBlock)->Bitmap.Height);
|
||||
ImageLength = sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * (Width * Height);
|
||||
ImageLength = sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * ((UINT32) Width * Height);
|
||||
Image->Bitmap = AllocateZeroPool (ImageLength);
|
||||
if (Image->Bitmap == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
@ -1095,7 +1095,7 @@ HiiSetImage (
|
||||
case EFI_HII_IIBT_IMAGE_8BIT_TRANS:
|
||||
OldBlockSize = sizeof (EFI_HII_IIBT_IMAGE_8BIT_BLOCK) - sizeof (UINT8) +
|
||||
BITMAP_LEN_8_BIT (
|
||||
ReadUnaligned16 (&((EFI_HII_IIBT_IMAGE_8BIT_BLOCK *) CurrentImageBlock)->Bitmap.Width),
|
||||
(UINT32) ReadUnaligned16 (&((EFI_HII_IIBT_IMAGE_8BIT_BLOCK *) CurrentImageBlock)->Bitmap.Width),
|
||||
ReadUnaligned16 (&((EFI_HII_IIBT_IMAGE_8BIT_BLOCK *) CurrentImageBlock)->Bitmap.Height)
|
||||
);
|
||||
break;
|
||||
@ -1103,7 +1103,7 @@ HiiSetImage (
|
||||
case EFI_HII_IIBT_IMAGE_24BIT_TRANS:
|
||||
OldBlockSize = sizeof (EFI_HII_IIBT_IMAGE_24BIT_BLOCK) - sizeof (EFI_HII_RGB_PIXEL) +
|
||||
BITMAP_LEN_24_BIT (
|
||||
ReadUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) CurrentImageBlock)->Bitmap.Width),
|
||||
(UINT32) ReadUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) CurrentImageBlock)->Bitmap.Width),
|
||||
ReadUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) CurrentImageBlock)->Bitmap.Height)
|
||||
);
|
||||
break;
|
||||
@ -1115,7 +1115,7 @@ HiiSetImage (
|
||||
// Create the new image block according to input image.
|
||||
//
|
||||
NewBlockSize = sizeof (EFI_HII_IIBT_IMAGE_24BIT_BLOCK) - sizeof (EFI_HII_RGB_PIXEL) +
|
||||
BITMAP_LEN_24_BIT (Image->Width, Image->Height);
|
||||
BITMAP_LEN_24_BIT ((UINT32) Image->Width, Image->Height);
|
||||
//
|
||||
// Adjust the image package to remove the original block firstly then add the new block.
|
||||
//
|
||||
@ -1140,7 +1140,7 @@ HiiSetImage (
|
||||
WriteUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) NewImageBlock)->Bitmap.Width, Image->Width);
|
||||
WriteUnaligned16 ((VOID *) &((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) NewImageBlock)->Bitmap.Height, Image->Height);
|
||||
CopyGopToRgbPixel (((EFI_HII_IIBT_IMAGE_24BIT_BLOCK *) NewImageBlock)->Bitmap.Bitmap,
|
||||
Image->Bitmap, Image->Width * Image->Height);
|
||||
Image->Bitmap, (UINT32) Image->Width * Image->Height);
|
||||
|
||||
CopyMem ((UINT8 *) NewImageBlock + NewBlockSize, (UINT8 *) CurrentImageBlock + OldBlockSize, Part2Size);
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
SmmLockBoxHandler(), SmmLockBoxRestore(), SmmLockBoxUpdate(), SmmLockBoxSave()
|
||||
will receive untrusted input and do basic validation.
|
||||
|
||||
Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions
|
||||
@ -267,7 +267,7 @@ SmmLockBoxHandler (
|
||||
EFI_SMM_LOCK_BOX_PARAMETER_HEADER *LockBoxParameterHeader;
|
||||
UINTN TempCommBufferSize;
|
||||
|
||||
DEBUG ((EFI_D_ERROR, "SmmLockBox SmmLockBoxHandler Enter\n"));
|
||||
DEBUG ((DEBUG_INFO, "SmmLockBox SmmLockBoxHandler Enter\n"));
|
||||
|
||||
//
|
||||
// If input is invalid, stop processing this SMI
|
||||
@ -294,9 +294,9 @@ SmmLockBoxHandler (
|
||||
|
||||
LockBoxParameterHeader->ReturnStatus = (UINT64)-1;
|
||||
|
||||
DEBUG ((EFI_D_ERROR, "SmmLockBox LockBoxParameterHeader - %x\n", (UINTN)LockBoxParameterHeader));
|
||||
DEBUG ((DEBUG_INFO, "SmmLockBox LockBoxParameterHeader - %x\n", (UINTN)LockBoxParameterHeader));
|
||||
|
||||
DEBUG ((EFI_D_ERROR, "SmmLockBox Command - %x\n", (UINTN)LockBoxParameterHeader->Command));
|
||||
DEBUG ((DEBUG_INFO, "SmmLockBox Command - %x\n", (UINTN)LockBoxParameterHeader->Command));
|
||||
|
||||
switch (LockBoxParameterHeader->Command) {
|
||||
case EFI_SMM_LOCK_BOX_COMMAND_SAVE:
|
||||
@ -341,7 +341,7 @@ SmmLockBoxHandler (
|
||||
|
||||
LockBoxParameterHeader->Command = (UINT32)-1;
|
||||
|
||||
DEBUG ((EFI_D_ERROR, "SmmLockBox SmmLockBoxHandler Exit\n"));
|
||||
DEBUG ((DEBUG_INFO, "SmmLockBox SmmLockBoxHandler Exit\n"));
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Vfr file for IP4Dxe.
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -31,7 +31,7 @@ formset
|
||||
|
||||
checkbox varid = IP4_CONFIG2_IFR_NVDATA.Configure,
|
||||
prompt = STRING_TOKEN(STR_IP4_CONFIGURE),
|
||||
help = STRING_TOKEN(STR_IP4_CONFIGURE),
|
||||
help = STRING_TOKEN(STR_IP4_CONFIGURE_HELP),
|
||||
flags = INTERACTIVE,
|
||||
key = KEY_ENABLE,
|
||||
endcheckbox;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// String definitions for Ip4Config2 formset
|
||||
|
||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
// which accompanies this distribution. The full text of the license may be found at
|
||||
@ -22,6 +22,7 @@
|
||||
#string STR_IP4_DEVICE_FORM_TITLE #language en-US ""
|
||||
#string STR_IP4_DEVICE_FORM_HELP #language en-US ""
|
||||
#string STR_IP4_CONFIGURE #language en-US "Configured"
|
||||
#string STR_IP4_CONFIGURE_HELP #language en-US "Indicate whether network address configured successfully or not."
|
||||
#string STR_IP4_ENABLE_DHCP #language en-US "Enable DHCP"
|
||||
#string STR_IP4_LOCAL_IP_ADDRESS #language en-US "Local IP Address"
|
||||
#string STR_IP4_IP_ADDRESS_HELP #language en-US "Enter IP address in dotted-decimal notation. Example: 192.168.10.12\r\n"
|
||||
|
@ -855,7 +855,7 @@ Ip4OnArpResolvedDpc (
|
||||
|
||||
Status = Interface->Mnp->Transmit (Interface->Mnp, &Token->MnpToken);
|
||||
if (EFI_ERROR (Status)) {
|
||||
RemoveEntryList (Entry);
|
||||
RemoveEntryList (&Token->Link);
|
||||
Token->CallBack (Token->IpInstance, Token->Packet, Status, 0, Token->Context);
|
||||
|
||||
Ip4FreeLinkTxToken (Token);
|
||||
@ -1081,7 +1081,7 @@ SEND_NOW:
|
||||
InsertTailList (&Interface->SentFrames, &Token->Link);
|
||||
Status = Interface->Mnp->Transmit (Interface->Mnp, &Token->MnpToken);
|
||||
if (EFI_ERROR (Status)) {
|
||||
RemoveEntryList (&Interface->SentFrames);
|
||||
RemoveEntryList (&Token->Link);
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implementation of Managed Network Protocol private services.
|
||||
|
||||
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions
|
||||
of the BSD License which accompanies this distribution. The full
|
||||
@ -235,7 +235,7 @@ MnpAddFreeTxBuf (
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
for (Index = 0; Index < Count; Index++) {
|
||||
TxBufWrap = (MNP_TX_BUF_WRAP*) AllocatePool (sizeof (MNP_TX_BUF_WRAP) + MnpDeviceData->BufferLength - 1);
|
||||
TxBufWrap = (MNP_TX_BUF_WRAP*) AllocatePool (OFFSET_OF (MNP_TX_BUF_WRAP, TxBuf) + MnpDeviceData->BufferLength );
|
||||
if (TxBufWrap == NULL) {
|
||||
DEBUG ((EFI_D_ERROR, "MnpAddFreeTxBuf: TxBuf Alloc failed.\n"));
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
Interface routine for Mtftp4.
|
||||
|
||||
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -667,6 +667,10 @@ EfiMtftp4Configure (
|
||||
Gateway = NTOHL (Gateway);
|
||||
ServerIp = NTOHL (ServerIp);
|
||||
|
||||
if (ServerIp == 0 || IP4_IS_LOCAL_BROADCAST (ServerIp)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (!ConfigData->UseDefaultSetting &&
|
||||
((!IP4_IS_VALID_NETMASK (Netmask) || (Netmask != 0 && !NetIp4IsUnicast (Ip, Netmask))))) {
|
||||
|
||||
|
@ -162,15 +162,6 @@ SockDestroyChild (
|
||||
|
||||
ASSERT (Tcb != NULL);
|
||||
|
||||
Status = EfiAcquireLockOrFail (&(Sock->Lock));
|
||||
if (EFI_ERROR (Status)) {
|
||||
|
||||
DEBUG ((EFI_D_ERROR, "SockDestroyChild: Get the lock to "
|
||||
"access socket failed with %r\n", Status));
|
||||
|
||||
return EFI_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
//
|
||||
// Close the IP protocol.
|
||||
//
|
||||
@ -214,6 +205,15 @@ SockDestroyChild (
|
||||
NULL
|
||||
);
|
||||
|
||||
Status = EfiAcquireLockOrFail (&(Sock->Lock));
|
||||
if (EFI_ERROR (Status)) {
|
||||
|
||||
DEBUG ((EFI_D_ERROR, "SockDestroyChild: Get the lock to "
|
||||
"access socket failed with %r\n", Status));
|
||||
|
||||
return EFI_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
//
|
||||
// force protocol layer to detach the PCB
|
||||
//
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
TCP input process routines.
|
||||
|
||||
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -703,6 +703,7 @@ TcpInput (
|
||||
TCP_SEG *Seg;
|
||||
TCP_SEQNO Right;
|
||||
TCP_SEQNO Urg;
|
||||
INT32 Usable;
|
||||
|
||||
NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE);
|
||||
|
||||
@ -1187,9 +1188,27 @@ TcpInput (
|
||||
}
|
||||
|
||||
if (TCP_SEQ_LT (Right, Tcb->SndNxt)) {
|
||||
|
||||
Tcb->SndNxt = Right;
|
||||
|
||||
//
|
||||
// Check for Window Retraction in RFC7923 section 2.4.
|
||||
// The lower n bits of the peer's actual receive window is wiped out if TCP
|
||||
// window scale is enabled, it will look like the peer is shrinking the window.
|
||||
// Check whether the SndNxt is out of the advertised receive window by more than
|
||||
// 2^Rcv.Wind.Shift before moving the SndNxt to the left.
|
||||
//
|
||||
DEBUG (
|
||||
(EFI_D_WARN,
|
||||
"TcpInput: peer advise negative useable window for connected TCB %p\n",
|
||||
Tcb)
|
||||
);
|
||||
Usable = TCP_SUB_SEQ (Tcb->SndNxt, Right);
|
||||
if ((Usable >> Tcb->SndWndScale) > 0) {
|
||||
DEBUG (
|
||||
(EFI_D_WARN,
|
||||
"TcpInput: SndNxt is out of window by more than window scale for TCB %p\n",
|
||||
Tcb)
|
||||
);
|
||||
Tcb->SndNxt = Right;
|
||||
}
|
||||
if (Right == Tcb->SndUna) {
|
||||
|
||||
TcpClearTimer (Tcb, TCP_TIMER_REXMIT);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Misc support routines for tcp.
|
||||
|
||||
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -78,6 +78,7 @@ TcpInitTcbLocal (
|
||||
// First window size is never scaled
|
||||
//
|
||||
Tcb->RcvWndScale = 0;
|
||||
Tcb->RetxmitSeqMax = 0;
|
||||
|
||||
Tcb->ProbeTimerOn = FALSE;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
TCP output process routines.
|
||||
|
||||
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -671,17 +671,39 @@ TcpRetransmit (
|
||||
// 2. must in the current send window
|
||||
// 3. will not change the boundaries of queued segments.
|
||||
//
|
||||
if (TCP_SEQ_LT (Tcb->SndWl2 + Tcb->SndWnd, Seq)) {
|
||||
DEBUG ((EFI_D_WARN, "TcpRetransmit: retransmission cancelled "
|
||||
"because send window too small for TCB %p\n", Tcb));
|
||||
|
||||
//
|
||||
// Handle the Window Retraction if TCP window scale is enabled according to RFC7323:
|
||||
// On first retransmission, or if the sequence number is out of
|
||||
// window by less than 2^Rcv.Wind.Shift, then do normal
|
||||
// retransmission(s) without regard to the receiver window as long
|
||||
// as the original segment was in window when it was sent.
|
||||
//
|
||||
if ((Tcb->SndWndScale != 0) &&
|
||||
(TCP_SEQ_GT (Seq, Tcb->RetxmitSeqMax) || TCP_SEQ_BETWEEN (Tcb->SndWl2 + Tcb->SndWnd, Seq, Tcb->SndWl2 + Tcb->SndWnd + (1 << Tcb->SndWndScale)))) {
|
||||
Len = TCP_SUB_SEQ (Tcb->SndNxt, Seq);
|
||||
DEBUG (
|
||||
(EFI_D_WARN,
|
||||
"TcpRetransmit: retransmission without regard to the receiver window for TCB %p\n",
|
||||
Tcb)
|
||||
);
|
||||
|
||||
} else if (TCP_SEQ_GEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq)) {
|
||||
Len = TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq);
|
||||
|
||||
} else {
|
||||
DEBUG (
|
||||
(EFI_D_WARN,
|
||||
"TcpRetransmit: retransmission cancelled because send window too small for TCB %p\n",
|
||||
Tcb)
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Len = TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq);
|
||||
Len = MIN (Len, Tcb->SndMss);
|
||||
Len = MIN (Len, Tcb->SndMss);
|
||||
|
||||
Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len);
|
||||
Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len);
|
||||
if (Nbuf == NULL) {
|
||||
return -1;
|
||||
}
|
||||
@ -692,6 +714,10 @@ TcpRetransmit (
|
||||
goto OnError;
|
||||
}
|
||||
|
||||
if (TCP_SEQ_GT (Seq, Tcb->RetxmitSeqMax)) {
|
||||
Tcb->RetxmitSeqMax = Seq;
|
||||
}
|
||||
|
||||
//
|
||||
// The retransmitted buffer may be on the SndQue,
|
||||
// trim TCP head because all the buffer on SndQue
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Tcp Protocol header file.
|
||||
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -250,6 +250,12 @@ struct _TCP_CB {
|
||||
UINT32 TimeWaitTimeout; ///< The TIME_WAIT time out
|
||||
UINT32 ConnectTimeout; ///< The connect establishment time out
|
||||
|
||||
//
|
||||
// RFC7323
|
||||
// Addressing Window Retraction for TCP Window Scale Option.
|
||||
//
|
||||
TCP_SEQNO RetxmitSeqMax; ///< Max Seq number in previous retransmission.
|
||||
|
||||
//
|
||||
// configuration for tcp provided by user
|
||||
//
|
||||
|
@ -1296,6 +1296,7 @@ DxePcdGetNextTokenSpace (
|
||||
(EFI_GUID *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->GuidTableOffset)
|
||||
);
|
||||
CopyMem (TmpTokenSpaceBuffer, PeiTokenSpaceTable, sizeof (EFI_GUID*) * PeiTokenSpaceTableSize);
|
||||
TmpTokenSpaceBufferCount = PeiTokenSpaceTableSize;
|
||||
FreePool (PeiTokenSpaceTable);
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user