Changeset 85718 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg
- Timestamp:
- Aug 12, 2020 4:09:12 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139865
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 6 added
- 81 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-133213 /vendor/edk2/current 103735-103757,103769-103776,129194-139864
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ConsoleLogger.c
r80721 r85718 311 311 312 312 // 313 // Find the first char with a different a rrribute and make that temporarily NULL313 // Find the first char with a different attribute and make that temporarily NULL 314 314 // so we can do fewer printout statements. (later) restore that one and we will 315 // start at that col lumn on the next loop.315 // start at that column on the next loop. 316 316 // 317 317 StringSegmentEndChar = CHAR_NULL; … … 396 396 397 397 /** 398 Reset the text output device hardware and optional y run diagnostics398 Reset the text output device hardware and optionally run diagnostics 399 399 400 400 @param This pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL … … 724 724 725 725 // 726 // restore the temp NULL terminator to it 's original character726 // restore the temp NULL terminator to its original character 727 727 // 728 728 *((CHAR16*)(Walker+1)) = TempChar; … … 771 771 772 772 // 773 // restore the temp NULL terminator to it 's original character773 // restore the temp NULL terminator to its original character 774 774 // 775 775 *((CHAR16*)(Walker+1)) = TempChar; … … 1190 1190 @param[in] ConsoleInfo The pointer to the instance of the console logger information. 1191 1191 1192 This will be used when a mode has changed or a reset oc urred to verify all1192 This will be used when a mode has changed or a reset occurred to verify all 1193 1193 history buffers. 1194 1194 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ConsoleLogger.h
r80721 r85718 118 118 119 119 /** 120 Reset the text output device hardware and optional y run diagnostics120 Reset the text output device hardware and optionally run diagnostics 121 121 122 122 @param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL … … 306 306 @param[in] ConsoleInfo The pointer to the instance of the console logger information. 307 307 308 This will be used when a mode has changed or a reset oc urred to verify all308 This will be used when a mode has changed or a reset occurred to verify all 309 309 history buffers. 310 310 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ConsoleWrappers.c
r80721 r85718 221 221 222 222 /** 223 Reset the text output device hardware and optional y run diagnostics.223 Reset the text output device hardware and optionally run diagnostics. 224 224 225 225 @param This pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/FileHandleWrappers.c
r80721 r85718 518 518 519 519 // 520 // Limit the line length to the buffer size or the minimu nsize of the520 // Limit the line length to the buffer size or the minimum size of the 521 521 // screen. (The smaller takes effect) 522 522 // … … 866 866 if (Key.UnicodeChar != CHAR_BACKSPACE && !(Key.UnicodeChar == 0 && Key.ScanCode == SCAN_DELETE)) { 867 867 // 868 // Cal ulate row and column of the tail of current string868 // Calculate row and column of the tail of current string 869 869 // 870 870 TailRow = Row + (StringLen - StringCurPos + Column + OutputLength) / TotalColumn; … … 933 933 934 934 // 935 // FILE s ytle interfaces for StdIn/StdOut/StdErr935 // FILE style interfaces for StdIn/StdOut/StdErr 936 936 // 937 937 EFI_FILE_PROTOCOL FileInterfaceStdIn = { … … 1070 1070 ((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 3] = CHAR_NULL; 1071 1071 // 1072 // If the NewBuffer end with \r\n\0, We will rep ace '\r' by '\0' and then update TotalSize.1072 // If the NewBuffer end with \r\n\0, We will replace '\r' by '\0' and then update TotalSize. 1073 1073 // 1074 1074 TotalSize -= sizeof(CHAR16) * 2; … … 1645 1645 if ((UINTN)(MemFile->Position + (*BufferSize)) > (UINTN)(MemFile->BufferSize)) { 1646 1646 MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize), (UINTN)(MemFile->BufferSize) + (*BufferSize) + MEM_WRITE_REALLOC_OVERHEAD, MemFile->Buffer); 1647 if (MemFile->Buffer == NULL){ 1648 return EFI_OUT_OF_RESOURCES; 1649 } 1647 1650 MemFile->BufferSize += (*BufferSize) + MEM_WRITE_REALLOC_OVERHEAD; 1648 1651 } … … 1662 1665 if ((UINTN)(MemFile->Position + AsciiStrSize(AsciiBuffer)) > (UINTN)(MemFile->BufferSize)) { 1663 1666 MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize), (UINTN)(MemFile->BufferSize) + AsciiStrSize(AsciiBuffer) + MEM_WRITE_REALLOC_OVERHEAD, MemFile->Buffer); 1667 if (MemFile->Buffer == NULL){ 1668 FreePool(AsciiBuffer); 1669 return EFI_OUT_OF_RESOURCES; 1670 } 1664 1671 MemFile->BufferSize += AsciiStrSize(AsciiBuffer) + MEM_WRITE_REALLOC_OVERHEAD; 1665 1672 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/FileHandleWrappers.h
r80721 r85718 21 21 22 22 /// 23 /// FILE s ytle interfaces for StdIn.23 /// FILE styte interfaces for StdIn. 24 24 /// 25 25 extern EFI_FILE_PROTOCOL FileInterfaceStdIn; 26 26 27 27 /// 28 /// FILE s ytle interfaces for StdOut.28 /// FILE styte interfaces for StdOut. 29 29 /// 30 30 extern EFI_FILE_PROTOCOL FileInterfaceStdOut; 31 31 32 32 /// 33 /// FILE s ytle interfaces for StdErr.33 /// FILE styte interfaces for StdErr. 34 34 /// 35 35 extern EFI_FILE_PROTOCOL FileInterfaceStdErr; -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/Shell.c
r80721 r85718 1082 1082 } 1083 1083 // 1084 // If an argum nent contains a space, then add double quotes before the argument1084 // If an argument contains a space, then add double quotes before the argument 1085 1085 // 1086 1086 if (StrStr (gEfiShellParametersProtocol->Argv[LoopVar], L" ") != NULL) { … … 1103 1103 } 1104 1104 // 1105 // If an argum nent contains a space, then add double quotes after the argument1105 // If an argument contains a space, then add double quotes after the argument 1106 1106 // 1107 1107 if (StrStr (gEfiShellParametersProtocol->Argv[LoopVar], L" ") != NULL) { … … 1177 1177 1178 1178 // 1179 // Try to find 'Startup.nsh' in the execution path defined by the env rionment variable PATH.1179 // Try to find 'Startup.nsh' in the execution path defined by the environment variable PATH. 1180 1180 // 1181 1181 if ((StartupScriptPath == NULL) || EFI_ERROR (ShellIsFile (StartupScriptPath))) { … … 2252 2252 2253 2253 /** 2254 Converts the command line to it 's post-processed form. this replaces variables and alias' per UEFI Shell spec.2254 Converts the command line to its post-processed form. this replaces variables and alias' per UEFI Shell spec. 2255 2255 2256 2256 @param[in,out] CmdLine pointer to the command line to update -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/Shell.h
r80721 r85718 136 136 137 137 /** 138 Converts the command line to it 's post-processed form. this replaces variables and alias' per UEFI Shell spec.138 Converts the command line to its post-processed form. this replaces variables and alias' per UEFI Shell spec. 139 139 140 140 @param[in,out] CmdLine pointer to the command line to update -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellEnvVar.c
r80721 r85718 119 119 storing this list. 120 120 121 @retval EFI_SUCCESS the list was created suc essfully.121 @retval EFI_SUCCESS the list was created successfully. 122 122 **/ 123 123 EFI_STATUS … … 234 234 GetShellEnvVarList(). 235 235 236 @retval EFI_SUCCESS the list was Set suc essfully.236 @retval EFI_SUCCESS the list was Set successfully. 237 237 **/ 238 238 EFI_STATUS … … 267 267 268 268 // 269 // set all the variables fro nthe list269 // set all the variables from the list 270 270 // 271 271 for ( Node = (ENV_VAR_LIST*)GetFirstNode(ListHead) … … 480 480 481 481 // 482 // If the environment varia lbe key doesn't exist in list just insert482 // If the environment variable key doesn't exist in list just insert 483 483 // a new node. 484 484 // -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellEnvVar.h
r80721 r85718 44 44 45 45 /** 46 Delete a Non-V iolatile environment variable.47 48 This will use the Runtime Services call SetVariable to remove a non-v iolatile variable.49 50 @param EnvVarName The name of the environment variable in question 51 52 @retval EFI_SUCCESS The variable was deleted suc essfully53 @retval other An error oc urred46 Delete a Non-Volatile environment variable. 47 48 This will use the Runtime Services call SetVariable to remove a non-volatile variable. 49 50 @param EnvVarName The name of the environment variable in question 51 52 @retval EFI_SUCCESS The variable was deleted successfully 53 @retval other An error occurred 54 54 @sa SetVariable 55 55 **/ … … 62 62 63 63 /** 64 Set a Non-V iolatile environment variable.65 66 This will use the Runtime Services call SetVariable to set a non-v iolatile variable.64 Set a Non-Volatile environment variable. 65 66 This will use the Runtime Services call SetVariable to set a non-volatile variable. 67 67 68 68 @param EnvVarName The name of the environment variable in question … … 70 70 @param Buffer Pointer to value to set variable to 71 71 72 @retval EFI_SUCCESS The variable was changed suc essfully73 @retval other An error oc urred72 @retval EFI_SUCCESS The variable was changed successfully 73 @retval other An error occurred 74 74 @sa SetVariable 75 75 **/ … … 90 90 @param Buffer Pointer buffer to get variable value into 91 91 92 @retval EFI_SUCCESS The variable's value was retrieved suc essfully93 @retval other An error oc urred92 @retval EFI_SUCCESS The variable's value was retrieved successfully 93 @retval other An error occurred 94 94 @sa SetVariable 95 95 **/ … … 111 111 @param Buffer Pointer buffer to get variable value into 112 112 113 @retval EFI_SUCCESS The variable's value was retrieved suc essfully114 @retval other An error oc urred113 @retval EFI_SUCCESS The variable's value was retrieved successfully 114 @retval other An error occurred 115 115 @sa SetVariable 116 116 **/ … … 123 123 124 124 /** 125 Set a V iolatile environment variable.126 127 This will use the Runtime Services call SetVariable to set a v iolatile variable.125 Set a Volatile environment variable. 126 127 This will use the Runtime Services call SetVariable to set a volatile variable. 128 128 129 129 @param EnvVarName The name of the environment variable in question … … 131 131 @param Buffer Pointer to value to set variable to 132 132 133 @retval EFI_SUCCESS The variable was changed suc essfully134 @retval other An error oc urred133 @retval EFI_SUCCESS The variable was changed successfully 134 @retval other An error occurred 135 135 @sa SetVariable 136 136 **/ … … 148 148 storing this list. 149 149 150 @retval EFI_SUCCESS the list was created suc essfully.150 @retval EFI_SUCCESS the list was created successfully. 151 151 **/ 152 152 EFI_STATUS … … 165 165 GetShellEnvVarList(). 166 166 167 @retval EFI_SUCCESS The list was Set suc essfully.167 @retval EFI_SUCCESS The list was Set successfully. 168 168 **/ 169 169 EFI_STATUS -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellManParser.c
r80721 r85718 180 180 181 181 /** 182 parses through the MAN file specified by SHELL_FILE_HANDLE and returns the183 detailed help for any sub section specified in the comma sep erated list of182 Parses through the MAN file specified by SHELL_FILE_HANDLE and returns the 183 detailed help for any sub section specified in the comma separated list of 184 184 sections provided. If the end of the file or a .TH section is found then 185 185 return. 186 186 187 Upon a suc essful return the caller is responsible to free the memory in *HelpText187 Upon a successful return the caller is responsible to free the memory in *HelpText 188 188 189 189 @param[in] Handle FileHandle to read from … … 194 194 195 195 @retval EFI_OUT_OF_RESOURCES a memory allocation failed. 196 @retval EFI_SUCCESS the section was found and its description s otred in197 an alloc eted buffer.196 @retval EFI_SUCCESS the section was found and its description stored in 197 an allocated buffer. 198 198 **/ 199 199 EFI_STATUS … … 297 297 Parses a line from a MAN file to see if it is the Title Header. If it is, then 298 298 if the "Brief Description" is desired, allocate a buffer for it and return a 299 copy. Upon a suc essful return the caller is responsible to free the memory in299 copy. Upon a successful return the caller is responsible to free the memory in 300 300 *BriefDesc 301 301 302 302 Uses a simple state machine that allows "unlimited" whitespace before and after the 303 ".TH", compares Command and the MAN file comm nd name without respect to case, and303 ".TH", compares Command and the MAN file command name without respect to case, and 304 304 allows "unlimited" whitespace and '0' and '1' characters before the Short Description. 305 305 The PCRE regex describing this functionality is: ^\s*\.TH\s+(\S)\s[\s01]*(.*)$ … … 422 422 423 423 /** 424 parses through the MAN file specified by SHELL_FILE_HANDLE and returns the424 Parses through the MAN file specified by SHELL_FILE_HANDLE and returns the 425 425 "Brief Description" for the .TH section as specified by Command. If the 426 426 command section is not found return EFI_NOT_FOUND. 427 427 428 Upon a suc essful return the caller is responsible to free the memory in *BriefDesc428 Upon a successful return the caller is responsible to free the memory in *BriefDesc 429 429 430 430 @param[in] Handle FileHandle to read from … … 513 513 available will be returned. 514 514 515 if BriefDesc is NULL, then the breif description will not be saved d seperatly,515 if BriefDesc is NULL, then the breif description will not be saved separately, 516 516 but placed first in the main HelpText. 517 517 … … 646 646 Status = gBS->LoadImage(FALSE, gImageHandle, DevPath, NULL, 0, &CmdFileImgHandle); 647 647 if(EFI_ERROR(Status)) { 648 // 649 // With EFI_SECURITY_VIOLATION retval, the Image was loaded and an ImageHandle was created 650 // with a valid EFI_LOADED_IMAGE_PROTOCOL, but the image can not be started right now. 651 // If the caller doesn't have the option to defer the execution of an image, we should 652 // unload image for the EFI_SECURITY_VIOLATION to avoid the resource leak. 653 // 654 if (Status == EFI_SECURITY_VIOLATION) { 655 gBS->UnloadImage (CmdFileImgHandle); 656 } 648 657 *HelpText = NULL; 649 658 goto Done; -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellManParser.h
r80721 r85718 20 20 available will be returned. 21 21 22 if BriefDesc is NULL, then the breif description will not be savedd sep eratly,22 if BriefDesc is NULL, then the breif description will not be savedd separately, 23 23 but placed first in the main HelpText. 24 24 … … 50 50 /** 51 51 parses through the MAN file specified by SHELL_FILE_HANDLE and returns the 52 detailed help for any sub section specified in the comma sep erated list of52 detailed help for any sub section specified in the comma separated list of 53 53 sections provided. If the end of the file or a .TH section is found then 54 54 return. 55 55 56 Upon a suc essful return the caller is responsible to free the memory in *HelpText56 Upon a successful return the caller is responsible to free the memory in *HelpText 57 57 58 58 @param[in] Handle FileHandle to read from … … 63 63 64 64 @retval EFI_OUT_OF_RESOURCES a memory allocation failed. 65 @retval EFI_SUCCESS the section was found and its description s otred in66 an alloc eted buffer.65 @retval EFI_SUCCESS the section was found and its description stored in 66 an allocated buffer. 67 67 **/ 68 68 EFI_STATUS -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellParametersProtocol.c
r80721 r85718 70 70 71 71 @param[in, out] Walker pointer to string of command line. Adjusted to 72 rem inaing command line on return72 remaining command line on return 73 73 @param[in, out] TempParameter pointer to string of command line item extracted. 74 74 @param[in] Length buffer size of TempParameter. … … 76 76 the parameters. 77 77 78 @return EFI_IN ALID_PARAMETERA required parameter was NULL or pointed to a NULL or empty string.78 @return EFI_INVALID_PARAMETER A required parameter was NULL or pointed to a NULL or empty string. 79 79 @return EFI_NOT_FOUND A closing " could not be found on the specified string 80 80 **/ … … 127 127 128 128 // 129 // Add a CHAR_NULL if we didn t get one via the copy129 // Add a CHAR_NULL if we didn't get one via the copy 130 130 // 131 131 if (*NextDelim != CHAR_NULL) { … … 185 185 @param[in, out] Argc pointer to number of strings in Argv array 186 186 187 @return EFI_SUCCESS the operation was sucessful 187 @return EFI_SUCCESS the operation was successful 188 @return EFI_INVALID_PARAMETER some parameters are invalid 188 189 @return EFI_OUT_OF_RESOURCES a memory allocation failed. 189 190 **/ … … 417 418 418 419 /** 419 frees all memory used by creat eion and installation of shell parameters protocol420 frees all memory used by creation and installation of shell parameters protocol 420 421 and if there was an old version installed it will restore that one. 421 422 … … 467 468 468 469 /** 469 Determin if a file name represents a unicode file.470 Determine if a file name represents a unicode file. 470 471 471 472 @param[in] FileName Pointer to the filename to open. … … 527 528 528 529 /** 529 Calcu alte the 32-bit CRC in a EFI table using the service provided by the530 Calculate the 32-bit CRC in a EFI table using the service provided by the 530 531 gRuntime service. 531 532 … … 652 653 653 654 /** 654 Func ion will replace the current StdIn and StdOut in the ShellParameters protocol655 Function will replace the current StdIn and StdOut in the ShellParameters protocol 655 656 structure by parsing NewCommandLine. The current values are returned to the 656 657 user. … … 665 666 @param[out] SystemTableInfo Pointer to old system table information. 666 667 667 @retval EFI_SUCCESS Operation was suc essful, Argv and Argc are valid.668 @retval EFI_SUCCESS Operation was successful, Argv and Argc are valid. 668 669 @retval EFI_OUT_OF_RESOURCES A memory allocation failed. 669 670 **/ … … 1258 1259 1259 1260 /** 1260 Func ion will replace the current StdIn and StdOut in the ShellParameters protocol1261 Function will replace the current StdIn and StdOut in the ShellParameters protocol 1261 1262 structure with StdIn and StdOut. The current values are de-allocated. 1262 1263 … … 1328 1329 } 1329 1330 /** 1330 Func ion will replace the current Argc and Argv in the ShellParameters protocol1331 Function will replace the current Argc and Argv in the ShellParameters protocol 1331 1332 structure by parsing NewCommandLine. The current values are returned to the 1332 1333 user. … … 1340 1341 @param[out] OldArgc Pointer to old number of items in Argv list. 1341 1342 1342 @retval EFI_SUCCESS Operation was sucessful, Argv and Argc are valid. 1343 1344 @retval EFI_SUCCESS Operation was successful, Argv and Argc are valid. 1345 @return EFI_INVALID_PARAMETER Some parameters are invalid. 1343 1346 @retval EFI_OUT_OF_RESOURCES A memory allocation failed. 1344 1347 **/ … … 1376 1379 1377 1380 /** 1378 Func ion will replace the current Argc and Argv in the ShellParameters protocol1381 Function will replace the current Argc and Argv in the ShellParameters protocol 1379 1382 structure with Argv and Argc. The current values are de-allocated and the 1380 1383 OldArgv must not be deallocated by the caller. -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellParametersProtocol.h
r80721 r85718 44 44 45 45 /** 46 frees all memory used by creat eion and installation of shell parameters protocol46 frees all memory used by creation and installation of shell parameters protocol 47 47 and if there was an old version installed it will restore that one. 48 48 … … 61 61 62 62 /** 63 Func ion will replace the current Argc and Argv in the ShellParameters protocol63 Function will replace the current Argc and Argv in the ShellParameters protocol 64 64 structure by parsing NewCommandLine. The current values are returned to the 65 65 user. … … 71 71 @param[out] OldArgc pointer to old number of items in Argv list 72 72 73 @retval EFI_SUCCESS operation was sucessful, Argv and Argc are valid 73 @retval EFI_SUCCESS operation was successful, Argv and Argc are valid 74 @return EFI_INVALID_PARAMETER some parameters are invalid 74 75 @retval EFI_OUT_OF_RESOURCES a memory allocation failed. 75 76 **/ … … 84 85 85 86 /** 86 Func ion will replace the current Argc and Argv in the ShellParameters protocol87 Function will replace the current Argc and Argv in the ShellParameters protocol 87 88 structure with Argv and Argc. The current values are de-allocated and the 88 89 OldArgv must not be deallocated by the caller. … … 109 110 110 111 /** 111 Func ion will replace the current StdIn and StdOut in the ShellParameters protocol112 Function will replace the current StdIn and StdOut in the ShellParameters protocol 112 113 structure by parsing NewCommandLine. The current values are returned to the 113 114 user. … … 122 123 @param[out] SystemTableInfo Pointer to old system table information. 123 124 124 @retval EFI_SUCCESS Operation was suc essful, Argv and Argc are valid.125 @retval EFI_SUCCESS Operation was successful, Argv and Argc are valid. 125 126 @retval EFI_OUT_OF_RESOURCES A memory allocation failed. 126 127 **/ … … 136 137 137 138 /** 138 Func ion will replace the current StdIn and StdOut in the ShellParameters protocol139 Function will replace the current StdIn and StdOut in the ShellParameters protocol 139 140 structure with StdIn and StdOut. The current values are de-allocated. 140 141 … … 167 168 @param[in, out] Argc pointer to number of strings in Argv array 168 169 169 @return EFI_SUCCESS the operation was sucessful 170 @return EFI_SUCCESS the operation was successful 171 @return EFI_INVALID_PARAMETER some parameters are invalid 170 172 @return EFI_OUT_OF_RESOURCES a memory allocation failed. 171 173 **/ … … 189 191 190 192 @param[in, out] Walker pointer to string of command line. Adjusted to 191 rem inaing command line on return193 remaining command line on return 192 194 @param[in, out] TempParameter pointer to string of command line item extracted. 193 195 @param[in] Length Length of (*TempParameter) in bytes … … 195 197 the parameters. 196 198 197 @return EFI_IN ALID_PARAMETERA required parameter was NULL or pointed to a NULL or empty string.199 @return EFI_INVALID_PARAMETER A required parameter was NULL or pointed to a NULL or empty string. 198 200 @return EFI_NOT_FOUND A closing " could not be found on the specified string 199 201 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellProtocol.c
r80721 r85718 97 97 This function creates a mapping for a device path. 98 98 99 If both Devi ecPath and Mapping are NULL, this will reset the mapping to default values.99 If both DevicePath and Mapping are NULL, this will reset the mapping to default values. 100 100 101 101 @param DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping, … … 153 153 154 154 // 155 // We didn t find one to delete155 // We didn't find one to delete 156 156 // 157 157 return (EFI_NOT_FOUND); … … 233 233 points to the end-of-device-path node. 234 234 235 If there are multiple map names they will be semi-colon sep erated in the235 If there are multiple map names they will be semi-colon separated in the 236 236 NULL-terminated string. 237 237 … … 911 911 912 912 @retval EFI_SUCCESS the file is open and FileHandle is valid 913 @retval EFI_UNSUPPORTED the device path co tained non-path elements914 @retval other an error oc urred.913 @retval EFI_UNSUPPORTED the device path contained non-path elements 914 @retval other an error occurred. 915 915 **/ 916 916 EFI_STATUS … … 947 947 if (Handle1 != NULL) { 948 948 // 949 // chop off the begin ing part before the file system part...949 // chop off the beginning part before the file system part... 950 950 // 951 951 ///@todo BlockIo? … … 1065 1065 1066 1066 @param FileName Pointer to NULL-terminated file path 1067 @param FileAttribs The new file's attr biutes. the different attributes are1067 @param FileAttribs The new file's attributes. the different attributes are 1068 1068 described in EFI_FILE_PROTOCOL.Open(). 1069 1069 @param FileHandle On return, points to the created file handle or directory's handle … … 1072 1072 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. 1073 1073 @retval EFI_UNSUPPORTED could not open the file path 1074 @retval EFI_NOT_FOUND the specified file could not be found on the devi de, or could not1074 @retval EFI_NOT_FOUND the specified file could not be found on the device, or could not 1075 1075 file the file system on the device. 1076 1076 @retval EFI_NO_MEDIA the device has no medium. … … 1498 1498 ShellParamsProtocol.StdErr = ShellInfoObject.NewShellParametersProtocol->StdErr; 1499 1499 Status = UpdateArgcArgv(&ShellParamsProtocol, NewCmdLine, Efi_Application, NULL, NULL); 1500 ASSERT_EFI_ERROR(Status); 1500 if (EFI_ERROR (Status)) { 1501 goto UnloadImage; 1502 } 1503 1501 1504 // 1502 1505 // Replace Argv[0] with the full path of the binary we're executing: … … 1906 1909 @param[in] Save TRUE to set Node->Handle to NULL, FALSE otherwise. 1907 1910 1908 @retval NULL a memory allocation error oc urred1911 @retval NULL a memory allocation error occurred 1909 1912 @return != NULL a pointer to the new node 1910 1913 **/ … … 1958 1961 @param[in] Info Info struct to copy. 1959 1962 1960 @retval NULL An error oc urred.1963 @retval NULL An error occurred. 1961 1964 @return a pointer to the newly allocated structure. 1962 1965 **/ … … 2118 2121 ShellFileListItem = CreateAndPopulateShellFileInfo( 2119 2122 BasePath, 2120 EFI_SUCCESS, // success since we didn t fail to open it...2123 EFI_SUCCESS, // success since we didn't fail to open it... 2121 2124 FileInfo->FileName, 2122 2125 NULL, // no handle since not open … … 2704 2707 } 2705 2708 // 2706 // we didn t get it (might not exist)2709 // we didn't get it (might not exist) 2707 2710 // free the memory if we allocated any and return NULL 2708 2711 // … … 2925 2928 @param Dir Points to the NULL-terminated directory on the device specified by FileSystem. 2926 2929 2927 @retval EFI_SUCCESS The operation was suc essful2930 @retval EFI_SUCCESS The operation was successful 2928 2931 @retval EFI_NOT_FOUND The file system could not be found 2929 2932 **/ … … 3177 3180 3178 3181 /** 3179 function to return a semi-colon delim eted list of all alias' in the current shell3182 function to return a semi-colon delimited list of all alias' in the current shell 3180 3183 3181 3184 up to caller to free the memory. 3182 3185 3183 3186 @retval NULL No alias' were found 3184 @retval NULL An error oc urred getting alias'3187 @retval NULL An error occurred getting alias' 3185 3188 @return !NULL a list of all alias' 3186 3189 **/ … … 3285 3288 delimited list of alias (e.g. 3286 3289 ReturnedData = "dir;del;copy;mfp") that is NULL-terminated. 3287 @retval NULL an error oc urred3290 @retval NULL an error occurred 3288 3291 @retval NULL Alias was not a valid Alias 3289 3292 **/ … … 3610 3613 if (!EFI_ERROR(Status)) { 3611 3614 // 3612 // we reinstalled suc essfully. log this so we can reverse it later.3615 // we reinstalled successfully. log this so we can reverse it later. 3613 3616 // 3614 3617 … … 3757 3760 3758 3761 @retval EFI_SUCCESS The feature is enabled. 3759 @retval EFI_OUT_OF_RESOURCES There is not enough m nemory available.3762 @retval EFI_OUT_OF_RESOURCES There is not enough memory available. 3760 3763 **/ 3761 3764 EFI_STATUS -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellProtocol.h
r80721 r85718 284 284 285 285 @retval EFI_SUCCESS the file is open and FileHandle is valid 286 @retval EFI_UNSUPPORTED the device path co tained non-path elements287 @retval other an error oc urred.286 @retval EFI_UNSUPPORTED the device path contained non-path elements 287 @retval other an error occurred. 288 288 **/ 289 289 EFI_STATUS … … 310 310 311 311 @param FileName Pointer to NULL-terminated file path 312 @param FileAttribs The new file's attr biutes. the different attributes are312 @param FileAttribs The new file's attributes. the different attributes are 313 313 described in EFI_FILE_PROTOCOL.Open(). 314 314 @param FileHandle On return, points to the created file handle or directory's handle … … 735 735 @param Dir Points to the NULL-terminated directory on the device specified by FileSystem. 736 736 737 @retval EFI_SUCCESS The operation was suc essful737 @retval EFI_SUCCESS The operation was successful 738 738 **/ 739 739 EFI_STATUS … … 819 819 delimited list of alias (e.g. 820 820 ReturnedData = "dir;del;copy;mfp") that is NULL-terminated. 821 @retval NULL an error oc urred821 @retval NULL an error occurred 822 822 @retval NULL Alias was not a valid Alias 823 823 **/ … … 916 916 917 917 @retval EFI_SUCCESS The feature is enabled. 918 @retval EFI_OUT_OF_RESOURCES There is not enough m nemory available.918 @retval EFI_OUT_OF_RESOURCES There is not enough memory available. 919 919 **/ 920 920 EFI_STATUS -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/ShellCTestApp/README.txt
r80721 r85718 1 1 TestArgv.nsh is a very simple shell script to test how the interpreter parses 2 2 the parameters. It uses ShellCTestApp.efi to dump the parameters passed from the 3 inte preter.3 interpreter. 4 4 5 5 TestArgv.log is the desired output created using "TestArgv.nsh > TestArgv.log". -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
r80721 r85718 37 37 #pragma pack() 38 38 39 EFI_H ANDLE mDpHiiHandle;39 EFI_HII_HANDLE mDpHiiHandle; 40 40 41 41 typedef struct { … … 155 155 } 156 156 // 157 // Try to get the Handle f orm the caached array.157 // Try to get the Handle from the cached array. 158 158 // 159 159 for (Index = 0; Index < mCachePairCount; Index++) { … … 919 919 920 920 /** 921 Retri ve HII package list from ImageHandle and publish to HII database.921 Retrieve HII package list from ImageHandle and publish to HII database. 922 922 923 923 @param ImageHandle The image handle of the process. … … 925 925 @return HII handle. 926 926 **/ 927 EFI_H ANDLE927 EFI_HII_HANDLE 928 928 InitializeHiiPackage ( 929 929 EFI_HANDLE ImageHandle … … 932 932 EFI_STATUS Status; 933 933 EFI_HII_PACKAGE_LIST_HEADER *PackageList; 934 EFI_H ANDLEHiiHandle;934 EFI_HII_HANDLE HiiHandle; 935 935 936 936 // -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.h
r80721 r85718 37 37 #include <Library/PerformanceLib.h> 38 38 39 extern EFI_H ANDLE mDpHiiHandle;39 extern EFI_HII_HANDLE mDpHiiHandle; 40 40 41 41 #define DP_MAJOR_VERSION 2 … … 128 128 129 129 /** 130 Retri ve HII package list from ImageHandle and publish to HII database.130 Retrieve HII package list from ImageHandle and publish to HII database. 131 131 132 132 @param ImageHandle The image handle of the process. … … 134 134 @return HII handle. 135 135 **/ 136 EFI_H ANDLE136 EFI_HII_HANDLE 137 137 InitializeHiiPackage ( 138 138 EFI_HANDLE ImageHandle -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.c
r80721 r85718 25 25 @param SystemTable The EFI System Table pointer. 26 26 27 @retval EFI_SUCCESS Tftp command is executed suc essfully.27 @retval EFI_SUCCESS Tftp command is executed successfully. 28 28 @retval EFI_ABORTED HII package was failed to initialize. 29 29 @retval others Other errors when executing tftp command. -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.c
r80721 r85718 20 20 of processing this command. 21 21 22 @return EFI_SUCCESS the operation was suc essful22 @return EFI_SUCCESS the operation was successful 23 23 @return other the operation failed. 24 24 **/ … … 71 71 @param SystemTable The EFI System Table pointer. 72 72 73 @retval EFI_SUCCESS Tftp command is executed suc essfully.73 @retval EFI_SUCCESS Tftp command is executed successfully. 74 74 @retval EFI_ABORTED HII package was failed to initialize. 75 75 @retval others Other errors when executing tftp command. -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/DynamicCommand/DpDynamicCommand/DpTrace.c
r80721 r85718 86 86 current performance logs. 87 87 88 @param[in, out] CustomCumulativeData A pointer to the cu mtom cumulative data.88 @param[in, out] CustomCumulativeData A pointer to the custom cumulative data. 89 89 90 90 **/ … … 831 831 Finally, print the gathered cumulative statistics. 832 832 833 @param[in] CustomCumulativeData A pointer to the cu mtom cumulative data.833 @param[in] CustomCumulativeData A pointer to the custom cumulative data. 834 834 835 835 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
r80721 r85718 12 12 13 13 #define IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH 32 14 EFI_H ANDLE mTftpHiiHandle;14 EFI_HII_HANDLE mTftpHiiHandle; 15 15 16 16 /* 17 17 Constant strings and definitions related to the message indicating the amount of 18 progress in the dow loading of a TFTP file.18 progress in the downloading of a TFTP file. 19 19 */ 20 20 … … 49 49 50 50 @return TRUE The value was returned. 51 @return FALSE A parsing error occur ed.51 @return FALSE A parsing error occurred. 52 52 **/ 53 53 STATIC … … 586 586 587 587 @return TRUE The value was returned. 588 @return FALSE A parsing error occur ed.588 @return FALSE A parsing error occurred. 589 589 **/ 590 590 STATIC … … 1082 1082 1083 1083 /** 1084 Retri ve HII package list from ImageHandle and publish to HII database.1084 Retrieve HII package list from ImageHandle and publish to HII database. 1085 1085 1086 1086 @param ImageHandle The image handle of the process. … … 1088 1088 @return HII handle. 1089 1089 **/ 1090 EFI_H ANDLE1090 EFI_HII_HANDLE 1091 1091 InitializeHiiPackage ( 1092 1092 EFI_HANDLE ImageHandle … … 1095 1095 EFI_STATUS Status; 1096 1096 EFI_HII_PACKAGE_LIST_HEADER *PackageList; 1097 EFI_H ANDLEHiiHandle;1097 EFI_HII_HANDLE HiiHandle; 1098 1098 1099 1099 // -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.h
r80721 r85718 31 31 #include <Library/UefiHiiServicesLib.h> 32 32 33 extern EFI_H ANDLE mTftpHiiHandle;33 extern EFI_HII_HANDLE mTftpHiiHandle; 34 34 35 35 typedef struct { … … 57 57 58 58 /** 59 Retri ve HII package list from ImageHandle and publish to HII database.59 Retrieve HII package list from ImageHandle and publish to HII database. 60 60 61 61 @param ImageHandle The image handle of the process. … … 63 63 @return HII handle. 64 64 **/ 65 EFI_H ANDLE65 EFI_HII_HANDLE 66 66 InitializeHiiPackage ( 67 67 EFI_HANDLE ImageHandle -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.c
r80721 r85718 26 26 @param SystemTable The EFI System Table pointer. 27 27 28 @retval EFI_SUCCESS Tftp command is executed suc essfully.28 @retval EFI_SUCCESS Tftp command is executed successfully. 29 29 @retval EFI_ABORTED HII package was failed to initialize. 30 30 @retval others Other errors when executing tftp command. -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.c
r80721 r85718 21 21 of processing this command. 22 22 23 @return EFI_SUCCESS the operation was suc essful23 @return EFI_SUCCESS the operation was successful 24 24 @return other the operation failed. 25 25 **/ … … 72 72 @param SystemTable The EFI System Table pointer. 73 73 74 @retval EFI_SUCCESS Tftp command is executed suc essfully.74 @retval EFI_SUCCESS Tftp command is executed successfully. 75 75 @retval EFI_ABORTED HII package was failed to initialize. 76 76 @retval others Other errors when executing tftp command. -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Include/Library/ShellCommandLib.h
r80721 r85718 137 137 IN CONST CHAR16 *ProfileName, 138 138 IN CONST BOOLEAN CanAffectLE, 139 IN CONST EFI_H ANDLEHiiHandle,139 IN CONST EFI_HII_HANDLE HiiHandle, 140 140 IN CONST EFI_STRING_ID ManFormatHelp 141 141 ); -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Include/Library/ShellLib.h
r80721 r85718 966 966 IN CONST CHAR8 *Language OPTIONAL, 967 967 IN CONST EFI_STRING_ID HiiFormatStringId, 968 IN CONST EFI_H ANDLEHiiFormatHandle,968 IN CONST EFI_HII_HANDLE HiiFormatHandle, 969 969 ... 970 970 ); … … 1261 1261 IN SHELL_PROMPT_REQUEST_TYPE Type, 1262 1262 IN CONST EFI_STRING_ID HiiFormatStringId, 1263 IN CONST EFI_H ANDLEHiiFormatHandle,1263 IN CONST EFI_HII_HANDLE HiiFormatHandle, 1264 1264 IN OUT VOID **Response 1265 1265 ); -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
r80721 r85718 15 15 #include <Protocol/FirmwareVolume2.h> 16 16 17 EFI_H ANDLEmHandleParsingHiiHandle = NULL;17 EFI_HII_HANDLE mHandleParsingHiiHandle = NULL; 18 18 HANDLE_INDEX_LIST mHandleList = {{{NULL,NULL},0,0},0}; 19 19 GUID_INFO_BLOCK *mGuidList; … … 2463 2463 ) 2464 2464 { 2465 ASSERT(Guid != NULL); 2466 ASSERT(NameID != 0); 2467 2468 mGuidList = ReallocatePool(mGuidListCount * sizeof(GUID_INFO_BLOCK), mGuidListCount+1 * sizeof(GUID_INFO_BLOCK), mGuidList); 2465 ASSERT (Guid != NULL); 2466 ASSERT (NameID != 0); 2467 2468 mGuidList = ReallocatePool ( 2469 mGuidListCount * sizeof (GUID_INFO_BLOCK), 2470 (mGuidListCount + 1) * sizeof (GUID_INFO_BLOCK), 2471 mGuidList 2472 ); 2469 2473 if (mGuidList == NULL) { 2470 2474 mGuidListCount = 0; … … 2473 2477 mGuidListCount++; 2474 2478 2475 mGuidList[mGuidListCount - 1].GuidId = AllocateCopyPool (sizeof(EFI_GUID), Guid);2479 mGuidList[mGuidListCount - 1].GuidId = AllocateCopyPool (sizeof (EFI_GUID), Guid); 2476 2480 mGuidList[mGuidListCount - 1].StringId = NameID; 2477 2481 mGuidList[mGuidListCount - 1].DumpInfo = DumpFunc; -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
r80721 r85718 2 2 ACPI parser 3 3 4 Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.4 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 **/ … … 407 407 408 408 /** 409 This function traces 12 characters which can be optionally 410 formated using the format string if specified. 411 412 If no format string is specified the Format must be NULL. 413 414 @param [in] Format Optional format string for tracing the data. 415 @param [in] Ptr Pointer to the start of the buffer. 416 **/ 417 VOID 418 EFIAPI 419 Dump12Chars ( 420 IN CONST CHAR16* Format OPTIONAL, 421 IN UINT8* Ptr 422 ) 423 { 424 Print ( 425 (Format != NULL) ? Format : L"%c%c%c%c%c%c%c%c%c%c%c%c", 426 Ptr[0], 427 Ptr[1], 428 Ptr[2], 429 Ptr[3], 430 Ptr[4], 431 Ptr[5], 432 Ptr[6], 433 Ptr[7], 434 Ptr[8], 435 Ptr[9], 436 Ptr[10], 437 Ptr[11] 438 ); 439 } 440 441 /** 409 442 This function indents and prints the ACPI table Field Name. 410 443 … … 511 544 for (Index = 0; Index < ParserItems; Index++) { 512 545 if ((Offset + Parser[Index].Length) > Length) { 546 547 // For fields outside the buffer length provided, reset any pointers 548 // which were supposed to be updated by this function call 549 if (Parser[Index].ItemPtr != NULL) { 550 *Parser[Index].ItemPtr = NULL; 551 } 552 513 553 // We don't parse past the end of the max length specified 514 break;554 continue; 515 555 } 516 556 … … 634 674 ) 635 675 { 636 DumpGasStruct (Ptr, 2, GAS_LENGTH);676 DumpGasStruct (Ptr, 2, sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE)); 637 677 } 638 678 … … 655 695 "ACPI Table Header", 656 696 Ptr, 657 ACPI_DESCRIPTION_HEADER_LENGTH,697 sizeof (EFI_ACPI_DESCRIPTION_HEADER), 658 698 PARSER_PARAMS (AcpiHeaderParser) 659 699 ); … … 689 729 NULL, 690 730 Ptr, 691 ACPI_DESCRIPTION_HEADER_LENGTH,731 sizeof (EFI_ACPI_DESCRIPTION_HEADER), 692 732 PARSER_PARAMS (AcpiHeaderParser) 693 733 ); -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
r80721 r85718 2 2 Header file for ACPI parser 3 3 4 Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.4 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 **/ … … 183 183 IN CONST CHAR16* Format OPTIONAL, 184 184 IN UINT8* Ptr 185 ); 186 187 /** 188 This function traces 12 characters which can be optionally 189 formated using the format string if specified. 190 191 If no format string is specified the Format must be NULL. 192 193 @param [in] Format Optional format string for tracing the data. 194 @param [in] Ptr Pointer to the start of the buffer. 195 **/ 196 VOID 197 EFIAPI 198 Dump12Chars ( 199 IN CONST CHAR16* Format OPTIONAL, 200 IN UINT8* Ptr 185 201 ); 186 202 … … 382 398 383 399 /** 384 Length of the ACPI GAS structure.385 386 NOTE: This might normally be defined as387 sizeof (EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE).388 However, we deliberately minimise any reference to the EDK2 ACPI389 headers in an attempt to provide cross checking.390 **/391 #define GAS_LENGTH 12392 393 /**394 Length of the ACPI Header structure.395 396 NOTE: This might normally be defined as397 sizeof (EFI_ACPI_DESCRIPTION_HEADER).398 However, we deliberately minimise any reference to the EDK2 ACPI399 headers in an attempt to provide cross checking.400 **/401 #define ACPI_DESCRIPTION_HEADER_LENGTH 36402 403 /**404 400 This function indents and traces the GAS structure as described by the GasParser. 405 401 … … 523 519 EFIAPI 524 520 ParseAcpiDsdt ( 521 IN BOOLEAN Trace, 522 IN UINT8* Ptr, 523 IN UINT32 AcpiTableLength, 524 IN UINT8 AcpiTableRevision 525 ); 526 527 /** 528 This function parses the ACPI FACS table. 529 When trace is enabled this function parses the FACS table and 530 traces the ACPI table fields. 531 532 This function also performs validation of the ACPI table fields. 533 534 @param [in] Trace If TRUE, trace the ACPI fields. 535 @param [in] Ptr Pointer to the start of the buffer. 536 @param [in] AcpiTableLength Length of the ACPI table. 537 @param [in] AcpiTableRevision Revision of the ACPI table. 538 **/ 539 VOID 540 EFIAPI 541 ParseAcpiFacs ( 525 542 IN BOOLEAN Trace, 526 543 IN UINT8* Ptr, -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c
r80721 r85718 2 2 ACPI table parser 3 3 4 Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.4 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 7 @par Glossary: 8 - Sbbr or SBBR - Server Base Boot Requirements 9 10 @par Reference(s): 11 - Arm Server Base Boot Requirements 1.2, September 2019 6 12 **/ 7 13 … … 13 19 #include "AcpiView.h" 14 20 21 #if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) 22 #include "Arm/SbbrValidator.h" 23 #endif 24 15 25 /** 16 26 A list of registered ACPI table parsers. … … 177 187 CONST UINT32* AcpiTableLength; 178 188 CONST UINT8* AcpiTableRevision; 189 CONST UINT8* SignaturePtr; 179 190 PARSE_ACPI_TABLE_PROC ParserProc; 180 191 … … 194 205 if (Trace) { 195 206 DumpRaw (Ptr, *AcpiTableLength); 207 208 // Do not process the ACPI table any further if the table length read 209 // is invalid. The ACPI table should at least contain the table header. 210 if (*AcpiTableLength < sizeof (EFI_ACPI_DESCRIPTION_HEADER)) { 211 SignaturePtr = (CONST UINT8*)AcpiTableSignature; 212 IncrementErrorCount (); 213 Print ( 214 L"ERROR: Invalid %c%c%c%c table length. Length = %d\n", 215 SignaturePtr[0], 216 SignaturePtr[1], 217 SignaturePtr[2], 218 SignaturePtr[3], 219 *AcpiTableLength 220 ); 221 return; 222 } 223 196 224 if (GetConsistencyChecking ()) { 197 225 VerifyChecksum (TRUE, Ptr, *AcpiTableLength); 198 226 } 199 227 } 228 229 #if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) 230 if (GetMandatoryTableValidate ()) { 231 ArmSbbrIncrementTableCount (*AcpiTableSignature); 232 } 233 #endif 200 234 201 235 Status = GetParser (*AcpiTableSignature, &ParserProc); -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
r80721 r85718 1 1 /** @file 2 2 3 Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.3 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. 4 4 SPDX-License-Identifier: BSD-2-Clause-Patent 5 6 @par Glossary: 7 - Sbbr or SBBR - Server Base Boot Requirements 8 9 @par Reference(s): 10 - Arm Server Base Boot Requirements 1.2, September 2019 5 11 **/ 6 12 … … 17 23 #include "UefiShellAcpiViewCommandLib.h" 18 24 25 #if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) 26 #include "Arm/SbbrValidator.h" 27 #endif 28 19 29 EFI_HII_HANDLE gShellAcpiViewHiiHandle = NULL; 20 30 … … 28 38 STATIC BOOLEAN mConsistencyCheck; 29 39 STATIC BOOLEAN mColourHighlighting; 40 STATIC BOOLEAN mMandatoryTableValidate; 41 STATIC UINTN mMandatoryTableSpec; 30 42 31 43 /** … … 38 50 {L"-l", TypeFlag}, 39 51 {L"-s", TypeValue}, 52 {L"-r", TypeValue}, 40 53 {NULL, TypeMax} 41 54 }; … … 93 106 { 94 107 mConsistencyCheck = ConsistencyChecking; 108 } 109 110 /** 111 This function returns the ACPI table requirements validation flag. 112 113 @retval TRUE if check for mandatory table presence should be performed. 114 **/ 115 BOOLEAN 116 GetMandatoryTableValidate ( 117 VOID 118 ) 119 { 120 return mMandatoryTableValidate; 121 } 122 123 /** 124 This function sets the ACPI table requirements validation flag. 125 126 @param Validate Enable/Disable ACPI table requirements validation. 127 **/ 128 VOID 129 SetMandatoryTableValidate ( 130 BOOLEAN Validate 131 ) 132 { 133 mMandatoryTableValidate = Validate; 134 } 135 136 /** 137 This function returns the identifier of specification to validate ACPI table 138 requirements against. 139 140 @return ID of specification listing mandatory tables. 141 **/ 142 UINTN 143 GetMandatoryTableSpec ( 144 VOID 145 ) 146 { 147 return mMandatoryTableSpec; 148 } 149 150 /** 151 This function sets the identifier of specification to validate ACPI table 152 requirements against. 153 154 @param Spec ID of specification listing mandatory tables. 155 **/ 156 VOID 157 SetMandatoryTableSpec ( 158 UINTN Spec 159 ) 160 { 161 mMandatoryTableSpec = Spec; 95 162 } 96 163 … … 382 449 } 383 450 451 #if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) 452 if (GetMandatoryTableValidate ()) { 453 ArmSbbrResetTableCounts (); 454 } 455 #endif 456 384 457 // The RSDP length is 4 bytes starting at offset 20 385 458 RsdpLength = *(UINT32*)(RsdpPtr + RSDP_LENGTH_OFFSET); … … 409 482 return EFI_NOT_FOUND; 410 483 } 484 485 #if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) 486 if (GetMandatoryTableValidate ()) { 487 ArmSbbrReqsValidate ((ARM_SBBR_VERSION)GetMandatoryTableSpec ()); 488 } 489 #endif 411 490 412 491 ReportOption = GetReportOption (); … … 471 550 CHAR16* ProblemParam; 472 551 SHELL_FILE_HANDLE TmpDumpFileHandle; 552 CONST CHAR16* MandatoryTableSpecStr; 473 553 474 554 // Set Defaults … … 480 560 mSelectedAcpiTableFound = FALSE; 481 561 mConsistencyCheck = TRUE; 562 mMandatoryTableValidate = FALSE; 563 mMandatoryTableSpec = 0; 482 564 483 565 ShellStatus = SHELL_SUCCESS; … … 536 618 L"acpiview", 537 619 L"-s" 620 ); 621 ShellStatus = SHELL_INVALID_PARAMETER; 622 } else if (ShellCommandLineGetFlag (Package, L"-r") && 623 ShellCommandLineGetValue (Package, L"-r") == NULL) { 624 ShellPrintHiiEx ( 625 -1, 626 -1, 627 NULL, 628 STRING_TOKEN (STR_GEN_NO_VALUE), 629 gShellAcpiViewHiiHandle, 630 L"acpiview", 631 L"-r" 538 632 ); 539 633 ShellStatus = SHELL_INVALID_PARAMETER; … … 569 663 SetConsistencyChecking (!ShellCommandLineGetFlag (Package, L"-q")); 570 664 665 // Evaluate the parameters for mandatory ACPI table presence checks 666 SetMandatoryTableValidate (ShellCommandLineGetFlag (Package, L"-r")); 667 MandatoryTableSpecStr = ShellCommandLineGetValue (Package, L"-r"); 668 669 if (MandatoryTableSpecStr != NULL) { 670 SetMandatoryTableSpec (ShellHexStrToUintn (MandatoryTableSpecStr)); 671 } 672 571 673 if (ShellCommandLineGetFlag (Package, L"-l")) { 572 674 mReportType = ReportTableList; -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h
r80721 r85718 2 2 Header file for AcpiView 3 3 4 Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.4 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 **/ … … 114 114 115 115 /** 116 This function returns the ACPI table requirements validation flag. 117 118 @retval TRUE if check for mandatory table presence should be performed. 119 **/ 120 BOOLEAN 121 GetMandatoryTableValidate ( 122 VOID 123 ); 124 125 /** 126 This function sets the ACPI table requirements validation flag. 127 128 @param Validate Enable/Disable ACPI table requirements validation. 129 **/ 130 VOID 131 SetMandatoryTableValidate ( 132 BOOLEAN Validate 133 ); 134 135 /** 136 This function returns the identifier of specification to validate ACPI table 137 requirements against. 138 139 @return ID of specification listing mandatory tables. 140 **/ 141 UINTN 142 GetMandatoryTableSpec ( 143 VOID 144 ); 145 146 /** 147 This function sets the identifier of specification to validate ACPI table 148 requirements against. 149 150 @param Spec ID of specification listing mandatory tables. 151 **/ 152 VOID 153 SetMandatoryTableSpec ( 154 UINTN Spec 155 ); 156 157 /** 116 158 This function processes the table reporting options for the ACPI table. 117 159 -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c
r80721 r85718 2 2 DBG2 table parser 3 3 4 Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.4 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 … … 123 123 PARSER_PARAMS (DbgDevInfoParser) 124 124 ); 125 126 // Check if the values used to control the parsing logic have been 127 // successfully read. 128 if ((GasCount == NULL) || 129 (NameSpaceStringLength == NULL) || 130 (NameSpaceStringOffset == NULL) || 131 (OEMDataLength == NULL) || 132 (OEMDataOffset == NULL) || 133 (BaseAddrRegOffset == NULL) || 134 (AddrSizeOffset == NULL)) { 135 IncrementErrorCount (); 136 Print ( 137 L"ERROR: Insufficient Debug Device Information Structure length. " \ 138 L"Length = %d.\n", 139 Length 140 ); 141 return; 142 } 125 143 126 144 // GAS … … 225 243 ); 226 244 245 // Check if the values used to control the parsing logic have been 246 // successfully read. 247 if ((OffsetDbgDeviceInfo == NULL) || 248 (NumberDbgDeviceInfo == NULL)) { 249 IncrementErrorCount (); 250 Print ( 251 L"ERROR: Insufficient table length. AcpiTableLength = %d\n", 252 AcpiTableLength 253 ); 254 return; 255 } 256 227 257 Offset = *OffsetDbgDeviceInfo; 228 258 Index = 0; … … 240 270 ); 241 271 242 // Make sure the Debug Device Information structure lies inside the table. 243 if ((Offset + *DbgDevInfoLen) > AcpiTableLength) { 272 // Check if the values used to control the parsing logic have been 273 // successfully read. 274 if (DbgDevInfoLen == NULL) { 244 275 IncrementErrorCount (); 245 276 Print ( 246 L"ERROR: Invalid Debug Device Information structure length. " \ 247 L"DbgDevInfoLen = %d. RemainingTableBufferLength = %d. " \ 248 L"DBG2 parsing aborted.\n", 249 *DbgDevInfoLen, 277 L"ERROR: Insufficient remaining table buffer length to read the " \ 278 L"Debug Device Information structure's 'Length' field. " \ 279 L"RemainingTableBufferLength = %d.\n", 250 280 AcpiTableLength - Offset 251 281 ); … … 253 283 } 254 284 285 // Validate Debug Device Information Structure length 286 if ((*DbgDevInfoLen == 0) || 287 ((Offset + (*DbgDevInfoLen)) > AcpiTableLength)) { 288 IncrementErrorCount (); 289 Print ( 290 L"ERROR: Invalid Debug Device Information Structure length. " \ 291 L"Length = %d. Offset = %d. AcpiTableLength = %d.\n", 292 *DbgDevInfoLen, 293 Offset, 294 AcpiTableLength 295 ); 296 return; 297 } 298 255 299 DumpDbgDeviceInfo (Ptr + Offset, (*DbgDevInfoLen)); 256 300 Offset += (*DbgDevInfoLen); -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
r80721 r85718 2 2 FADT table parser 3 3 4 Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.4 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 7 7 @par Reference(s): 8 - ACPI 6. 2 Specification - Errata A, September 20178 - ACPI 6.3 Specification - January 2019 9 9 **/ 10 10 … … 13 13 #include "AcpiParser.h" 14 14 #include "AcpiTableParser.h" 15 #include "AcpiView.h" 15 16 16 17 // Local variables 17 18 STATIC CONST UINT32* DsdtAddress; 18 19 STATIC CONST UINT64* X_DsdtAddress; 20 STATIC CONST UINT32* Flags; 21 STATIC CONST UINT32* FirmwareCtrl; 22 STATIC CONST UINT64* X_FirmwareCtrl; 19 23 STATIC CONST UINT8* FadtMinorRevision; 20 24 STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; … … 24 28 **/ 25 29 #define HW_REDUCED_ACPI BIT20 30 31 /** 32 Offset to the FACS signature from the start of the FACS. 33 **/ 34 #define FACS_SIGNATURE_OFFSET 0 35 36 /** 37 Offset to the FACS revision from the start of the FACS. 38 **/ 39 #define FACS_VERSION_OFFSET 32 40 41 /** 42 Offset to the FACS length from the start of the FACS. 43 **/ 44 #define FACS_LENGTH_OFFSET 4 26 45 27 46 /** … … 114 133 STATIC CONST ACPI_PARSER FadtParser[] = { 115 134 PARSE_ACPI_HEADER (&AcpiHdrInfo), 116 {L"FIRMWARE_CTRL", 4, 36, L"0x%x", NULL, NULL, ValidateFirmwareCtrl, NULL}, 135 {L"FIRMWARE_CTRL", 4, 36, L"0x%x", NULL, (VOID**)&FirmwareCtrl, 136 ValidateFirmwareCtrl, NULL}, 117 137 {L"DSDT", 4, 40, L"0x%x", NULL, (VOID**)&DsdtAddress, NULL, NULL}, 118 138 {L"Reserved", 1, 44, L"%x", NULL, NULL, NULL, NULL}, … … 151 171 {L"IAPC_BOOT_ARCH", 2, 109, L"0x%x", NULL, NULL, NULL, NULL}, 152 172 {L"Reserved", 1, 111, L"0x%x", NULL, NULL, NULL, NULL}, 153 {L"Flags", 4, 112, L"0x%x", NULL, NULL, ValidateFlags, NULL},173 {L"Flags", 4, 112, L"0x%x", NULL, (VOID**)&Flags, ValidateFlags, NULL}, 154 174 {L"RESET_REG", 12, 116, NULL, DumpGas, NULL, NULL, NULL}, 155 175 {L"RESET_VALUE", 1, 128, L"0x%x", NULL, NULL, NULL, NULL}, … … 157 177 {L"FADT Minor Version", 1, 131, L"0x%x", NULL, (VOID**)&FadtMinorRevision, 158 178 NULL, NULL}, 159 {L"X_FIRMWARE_CTRL", 8, 132, L"0x%lx", NULL, NULL,179 {L"X_FIRMWARE_CTRL", 8, 132, L"0x%lx", NULL, (VOID**)&X_FirmwareCtrl, 160 180 ValidateXFirmwareCtrl, NULL}, 161 181 {L"X_DSDT", 8, 140, L"0x%lx", NULL, (VOID**)&X_DsdtAddress, NULL, NULL}, … … 193 213 ) 194 214 { 195 UINT8* DsdtPtr; 215 EFI_STATUS Status; 216 UINT8* DsdtPtr; 217 UINT8* FirmwareCtrlPtr; 218 UINT32 FacsSignature; 219 UINT32 FacsLength; 220 UINT8 FacsRevision; 221 PARSE_ACPI_TABLE_PROC FacsParserProc; 196 222 197 223 ParseAcpi ( … … 205 231 206 232 if (Trace) { 207 Print (L"\nSummary:\n"); 208 PrintFieldName (2, L"FADT Version"); 209 Print (L"%d.%d\n", *AcpiHdrInfo.Revision, *FadtMinorRevision); 233 if (FadtMinorRevision != NULL) { 234 Print (L"\nSummary:\n"); 235 PrintFieldName (2, L"FADT Version"); 236 Print (L"%d.%d\n", *AcpiHdrInfo.Revision, *FadtMinorRevision); 237 } 210 238 211 239 if (*GetAcpiXsdtHeaderInfo ()->OemTableId != *AcpiHdrInfo.OemTableId) { … … 215 243 } 216 244 217 // If X_DSDT is not zero then use X_DSDT and ignore DSDT, 218 // else use DSDT. 219 if (*X_DsdtAddress != 0) { 245 // If X_FIRMWARE_CTRL is not zero then use X_FIRMWARE_CTRL and ignore 246 // FIRMWARE_CTRL, else use FIRMWARE_CTRL. 247 if ((X_FirmwareCtrl != NULL) && (*X_FirmwareCtrl != 0)) { 248 FirmwareCtrlPtr = (UINT8*)(UINTN)(*X_FirmwareCtrl); 249 } else if ((FirmwareCtrl != NULL) && (*FirmwareCtrl != 0)) { 250 FirmwareCtrlPtr = (UINT8*)(UINTN)(*FirmwareCtrl); 251 } else { 252 FirmwareCtrlPtr = NULL; 253 // if HW_REDUCED_ACPI flag is not set, both FIRMWARE_CTRL and 254 // X_FIRMWARE_CTRL cannot be zero, and the FACS Table must be 255 // present. 256 if ((Trace) && 257 (Flags != NULL) && 258 ((*Flags & EFI_ACPI_6_3_HW_REDUCED_ACPI) != EFI_ACPI_6_3_HW_REDUCED_ACPI)) { 259 IncrementErrorCount (); 260 Print (L"ERROR: No FACS table found, " 261 L"both X_FIRMWARE_CTRL and FIRMWARE_CTRL are zero.\n"); 262 } 263 } 264 265 if (FirmwareCtrlPtr != NULL) { 266 // The FACS table does not have a standard ACPI table header. Therefore, 267 // the signature, length and version needs to be initially parsed. 268 // The FACS signature is 4 bytes starting at offset 0. 269 FacsSignature = *(UINT32*)(FirmwareCtrlPtr + FACS_SIGNATURE_OFFSET); 270 271 // The FACS length is 4 bytes starting at offset 4. 272 FacsLength = *(UINT32*)(FirmwareCtrlPtr + FACS_LENGTH_OFFSET); 273 274 // The FACS version is 1 byte starting at offset 32. 275 FacsRevision = *(UINT8*)(FirmwareCtrlPtr + FACS_VERSION_OFFSET); 276 277 Trace = ProcessTableReportOptions ( 278 FacsSignature, 279 FirmwareCtrlPtr, 280 FacsLength 281 ); 282 283 Status = GetParser (FacsSignature, &FacsParserProc); 284 if (EFI_ERROR (Status)) { 285 Print ( 286 L"ERROR: No registered parser found for FACS.\n" 287 ); 288 return; 289 } 290 291 FacsParserProc ( 292 Trace, 293 FirmwareCtrlPtr, 294 FacsLength, 295 FacsRevision 296 ); 297 } 298 299 // If X_DSDT is valid then use X_DSDT and ignore DSDT, else use DSDT. 300 if ((X_DsdtAddress != NULL) && (*X_DsdtAddress != 0)) { 220 301 DsdtPtr = (UINT8*)(UINTN)(*X_DsdtAddress); 221 } else if ( *DsdtAddress != 0) {302 } else if ((DsdtAddress != NULL) && (*DsdtAddress != 0)) { 222 303 DsdtPtr = (UINT8*)(UINTN)(*DsdtAddress); 223 304 } else { 224 // Both DSDT and X_DSDT cannot be zero.305 // Both DSDT and X_DSDT cannot be invalid. 225 306 #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) 226 307 if (Trace) { … … 229 310 // the DSDT. 230 311 IncrementErrorCount (); 231 Print (L"ERROR: Both X_DSDT and DSDT are NULL.\n");312 Print (L"ERROR: Both X_DSDT and DSDT are invalid.\n"); 232 313 } 233 314 #endif -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c
r80721 r85718 2 2 GTDT table parser 3 3 4 Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.4 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 … … 189 189 PARSER_PARAMS (GtBlockParser) 190 190 ); 191 192 // Check if the values used to control the parsing logic have been 193 // successfully read. 194 if ((GtBlockTimerCount == NULL) || 195 (GtBlockTimerOffset == NULL)) { 196 IncrementErrorCount (); 197 Print ( 198 L"ERROR: Insufficient GT Block Structure length. Length = %d.\n", 199 Length 200 ); 201 return; 202 } 191 203 192 204 Offset = *GtBlockTimerOffset; … … 273 285 ); 274 286 287 // Check if the values used to control the parsing logic have been 288 // successfully read. 289 if ((GtdtPlatformTimerCount == NULL) || 290 (GtdtPlatformTimerOffset == NULL)) { 291 IncrementErrorCount (); 292 Print ( 293 L"ERROR: Insufficient table length. AcpiTableLength = %d.\n", 294 AcpiTableLength 295 ); 296 return; 297 } 298 275 299 TimerPtr = Ptr + *GtdtPlatformTimerOffset; 276 300 Offset = *GtdtPlatformTimerOffset; … … 291 315 ); 292 316 293 // Make sure the Platform Timer is inside the table. 294 if ((Offset + *PlatformTimerLength) > AcpiTableLength) { 317 // Check if the values used to control the parsing logic have been 318 // successfully read. 319 if ((PlatformTimerType == NULL) || 320 (PlatformTimerLength == NULL)) { 321 IncrementErrorCount (); 322 Print ( 323 L"ERROR: Insufficient remaining table buffer length to read the " \ 324 L"Platform Timer Structure header. Length = %d.\n", 325 AcpiTableLength - Offset 326 ); 327 return; 328 } 329 330 // Validate Platform Timer Structure length 331 if ((*PlatformTimerLength == 0) || 332 ((Offset + (*PlatformTimerLength)) > AcpiTableLength)) { 295 333 IncrementErrorCount (); 296 334 Print ( 297 335 L"ERROR: Invalid Platform Timer Structure length. " \ 298 L"PlatformTimerLength = %d. RemainingTableBufferLength = %d. " \ 299 L"GTDT parsing aborted.\n", 336 L"Length = %d. Offset = %d. AcpiTableLength = %d.\n", 300 337 *PlatformTimerLength, 301 AcpiTableLength - Offset 338 Offset, 339 AcpiTableLength 302 340 ); 303 341 return; -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
r80721 r85718 2 2 IORT table parser 3 3 4 Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.4 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 7 7 @par Reference(s): 8 - IO Remapping Table, Platform Design Document, Revision C, 15 May 20178 - IO Remapping Table, Platform Design Document, Revision D, March 2018 9 9 **/ 10 10 … … 194 194 {L"PRI", 4, 48, L"0x%x", NULL, NULL, NULL, NULL}, 195 195 {L"GERR", 4, 52, L"0x%x", NULL, NULL, NULL, NULL}, 196 {L"Sync", 4, 56, L"0x%x", NULL, NULL, NULL, NULL} 196 {L"Sync", 4, 56, L"0x%x", NULL, NULL, NULL, NULL}, 197 {L"Proximity domain", 4, 60, L"0x%x", NULL, NULL, NULL, NULL}, 198 {L"Device ID mapping index", 4, 64, L"%d", NULL, NULL, NULL, NULL} 197 199 }; 198 200 … … 232 234 {L"Memory access properties", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL}, 233 235 {L"ATS Attribute", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}, 234 {L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, NULL, NULL} 236 {L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}, 237 {L"Memory access size limit", 1, 32, L"0x%x", NULL, NULL, NULL, NULL}, 238 {L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL} 235 239 }; 236 240 … … 240 244 STATIC CONST ACPI_PARSER IortNodePmcgParser[] = { 241 245 PARSE_IORT_NODE_HEADER (ValidatePmcgIdMappingCount, NULL), 242 {L" Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL},246 {L"Page 0 Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL}, 243 247 {L"Overflow interrupt GSIV", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}, 244 248 {L"Node reference", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}, 249 {L"Page 1 Base Address", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL} 245 250 }; 246 251 … … 318 323 ); 319 324 325 // Check if the values used to control the parsing logic have been 326 // successfully read. 327 if ((InterruptContextCount == NULL) || 328 (InterruptContextOffset == NULL) || 329 (PmuInterruptCount == NULL) || 330 (PmuInterruptOffset == NULL)) { 331 IncrementErrorCount (); 332 Print ( 333 L"ERROR: Insufficient SMMUv1/2 node length. Length = %d\n", 334 Length 335 ); 336 return; 337 } 338 320 339 Offset = *InterruptContextOffset; 321 340 Index = 0; … … 429 448 ); 430 449 450 // Check if the values used to control the parsing logic have been 451 // successfully read. 452 if (ItsCount == NULL) { 453 IncrementErrorCount (); 454 Print ( 455 L"ERROR: Insufficient ITS group length. Length = %d.\n", 456 Length 457 ); 458 return; 459 } 460 431 461 Index = 0; 432 462 … … 613 643 ); 614 644 645 // Check if the values used to control the parsing logic have been 646 // successfully read. 647 if ((IortNodeCount == NULL) || 648 (IortNodeOffset == NULL)) { 649 IncrementErrorCount (); 650 Print ( 651 L"ERROR: Insufficient table length. AcpiTableLength = %d.\n", 652 AcpiTableLength 653 ); 654 return; 655 } 656 615 657 Offset = *IortNodeOffset; 616 658 NodePtr = Ptr + Offset; … … 631 673 ); 632 674 633 // Make sure the IORT Node is inside the table 634 if ((Offset + (*IortNodeLength)) > AcpiTableLength) { 675 // Check if the values used to control the parsing logic have been 676 // successfully read. 677 if ((IortNodeType == NULL) || 678 (IortNodeLength == NULL) || 679 (IortIdMappingCount == NULL) || 680 (IortIdMappingOffset == NULL)) { 635 681 IncrementErrorCount (); 636 682 Print ( 637 L"ERROR: Invalid IORT node length. IortNodeLength = %d. " \ 638 L"RemainingTableBufferLength = %d. IORT parsing aborted.\n", 683 L"ERROR: Insufficient remaining table buffer length to read the " \ 684 L"IORT node header. Length = %d.\n", 685 AcpiTableLength - Offset 686 ); 687 return; 688 } 689 690 // Validate IORT Node length 691 if ((*IortNodeLength == 0) || 692 ((Offset + (*IortNodeLength)) > AcpiTableLength)) { 693 IncrementErrorCount (); 694 Print ( 695 L"ERROR: Invalid IORT Node length. " \ 696 L"Length = %d. Offset = %d. AcpiTableLength = %d.\n", 639 697 *IortNodeLength, 640 AcpiTableLength - Offset 698 Offset, 699 AcpiTableLength 641 700 ); 642 701 return; -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c
r80721 r85718 2 2 MADT table parser 3 3 4 Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.4 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 … … 261 261 ); 262 262 263 // Make sure forward progress is made. 264 if (*MadtInterruptControllerLength < 2) { 263 // Check if the values used to control the parsing logic have been 264 // successfully read. 265 if ((MadtInterruptControllerType == NULL) || 266 (MadtInterruptControllerLength == NULL)) { 265 267 IncrementErrorCount (); 266 268 Print ( 267 L"ERROR: Structure length is too small: " \ 268 L"MadtInterruptControllerLength = %d. " \ 269 L"MadtInterruptControllerType = %d. MADT parsing aborted.\n", 270 *MadtInterruptControllerLength, 271 *MadtInterruptControllerType 269 L"ERROR: Insufficient remaining table buffer length to read the " \ 270 L"Interrupt Controller Structure header. Length = %d.\n", 271 AcpiTableLength - Offset 272 272 ); 273 273 return; 274 274 } 275 275 276 // Make sure the MADT structure lies inside the table 277 if ((Offset + *MadtInterruptControllerLength) > AcpiTableLength) { 276 // Validate Interrupt Controller Structure length 277 if ((*MadtInterruptControllerLength == 0) || 278 ((Offset + (*MadtInterruptControllerLength)) > AcpiTableLength)) { 278 279 IncrementErrorCount (); 279 280 Print ( 280 L"ERROR: Invalid MADT structure length. " \ 281 L"MadtInterruptControllerLength = %d. " \ 282 L"RemainingTableBufferLength = %d. MADT parsing aborted.\n", 281 L"ERROR: Invalid Interrupt Controller Structure length. " \ 282 L"Length = %d. Offset = %d. AcpiTableLength = %d.\n", 283 283 *MadtInterruptControllerLength, 284 AcpiTableLength - Offset 284 Offset, 285 AcpiTableLength 285 286 ); 286 287 return; -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
r80721 r85718 2 2 PPTT table parser 3 3 4 Copyright (c) 2019 , ARM Limited. All rights reserved.4 Copyright (c) 2019 - 2020, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 … … 265 265 ); 266 266 267 // Check if the values used to control the parsing logic have been 268 // successfully read. 269 if (NumberOfPrivateResources == NULL) { 270 IncrementErrorCount (); 271 Print ( 272 L"ERROR: Insufficient Processor Hierarchy Node length. Length = %d.\n", 273 Length 274 ); 275 return; 276 } 277 267 278 // Make sure the Private Resource array lies inside this structure 268 279 if (Offset + (*NumberOfPrivateResources * sizeof (UINT32)) > Length) { … … 388 399 PARSER_PARAMS (PpttParser) 389 400 ); 401 390 402 ProcessorTopologyStructurePtr = Ptr + Offset; 391 403 … … 401 413 ); 402 414 403 // Make sure the PPTT structure lies inside the table 404 if ((Offset + *ProcessorTopologyStructureLength) > AcpiTableLength) { 415 // Check if the values used to control the parsing logic have been 416 // successfully read. 417 if ((ProcessorTopologyStructureType == NULL) || 418 (ProcessorTopologyStructureLength == NULL)) { 405 419 IncrementErrorCount (); 406 420 Print ( 407 L"ERROR: Invalid PPTT structure length. " \ 408 L"ProcessorTopologyStructureLength = %d. " \ 409 L"RemainingTableBufferLength = %d. PPTT parsing aborted.\n", 421 L"ERROR: Insufficient remaining table buffer length to read the " \ 422 L"processor topology structure header. Length = %d.\n", 423 AcpiTableLength - Offset 424 ); 425 return; 426 } 427 428 // Validate Processor Topology Structure length 429 if ((*ProcessorTopologyStructureLength == 0) || 430 ((Offset + (*ProcessorTopologyStructureLength)) > AcpiTableLength)) { 431 IncrementErrorCount (); 432 Print ( 433 L"ERROR: Invalid Processor Topology Structure length. " \ 434 L"Length = %d. Offset = %d. AcpiTableLength = %d.\n", 410 435 *ProcessorTopologyStructureLength, 411 AcpiTableLength - Offset 436 Offset, 437 AcpiTableLength 412 438 ); 413 439 return; -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c
r80721 r85718 139 139 ); 140 140 141 // Check if the values used to control the parsing logic have been 142 // successfully read. 143 if (XsdtAddress == NULL) { 144 IncrementErrorCount (); 145 Print ( 146 L"ERROR: Insufficient table length. AcpiTableLength = %d." \ 147 L"RSDP parsing aborted.\n", 148 AcpiTableLength 149 ); 150 return; 151 } 152 141 153 // This code currently supports parsing of XSDT table only 142 154 // and does not parse the RSDT table. Platforms provide the -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c
r80721 r85718 2 2 SLIT table parser 3 3 4 Copyright (c) 2016 - 201 8, ARM Limited. All rights reserved.4 Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 … … 31 31 Macro to get the value of a System Locality 32 32 **/ 33 #define SLIT_ELEMENT(Ptr, i, j) *(Ptr + ( MultU64x64 (i, LocalityCount)) + j)33 #define SLIT_ELEMENT(Ptr, i, j) *(Ptr + (i * LocalityCount) + j) 34 34 35 35 /** … … 58 58 { 59 59 UINT32 Offset; 60 UINT 64Count;61 UINT 64Index;62 UINT 64LocalityCount;60 UINT32 Count; 61 UINT32 Index; 62 UINT32 LocalityCount; 63 63 UINT8* LocalityPtr; 64 64 CHAR16 Buffer[80]; // Used for AsciiName param of ParseAcpi … … 76 76 PARSER_PARAMS (SlitParser) 77 77 ); 78 79 // Check if the values used to control the parsing logic have been 80 // successfully read. 81 if (SlitSystemLocalityCount == NULL) { 82 IncrementErrorCount (); 83 Print ( 84 L"ERROR: Insufficient table length. AcpiTableLength = %d.\n", 85 AcpiTableLength 86 ); 87 return; 88 } 89 90 /* 91 Despite the 'Number of System Localities' being a 64-bit field in SLIT, 92 the maximum number of localities that can be represented in SLIT is limited 93 by the 'Length' field of the ACPI table. 94 95 Since the ACPI table length field is 32-bit wide. The maximum number of 96 localities that can be represented in SLIT can be calculated as: 97 98 MaxLocality = sqrt (MAX_UINT32 - sizeof (EFI_ACPI_6_3_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER)) 99 = 65535 100 = MAX_UINT16 101 */ 102 if (*SlitSystemLocalityCount > MAX_UINT16) { 103 IncrementErrorCount (); 104 Print ( 105 L"ERROR: The Number of System Localities provided can't be represented " \ 106 L"in the SLIT table. SlitSystemLocalityCount = %ld. " \ 107 L"MaxLocalityCountAllowed = %d.\n", 108 *SlitSystemLocalityCount, 109 MAX_UINT16 110 ); 111 return; 112 } 113 114 LocalityCount = (UINT32)*SlitSystemLocalityCount; 115 116 // Make sure system localities fit in the table buffer provided 117 if (Offset + (LocalityCount * LocalityCount) > AcpiTableLength) { 118 IncrementErrorCount (); 119 Print ( 120 L"ERROR: Invalid Number of System Localities. " \ 121 L"SlitSystemLocalityCount = %ld. AcpiTableLength = %d.\n", 122 *SlitSystemLocalityCount, 123 AcpiTableLength 124 ); 125 return; 126 } 127 78 128 LocalityPtr = Ptr + Offset; 79 129 80 LocalityCount = *SlitSystemLocalityCount;81 130 // We only print the Localities if the count is less than 16 82 131 // If the locality count is more than 16 then refer to the -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
r80721 r85718 2 2 SRAT table parser 3 3 4 Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.4 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 7 7 @par Reference(s): 8 - ACPI 6. 2 Specification - Errata A, September 20178 - ACPI 6.3 Specification - January 2019 9 9 **/ 10 10 … … 18 18 STATIC CONST UINT8* SratRAType; 19 19 STATIC CONST UINT8* SratRALength; 20 STATIC CONST UINT8* SratDeviceHandleType; 20 21 STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; 21 22 … … 42 43 43 44 /** 45 This function validates the Device Handle Type field in the Generic Initiator 46 Affinity Structure. 47 48 @param [in] Ptr Pointer to the start of the field data. 49 @param [in] Context Pointer to context specific information e.g. this 50 could be a pointer to the ACPI table header. 51 **/ 52 STATIC 53 VOID 54 EFIAPI 55 ValidateSratDeviceHandleType ( 56 IN UINT8* Ptr, 57 IN VOID* Context 58 ) 59 { 60 UINT8 DeviceHandleType; 61 62 DeviceHandleType = *Ptr; 63 64 if (DeviceHandleType > EFI_ACPI_6_3_PCI_DEVICE_HANDLE) { 65 IncrementErrorCount (); 66 Print ( 67 L"\nERROR: Invalid Device Handle Type: %d. Must be between 0 and %d.", 68 DeviceHandleType, 69 EFI_ACPI_6_3_PCI_DEVICE_HANDLE 70 ); 71 } 72 } 73 74 /** 75 This function traces the PCI BDF Number field inside Device Handle - PCI 76 77 @param [in] Format Format string for tracing the data. 78 @param [in] Ptr Pointer to the start of the buffer. 79 **/ 80 STATIC 81 VOID 82 EFIAPI 83 DumpSratPciBdfNumber ( 84 IN CONST CHAR16* Format, 85 IN UINT8* Ptr 86 ) 87 { 88 CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH]; 89 90 Print (L"\n"); 91 92 /* 93 The PCI BDF Number subfields are printed in the order specified in the ACPI 94 specification. The format of the 16-bit PCI BDF Number field is as follows: 95 96 +-----+------+------+ 97 |DEV | FUNC | BUS | 98 +-----+------+------+ 99 |15:11| 10:8 | 7:0 | 100 +-----+------+------+ 101 */ 102 103 // Print PCI Bus Number (Bits 7:0 of Byte 2) 104 UnicodeSPrint ( 105 Buffer, 106 sizeof (Buffer), 107 L"PCI Bus Number" 108 ); 109 PrintFieldName (4, Buffer); 110 Print ( 111 L"0x%x\n", 112 *Ptr 113 ); 114 115 Ptr++; 116 117 // Print PCI Device Number (Bits 7:3 of Byte 3) 118 UnicodeSPrint ( 119 Buffer, 120 sizeof (Buffer), 121 L"PCI Device Number" 122 ); 123 PrintFieldName (4, Buffer); 124 Print ( 125 L"0x%x\n", 126 (*Ptr & (BIT7 | BIT6 | BIT5 | BIT4 | BIT3)) >> 3 127 ); 128 129 // PCI Function Number (Bits 2:0 of Byte 3) 130 UnicodeSPrint ( 131 Buffer, 132 sizeof (Buffer), 133 L"PCI Function Number" 134 ); 135 PrintFieldName (4, Buffer); 136 Print ( 137 L"0x%x\n", 138 *Ptr & (BIT2 | BIT1 | BIT0) 139 ); 140 } 141 142 /** 143 An ACPI_PARSER array describing the Device Handle - ACPI 144 **/ 145 STATIC CONST ACPI_PARSER SratDeviceHandleAcpiParser[] = { 146 {L"ACPI_HID", 8, 0, L"0x%lx", NULL, NULL, NULL, NULL}, 147 {L"ACPI_UID", 4, 8, L"0x%x", NULL, NULL, NULL, NULL}, 148 {L"Reserved", 4, 12, L"0x%x", NULL, NULL, NULL, NULL} 149 }; 150 151 /** 152 An ACPI_PARSER array describing the Device Handle - PCI 153 **/ 154 STATIC CONST ACPI_PARSER SratDeviceHandlePciParser[] = { 155 {L"PCI Segment", 2, 0, L"0x%x", NULL, NULL, NULL, NULL}, 156 {L"PCI BDF Number", 2, 2, NULL, DumpSratPciBdfNumber, NULL, NULL, NULL}, 157 {L"Reserved", 12, 4, L"%x %x %x %x - %x %x %x %x - %x %x %x %x", Dump12Chars, 158 NULL, NULL, NULL} 159 }; 160 161 /** 162 This function traces the Device Handle field inside Generic Initiator 163 Affinity Structure. 164 165 @param [in] Format Format string for tracing the data. 166 @param [in] Ptr Pointer to the start of the buffer. 167 **/ 168 STATIC 169 VOID 170 EFIAPI 171 DumpSratDeviceHandle ( 172 IN CONST CHAR16* Format, 173 IN UINT8* Ptr 174 ) 175 { 176 if (SratDeviceHandleType == NULL) { 177 IncrementErrorCount (); 178 Print (L"\nERROR: Device Handle Type read incorrectly.\n"); 179 return; 180 } 181 182 Print (L"\n"); 183 184 if (*SratDeviceHandleType == EFI_ACPI_6_3_ACPI_DEVICE_HANDLE) { 185 ParseAcpi ( 186 TRUE, 187 2, 188 NULL, 189 Ptr, 190 sizeof (EFI_ACPI_6_3_DEVICE_HANDLE_ACPI), 191 PARSER_PARAMS (SratDeviceHandleAcpiParser) 192 ); 193 } else if (*SratDeviceHandleType == EFI_ACPI_6_3_PCI_DEVICE_HANDLE) { 194 ParseAcpi ( 195 TRUE, 196 2, 197 NULL, 198 Ptr, 199 sizeof (EFI_ACPI_6_3_DEVICE_HANDLE_PCI), 200 PARSER_PARAMS (SratDeviceHandlePciParser) 201 ); 202 } 203 } 204 205 /** 44 206 This function traces the APIC Proximity Domain field. 45 207 … … 102 264 {L"Reserved", 2, 6, L"0x%x", NULL, NULL, NULL, NULL}, 103 265 {L"ITS Id", 4, 8, L"0x%x", NULL, NULL, NULL, NULL}, 266 }; 267 268 /** 269 An ACPI_PARSER array describing the Generic Initiator Affinity Structure 270 **/ 271 STATIC CONST ACPI_PARSER SratGenericInitiatorAffinityParser[] = { 272 {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, 273 {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, 274 275 {L"Reserved", 1, 2, L"0x%x", NULL, NULL, NULL, NULL}, 276 {L"Device Handle Type", 1, 3, L"%d", NULL, (VOID**)&SratDeviceHandleType, 277 ValidateSratDeviceHandleType, NULL}, 278 {L"Proximity Domain", 4, 4, L"0x%x", NULL, NULL, NULL, NULL}, 279 {L"Device Handle", 16, 8, L"%s", DumpSratDeviceHandle, NULL, NULL, NULL}, 280 {L"Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}, 281 {L"Reserved", 4, 28, L"0x%x", NULL, NULL, NULL, NULL} 104 282 }; 105 283 … … 184 362 UINT32 GicCAffinityIndex; 185 363 UINT32 GicITSAffinityIndex; 364 UINT32 GenericInitiatorAffinityIndex; 186 365 UINT32 MemoryAffinityIndex; 187 366 UINT32 ApicSapicAffinityIndex; … … 191 370 GicCAffinityIndex = 0; 192 371 GicITSAffinityIndex = 0; 372 GenericInitiatorAffinityIndex = 0; 193 373 MemoryAffinityIndex = 0; 194 374 ApicSapicAffinityIndex = 0; … … 220 400 ); 221 401 222 // Make sure the SRAT structure lies inside the table 223 if ((Offset + *SratRALength) > AcpiTableLength) { 402 // Check if the values used to control the parsing logic have been 403 // successfully read. 404 if ((SratRAType == NULL) || 405 (SratRALength == NULL)) { 224 406 IncrementErrorCount (); 225 407 Print ( 226 L"ERROR: Invalid SRAT structure length. SratRALength = %d. " \ 227 L"RemainingTableBufferLength = %d. SRAT parsing aborted.\n", 228 *SratRALength, 408 L"ERROR: Insufficient remaining table buffer length to read the " \ 409 L"Static Resource Allocation structure header. Length = %d.\n", 229 410 AcpiTableLength - Offset 230 411 ); … … 232 413 } 233 414 415 // Validate Static Resource Allocation Structure length 416 if ((*SratRALength == 0) || 417 ((Offset + (*SratRALength)) > AcpiTableLength)) { 418 IncrementErrorCount (); 419 Print ( 420 L"ERROR: Invalid Static Resource Allocation Structure length. " \ 421 L"Length = %d. Offset = %d. AcpiTableLength = %d.\n", 422 *SratRALength, 423 Offset, 424 AcpiTableLength 425 ); 426 return; 427 } 428 234 429 switch (*SratRAType) { 235 case EFI_ACPI_6_ 2_GICC_AFFINITY:430 case EFI_ACPI_6_3_GICC_AFFINITY: 236 431 AsciiSPrint ( 237 432 Buffer, … … 250 445 break; 251 446 252 case EFI_ACPI_6_ 2_GIC_ITS_AFFINITY:447 case EFI_ACPI_6_3_GIC_ITS_AFFINITY: 253 448 AsciiSPrint ( 254 449 Buffer, … … 267 462 break; 268 463 269 case EFI_ACPI_6_2_MEMORY_AFFINITY: 464 case EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY: 465 AsciiSPrint ( 466 Buffer, 467 sizeof (Buffer), 468 "Generic Initiator Affinity Structure [%d]", 469 GenericInitiatorAffinityIndex++ 470 ); 471 ParseAcpi ( 472 TRUE, 473 2, 474 Buffer, 475 ResourcePtr, 476 *SratRALength, 477 PARSER_PARAMS (SratGenericInitiatorAffinityParser) 478 ); 479 break; 480 481 case EFI_ACPI_6_3_MEMORY_AFFINITY: 270 482 AsciiSPrint ( 271 483 Buffer, … … 284 496 break; 285 497 286 case EFI_ACPI_6_ 2_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY:498 case EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY: 287 499 AsciiSPrint ( 288 500 Buffer, … … 301 513 break; 302 514 303 case EFI_ACPI_6_ 2_PROCESSOR_LOCAL_X2APIC_AFFINITY:515 case EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_AFFINITY: 304 516 AsciiSPrint ( 305 517 Buffer, -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c
r80721 r85718 30 30 {EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, 31 31 ParseAcpiDsdt}, 32 {EFI_ACPI_6_3_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE, ParseAcpiFacs}, 32 33 {EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, ParseAcpiFadt}, 33 34 {EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, ParseAcpiGtdt}, -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
r80721 r85718 2 2 # Provides Shell 'acpiview' command functions 3 3 # 4 # Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.<BR>4 # Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.<BR> 5 5 # 6 6 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 32 32 Parsers/Dbg2/Dbg2Parser.c 33 33 Parsers/Dsdt/DsdtParser.c 34 Parsers/Facs/FacsParser.c 34 35 Parsers/Fadt/FadtParser.c 35 36 Parsers/Gtdt/GtdtParser.c … … 46 47 Parsers/Madt/MadtParser.h 47 48 Parsers/Pptt/PpttParser.h 49 50 [Sources.ARM, Sources.AARCH64] 51 Arm/SbbrValidator.h 52 Arm/SbbrValidator.c 48 53 49 54 [Packages] -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.uni
r80721 r85718 1 1 // /** 2 2 // 3 // Copyright (c) 2016 - 20 19, ARM Limited. All rights reserved.<BR>3 // Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.<BR> 4 4 // SPDX-License-Identifier: BSD-2-Clause-Patent 5 5 // … … 31 31 ".SH SYNOPSIS\r\n" 32 32 " \r\n" 33 "ACPIVIEW [[-?] | [[ -l] | [-s AcpiTable [-d]]] [-q] [-h]]\r\n"33 "ACPIVIEW [[-?] | [[[[-l] | [-s AcpiTable [-d]]] [-q] [-h]] [-r Spec]]]\r\n" 34 34 " \r\n" 35 35 ".SH OPTIONS\r\n" … … 42 42 " -q - Quiet. Suppress errors and warnings. Disables consistency checks.\r\n" 43 43 " -h - Enable colour highlighting.\r\n" 44 " -r - Validate that all required ACPI tables are installed\r\n" 45 " Spec : Specification to validate against.\r\n" 46 " For Arm, the possible values are:\r\n" 47 " 0 - Server Base Boot Requirements v1.0\r\n" 48 " 1 - Server Base Boot Requirements v1.1\r\n" 49 " 2 - Server Base Boot Requirements v1.2\r\n" 44 50 " -? - Show help.\r\n" 45 51 " \r\n" … … 119 125 " fs0:\> acpiview\r\n" 120 126 " \r\n" 127 " * To check if all Server Base Boot Requirements (SBBR) v1.2 mandatory\r\n" 128 " ACPI tables are installed (Arm only):\r\n" 129 " fs0:\> acpiview -r 2\r\n" 130 " \r\n" 121 131 ".SH RETURNVALUES\r\n" 122 132 " \r\n" -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
r80721 r85718 39 39 40 40 STATIC CONST CHAR16 mFileName[] = L"ShellCommands"; 41 STATIC EFI_H ANDLE gShellBcfgHiiHandle = NULL;41 STATIC EFI_HII_HANDLE gShellBcfgHiiHandle = NULL; 42 42 43 43 typedef enum { -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
r80721 r85718 75 75 CHAR8 *PlatformLang; 76 76 77 GetEfiGlobalVariable2 (EFI_PLATFORM_LANG_VARIABLE_NAME, (VOID**)&PlatformLang, NULL);78 if (PlatformLang == NULL) {79 return EFI_UNSUPPORTED;80 }81 82 77 if (gUnicodeCollation == NULL) { 78 79 GetEfiGlobalVariable2 (EFI_PLATFORM_LANG_VARIABLE_NAME, (VOID**)&PlatformLang, NULL); 80 83 81 Status = gBS->LocateHandleBuffer ( 84 82 ByProtocol, … … 109 107 110 108 // 109 // Without clue provided use the first Unicode Collation2 protocol. 110 // This may happen when PlatformLang is NULL or when no installed Unicode 111 // Collation2 protocol instance supports PlatformLang. 112 // 113 if (gUnicodeCollation == NULL) { 114 gUnicodeCollation = Uc; 115 } 116 if (PlatformLang == NULL) { 117 break; 118 } 119 120 // 111 121 // Find the best matching matching language from the supported languages 112 122 // of Unicode Collation2 protocol. … … 127 137 FreePool (Handles); 128 138 } 129 FreePool (PlatformLang); 139 if (PlatformLang != NULL) { 140 FreePool (PlatformLang); 141 } 130 142 } 131 143 … … 547 559 IN CONST CHAR16 *ProfileName, 548 560 IN CONST BOOLEAN CanAffectLE, 549 IN CONST EFI_H ANDLEHiiHandle,561 IN CONST EFI_HII_HANDLE HiiHandle, 550 562 IN CONST EFI_STRING_ID ManFormatHelp 551 563 ) -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.h
r80721 r85718 47 47 SHELL_RUN_COMMAND CommandHandler; 48 48 BOOLEAN LastError; 49 EFI_H ANDLEHiiHandle;49 EFI_HII_HANDLE HiiHandle; 50 50 EFI_STRING_ID ManFormatHelp; 51 51 } SHELL_COMMAND_INTERNAL_LIST_ENTRY; -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
r80721 r85718 1463 1463 if (Info != NULL && Info->Attribute & EFI_FILE_DIRECTORY) { 1464 1464 StatusBarSetStatusString (L"Directory Can Not Be Saved"); 1465 ShellCloseFile (FileHandle);1465 ShellCloseFile (&FileHandle); 1466 1466 FreePool(Info); 1467 1467 return EFI_LOAD_ERROR; … … 1603 1603 // set status string 1604 1604 // 1605 Str = CatSPrint (NULL, L"%d Lines Wr ote", NumLines);1605 Str = CatSPrint (NULL, L"%d Lines Written", NumLines); 1606 1606 if (Str == NULL) { 1607 1607 return EFI_OUT_OF_RESOURCES; -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
r80721 r85718 369 369 // set status string 370 370 // 371 Str = CatSPrint(NULL, L"%d Lines Wr ote", NumLines);371 Str = CatSPrint(NULL, L"%d Lines Written", NumLines); 372 372 StatusBarSetStatusString (Str); 373 373 FreePool (Str); -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c
r80721 r85718 3 3 4 4 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> 5 Copyright (c) 2005 - 201 8, Intel Corporation. All rights reserved.<BR>5 Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved.<BR> 6 6 SPDX-License-Identifier: BSD-2-Clause-Patent 7 7 … … 335 335 ); 336 336 if (EFI_ERROR (Status)) { 337 // 338 // With EFI_SECURITY_VIOLATION retval, the Image was loaded and an ImageHandle was created 339 // with a valid EFI_LOADED_IMAGE_PROTOCOL, but the image can not be started right now. 340 // If the caller doesn't have the option to defer the execution of an image, we should 341 // unload image for the EFI_SECURITY_VIOLATION to avoid resource leak. 342 // 343 if (Status == EFI_SECURITY_VIOLATION) { 344 gBS->UnloadImage (ImageHandle); 345 } 337 346 ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_LOAD_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex); 338 347 // PrintToken (STRING_TOKEN (STR_LOADPCIROM_LOAD_IMAGE_ERROR), HiiHandle, ImageIndex, Status); -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
r80721 r85718 2 2 Main file for Pci shell Debug1 function. 3 3 4 Copyright (c) 2005 - 201 8, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved.<BR> 5 5 (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR> 6 6 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> … … 4516 4516 MaxLinkSpeed = L"8.0 GT/s"; 4517 4517 break; 4518 case 4: 4519 MaxLinkSpeed = L"16.0 GT/s"; 4520 break; 4521 case 5: 4522 MaxLinkSpeed = L"32.0 GT/s"; 4523 break; 4518 4524 default: 4519 MaxLinkSpeed = L" Unknown";4525 MaxLinkSpeed = L"Reserved"; 4520 4526 break; 4521 4527 } … … 4672 4678 case 3: 4673 4679 CurLinkSpeed = L"8.0 GT/s"; 4680 break; 4681 case 4: 4682 CurLinkSpeed = L"16.0 GT/s"; 4683 break; 4684 case 5: 4685 CurLinkSpeed = L"32.0 GT/s"; 4674 4686 break; 4675 4687 default: -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
r80721 r85718 4 4 Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR> 5 5 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> 6 (C) Copyright 2015-201 7Hewlett Packard Enterprise Development LP<BR>6 (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP<BR> 7 7 SPDX-License-Identifier: BSD-2-Clause-Patent 8 8 … … 1170 1170 1171 1171 // 1172 // Processor Additional Information (Type 44) 1173 // 1174 case 44: 1175 DisplayProcessorArchitectureType (Struct->Type44->ProcessorSpecificBlock.ProcessorArchType, Option); 1176 break; 1177 1178 // 1172 1179 // Inactive (Type 126) 1173 1180 // … … 2349 2356 case 0x1F4: 2350 2357 Print (L"Video Processor\n"); 2358 break; 2359 2360 case 0x200: 2361 Print (L"RISC-V RV32\n"); 2362 break; 2363 2364 case 0x201: 2365 Print (L"RISC-V RV64\n"); 2366 break; 2367 2368 case 0x202: 2369 Print (L"RISC-V RV128\n"); 2351 2370 break; 2352 2371 -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
r80721 r85718 3 3 4 4 Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR> 5 (C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>5 (C) Copyright 2017 - 2019 Hewlett Packard Enterprise Development LP<BR> 6 6 SPDX-License-Identifier: BSD-2-Clause-Patent 7 7 … … 428 428 ); 429 429 430 /** 431 Display Processor Architecture Type (Type 44). 432 433 @param[in] Key The key of the structure. 434 @param[in] Option The optional information. 435 **/ 436 VOID 437 DisplayProcessorArchitectureType ( 438 IN UINT8 Key, 439 IN UINT8 Option 440 ); 430 441 #endif -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
r80721 r85718 3 3 And give a interface of query a string out of a table. 4 4 5 Copyright (c) 2005 - 201 8, Intel Corporation. All rights reserved.<BR>6 (C) Copyright 2016-201 7Hewlett Packard Enterprise Development LP<BR>5 Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved.<BR> 6 (C) Copyright 2016-2019 Hewlett Packard Enterprise Development LP<BR> 7 7 SPDX-License-Identifier: BSD-2-Clause-Patent 8 8 … … 621 621 7, 622 622 L" Power/Performance Control" 623 }, 624 { 625 8, 626 L" 128-bit Capable" 623 627 } 624 628 }; … … 1430 1434 }, 1431 1435 { 1436 SlotTypeCXLFlexbus10, 1437 L"CXL Flexbus 1.0" 1438 }, 1439 { 1432 1440 0xA0, 1433 1441 L"PC-98/C20 " … … 1520 1528 0xB6, 1521 1529 L"PCI Express Gen 3 X16" 1530 }, 1531 { 1532 SlotTypePciExpressGen4, 1533 L"PCI Express Gen 4" 1534 }, 1535 { 1536 SlotTypePciExpressGen4X1, 1537 L"PCI Express Gen 4 X1" 1538 }, 1539 { 1540 SlotTypePciExpressGen4X2, 1541 L"PCI Express Gen 4 X2" 1542 }, 1543 { 1544 SlotTypePciExpressGen4X4, 1545 L"PCI Express Gen 4 X4" 1546 }, 1547 { 1548 SlotTypePciExpressGen4X8, 1549 L"PCI Express Gen 4 X8" 1550 }, 1551 { 1552 SlotTypePciExpressGen4X16, 1553 L"PCI Express Gen 4 X16" 1522 1554 } 1523 1555 }; … … 2263 2295 0xA3, 2264 2296 L" PC-98/Local bus add-on card" 2297 }, 2298 { 2299 MemoryArrayLocationCXLFlexbus10AddonCard, 2300 L" CXL Flexbus 1.0 add-on card" 2265 2301 } 2266 2302 }; … … 2388 2424 0x0F, 2389 2425 L" FB-DIMM" 2426 }, 2427 { 2428 MemoryFormFactorDie, 2429 L" Die" 2390 2430 } 2391 2431 }; … … 2503 2543 0x1F, 2504 2544 L" Logical non-volatile device" 2545 }, 2546 { 2547 MemoryTypeHBM, 2548 L" HBM (High Bandwidth Memory)" 2549 }, 2550 { 2551 MemoryTypeHBM2, 2552 L" HBM2 (High Bandwidth Memory Generation 2)" 2505 2553 } 2506 2554 }; … … 2591 2639 }, 2592 2640 { 2593 0x07,2594 L" Intel persistent memory"2641 MemoryTechnologyIntelPersistentMemory, 2642 L" Intel Optane DC Persistent Memory" 2595 2643 } 2596 2644 }; … … 3269 3317 }; 3270 3318 3319 TABLE_ITEM ProcessorArchitectureTypesTable[] = { 3320 { 3321 0, 3322 L" Reserved " 3323 }, 3324 { 3325 1, 3326 L" IA32 (x86) " 3327 }, 3328 { 3329 2, 3330 L" x64 (x86-64, intel64, AMD64, EM64T) " 3331 }, 3332 { 3333 3, 3334 L" Intel Itanium architecture " 3335 }, 3336 { 3337 4, 3338 L" 32-bit ARM (Aarch32) " 3339 }, 3340 { 3341 5, 3342 L" 64-bit ARM (Aarch64) " 3343 }, 3344 { 3345 6, 3346 L" 32-bit RISC-V (RV32) " 3347 }, 3348 { 3349 7, 3350 L" 64-bit RISC-V (RV64) " 3351 }, 3352 { 3353 8, 3354 L" 128-bit RISC-V (RV128) " 3355 } 3356 }; 3271 3357 3272 3358 TABLE_ITEM StructureTypeInfoTable[] = { … … 3446 3532 43, 3447 3533 L" TPM Device" 3534 }, 3535 { 3536 44, 3537 L" Processor Additional Information" 3448 3538 }, 3449 3539 { … … 4698 4788 4699 4789 /** 4790 Display Processor Architecture Type (Type 44). 4791 4792 @param[in] Key The key of the structure. 4793 @param[in] Option The optional information. 4794 **/ 4795 VOID 4796 DisplayProcessorArchitectureType ( 4797 IN UINT8 Key, 4798 IN UINT8 Option 4799 ) 4800 { 4801 ShellPrintHiiEx (-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROCESSOR_ARCH_TYPE), gShellDebug1HiiHandle); 4802 PRINT_INFO_OPTION (Key, Option); 4803 PRINT_TABLE_ITEM (ProcessorArchitectureTypesTable, Key); 4804 } 4805 4806 /** 4700 4807 Display the structure type information. 4701 4808 -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h
r80721 r85718 3 3 and give a interface of query a string out of a table. 4 4 5 Copyright (c) 2005 - 201 8, Intel Corporation. All rights reserved.<BR>5 Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved.<BR> 6 6 SPDX-License-Identifier: BSD-2-Clause-Patent 7 7 … … 10 10 #ifndef _SMBIOS_QUERY_TABLE_H_ 11 11 #define _SMBIOS_QUERY_TABLE_H_ 12 13 #include <IndustryStandard/SmBios.h> 12 14 13 15 #define QUERY_TABLE_UNFOUND 0xFF -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
r80721 r85718 3 3 // Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR> 4 4 // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR> 5 // (C) Copyright 2015-201 7Hewlett Packard Enterprise Development LP<BR>5 // (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP<BR> 6 6 // SPDX-License-Identifier: BSD-2-Clause-Patent 7 7 // … … 448 448 #string STR_SMBIOSVIEW_QUERYTABLE_MC_HOST_INTERFACE_TYPE #language en-US "MC Host Interface Type:" 449 449 #string STR_SMBIOSVIEW_QUERYTABLE_STRUCT_TYPE #language en-US "Structure Type:" 450 #string STR_SMBIOSVIEW_QUERYTABLE_PROCESSOR_ARCH_TYPE #language en-US "Processor Architecture Type:" 450 451 #string STR_SMBIOSVIEW_SMBIOSVIEW_ONE_VAR_ARGV #language en-US "%s " 451 452 #string STR_SMBIOSVIEW_SMBIOSVIEW_QUERY_STRUCT_COND #language en-US "Query Structure, conditions are:\r\n" -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c
r80721 r85718 11 11 12 12 STATIC CONST CHAR16 mFileName[] = L"Debug1Commands"; 13 EFI_H ANDLE gShellDebug1HiiHandle = NULL;13 EFI_HII_HANDLE gShellDebug1HiiHandle = NULL; 14 14 15 15 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
r80721 r85718 53 53 54 54 55 extern EFI_H ANDLEgShellDebug1HiiHandle;55 extern EFI_HII_HANDLE gShellDebug1HiiHandle; 56 56 57 57 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
r80721 r85718 3 3 // Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR> 4 4 // (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR> 5 // (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>5 // (C) Copyright 2016 - 2019 Hewlett Packard Enterprise Development LP<BR> 6 6 // SPDX-License-Identifier: BSD-2-Clause-Patent 7 7 // … … 977 977 " 42 - Management Controller Host Interface\r\n" 978 978 " 43 - TPM Device\r\n" 979 " 44 - Processor Additional Information\r\n" 979 980 " 2. Enter the SmbiosHandle parameter in hexadecimal format.\r\n" 980 981 " Do not use the '0x' prefix format for hexadecimal values.\r\n" -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
r80721 r85718 347 347 EFI_STATUS 348 348 ConvertAndConnectControllers ( 349 IN EFI_HANDLE *Handle1 OPTIONAL,350 IN EFI_HANDLE *Handle2 OPTIONAL,349 IN EFI_HANDLE Handle1 OPTIONAL, 350 IN EFI_HANDLE Handle2 OPTIONAL, 351 351 IN CONST BOOLEAN Recursive, 352 352 IN CONST BOOLEAN Output -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.c
r80721 r85718 10 10 11 11 STATIC CONST CHAR16 mFileName[] = L"Driver1Commands"; 12 EFI_H ANDLE gShellDriver1HiiHandle = NULL;12 EFI_HII_HANDLE gShellDriver1HiiHandle = NULL; 13 13 BOOLEAN gInReconnect = FALSE; 14 14 -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h
r80721 r85718 59 59 60 60 61 extern EFI_H ANDLEgShellDriver1HiiHandle;61 extern EFI_HII_HANDLE gShellDriver1HiiHandle; 62 62 extern BOOLEAN gInReconnect; 63 63 -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
r80721 r85718 11 11 12 12 STATIC CONST CHAR16 mFileName[] = L"ShellCommands"; 13 EFI_H ANDLE gShellLevel1HiiHandle = NULL;13 EFI_HII_HANDLE gShellLevel1HiiHandle = NULL; 14 14 15 15 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
r80721 r85718 34 34 #include <Library/FileHandleLib.h> 35 35 36 extern EFI_H ANDLEgShellLevel1HiiHandle;36 extern EFI_HII_HANDLE gShellLevel1HiiHandle; 37 37 38 38 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c
r80721 r85718 3 3 4 4 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> 5 Copyright (c) 2009 - 201 8, Intel Corporation. All rights reserved.<BR>5 Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR> 6 6 SPDX-License-Identifier: BSD-2-Clause-Patent 7 7 … … 113 113 114 114 if (EFI_ERROR(Status)) { 115 // 116 // With EFI_SECURITY_VIOLATION retval, the Image was loaded and an ImageHandle was created 117 // with a valid EFI_LOADED_IMAGE_PROTOCOL, but the image can not be started right now. 118 // If the caller doesn't have the option to defer the execution of an image, we should 119 // unload image for the EFI_SECURITY_VIOLATION to avoid resource leak. 120 // 121 if (Status == EFI_SECURITY_VIOLATION) { 122 gBS->UnloadImage (LoadedDriverHandle); 123 } 115 124 ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOAD_NOT_IMAGE), gShellLevel2HiiHandle, FileName, Status); 116 125 } else { -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
r80721 r85718 418 418 @param[in] Count The count of bits enabled in Attribs. 419 419 @param[in] TimeZone The current time zone offset. 420 @param[in] ListUnfiltered TRUE to request listing the directory contents 421 unfiltered. 420 422 421 423 @retval SHELL_SUCCESS the printing was sucessful. … … 430 432 IN BOOLEAN *Found, 431 433 IN CONST UINTN Count, 432 IN CONST INT16 TimeZone 434 IN CONST INT16 TimeZone, 435 IN CONST BOOLEAN ListUnfiltered 433 436 ) 434 437 { … … 501 504 // 502 505 Status = gRT->GetTime(&LocalTime, NULL); 503 if (!EFI_ERROR (Status) ) {506 if (!EFI_ERROR (Status) && (LocalTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE)) { 504 507 if ((Node->Info->CreateTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE) && 505 508 (Node->Info->CreateTime.Month >= 1 && Node->Info->CreateTime.Month <= 12)) { … … 556 559 } 557 560 558 if (!Sfo && ShellStatus != SHELL_ABORTED ) {561 if (!Sfo && ShellStatus != SHELL_ABORTED && HeaderPrinted) { 559 562 PrintNonSfoFooter(FileCount, FileSize, DirCount); 560 563 } … … 603 606 &FoundOne, 604 607 Count, 605 TimeZone); 608 TimeZone, 609 FALSE); 606 610 607 611 // … … 620 624 621 625 if (Found == NULL && !FoundOne) { 622 return (SHELL_NOT_FOUND); 626 if (ListUnfiltered) { 627 // 628 // When running "ls" without any filtering request, avoid outputing 629 // "File not found" when the directory is entirely empty, but print 630 // header and footer stating "0 File(s), 0 Dir(s)". 631 // 632 if (!Sfo) { 633 PrintNonSfoHeader (RootPath); 634 if (ShellStatus != SHELL_ABORTED) { 635 PrintNonSfoFooter (FileCount, FileSize, DirCount); 636 } 637 } 638 } else { 639 return (SHELL_NOT_FOUND); 640 } 623 641 } 624 642 … … 663 681 EFI_TIME TheTime; 664 682 CHAR16 *SearchString; 683 BOOLEAN ListUnfiltered; 665 684 666 685 Size = 0; … … 674 693 CurDir = NULL; 675 694 Count = 0; 695 ListUnfiltered = FALSE; 676 696 677 697 // … … 769 789 ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"ls"); 770 790 } 791 ListUnfiltered = TRUE; 771 792 // 772 793 // Copy to the 2 strings for starting path and file search string … … 809 830 // is listing ends with a directory, then we list all files in that directory 810 831 // 832 ListUnfiltered = TRUE; 811 833 StrnCatGrow(&SearchString, NULL, L"*", 0); 812 834 } else { … … 840 862 NULL, 841 863 Count, 842 TheTime.TimeZone 864 TheTime.TimeZone, 865 ListUnfiltered 843 866 ); 844 867 if (ShellStatus == SHELL_NOT_FOUND) { -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
r80721 r85718 25 25 BOOLEAN 26 26 IsDirectoryEmpty ( 27 IN EFI_HANDLE FileHandle27 IN SHELL_FILE_HANDLE FileHandle 28 28 ) 29 29 { -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c
r80721 r85718 30 30 31 31 CONST CHAR16 mFileName[] = L"ShellCommands"; 32 EFI_H ANDLE gShellLevel2HiiHandle = NULL;32 EFI_HII_HANDLE gShellLevel2HiiHandle = NULL; 33 33 34 34 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h
r80721 r85718 44 44 45 45 extern CONST CHAR16 mFileName[]; 46 extern EFI_H ANDLEgShellLevel2HiiHandle;46 extern EFI_HII_HANDLE gShellLevel2HiiHandle; 47 47 48 48 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c
r80721 r85718 22 22 EFI_STATUS 23 23 TouchFileByHandle ( 24 IN EFI_HANDLE Handle24 IN SHELL_FILE_HANDLE Handle 25 25 ) 26 26 { -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c
r80721 r85718 10 10 11 11 CONST CHAR16 gShellLevel3FileName[] = L"ShellCommands"; 12 EFI_H ANDLE gShellLevel3HiiHandle = NULL;12 EFI_HII_HANDLE gShellLevel3HiiHandle = NULL; 13 13 14 14 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h
r80721 r85718 33 33 #include <Library/FileHandleLib.h> 34 34 35 extern EFI_H ANDLE gShellLevel3HiiHandle;35 extern EFI_HII_HANDLE gShellLevel3HiiHandle; 36 36 37 37 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLib/UefiShellLib.c
r80721 r85718 1292 1292 // 1293 1293 // Call EFI Shell version. 1294 // Due to oddity in the EFI shell we want to dereference the ParentHandle here 1295 // 1296 CmdStatus = (mEfiShellEnvironment2->Execute(*ParentHandle, 1294 // 1295 // Due to an unfixable bug in the EdkShell implementation, we must 1296 // dereference "ParentHandle" here: 1297 // 1298 // 1. The EFI shell installs the EFI_SHELL_ENVIRONMENT2 protocol, 1299 // identified by gEfiShellEnvironment2Guid. 1300 // 2. The Execute() member function takes "ParentImageHandle" as first 1301 // parameter, with type (EFI_HANDLE*). 1302 // 3. In the EdkShell implementation, SEnvExecute() implements the 1303 // Execute() member function. It passes "ParentImageHandle" correctly to 1304 // SEnvDoExecute(). 1305 // 4. SEnvDoExecute() takes the (EFI_HANDLE*), and passes it directly -- 1306 // without de-referencing -- to the HandleProtocol() boot service. 1307 // 5. But HandleProtocol() takes an EFI_HANDLE. 1308 // 1309 // Therefore we must 1310 // - de-reference "ParentHandle" here, to mask the bug in 1311 // SEnvDoExecute(), and 1312 // - pass the resultant EFI_HANDLE as an (EFI_HANDLE*). 1313 // 1314 CmdStatus = (mEfiShellEnvironment2->Execute((EFI_HANDLE *)*ParentHandle, 1297 1315 CommandLine, 1298 1316 Output)); … … 2998 3016 IN CONST CHAR8 *Language OPTIONAL, 2999 3017 IN CONST EFI_STRING_ID HiiFormatStringId, 3000 IN CONST EFI_H ANDLEHiiFormatHandle,3018 IN CONST EFI_HII_HANDLE HiiFormatHandle, 3001 3019 ... 3002 3020 ) … … 3610 3628 IN SHELL_PROMPT_REQUEST_TYPE Type, 3611 3629 IN CONST EFI_STRING_ID HiiFormatStringId, 3612 IN CONST EFI_H ANDLEHiiFormatHandle,3630 IN CONST EFI_HII_HANDLE HiiFormatHandle, 3613 3631 IN OUT VOID **Response 3614 3632 ) -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
r80721 r85718 615 615 ON_EXIT: 616 616 617 // 618 // Recycle the packet before reusing RxToken 619 // 620 gBS->SignalEvent (Private->IpChoice == PING_IP_CHOICE_IP6?((EFI_IP6_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->RecycleSignal:((EFI_IP4_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->RecycleSignal); 621 617 622 if (Private->RxCount < Private->SendNum) { 618 623 // … … 633 638 Private->Status = EFI_SUCCESS; 634 639 } 635 //636 // Singal to recycle the each rxdata here, not at the end of process.637 //638 gBS->SignalEvent (Private->IpChoice == PING_IP_CHOICE_IP6?((EFI_IP6_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->RecycleSignal:((EFI_IP4_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->RecycleSignal);639 640 } 640 641 -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.c
r80721 r85718 9 9 10 10 CONST CHAR16 gShellNetwork1FileName[] = L"ShellCommands"; 11 EFI_H ANDLE gShellNetwork1HiiHandle = NULL;11 EFI_HII_HANDLE gShellNetwork1HiiHandle = NULL; 12 12 13 13 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h
r80721 r85718 39 39 #include <Library/PrintLib.h> 40 40 41 extern EFI_H ANDLE gShellNetwork1HiiHandle;41 extern EFI_HII_HANDLE gShellNetwork1HiiHandle; 42 42 43 43 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.c
r80721 r85718 9 9 10 10 CONST CHAR16 gShellNetwork2FileName[] = L"ShellCommands"; 11 EFI_H ANDLE gShellNetwork2HiiHandle = NULL;11 EFI_HII_HANDLE gShellNetwork2HiiHandle = NULL; 12 12 13 13 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.h
r80721 r85718 28 28 #include <Library/NetLib.h> 29 29 30 extern EFI_H ANDLE gShellNetwork2HiiHandle;30 extern EFI_HII_HANDLE gShellNetwork2HiiHandle; 31 31 32 32 /** -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/ShellPkg.dsc
r80721 r85718 4 4 # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR> 5 5 # Copyright (c) 2018, Arm Limited. All rights reserved.<BR> 6 # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> 6 7 # 7 8 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 15 16 DSC_SPECIFICATION = 0x00010006 16 17 OUTPUT_DIRECTORY = Build/Shell 17 SUPPORTED_ARCHITECTURES = IA32|X64|EBC|ARM|AARCH64 18 SUPPORTED_ARCHITECTURES = IA32|X64|EBC|ARM|AARCH64|RISCV64 18 19 BUILD_TARGETS = DEBUG|RELEASE|NOOPT 19 20 SKUID_IDENTIFIER = DEFAULT … … 59 60 ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf 60 61 61 [LibraryClasses.ARM ]62 [LibraryClasses.ARM,LibraryClasses.AARCH64] 62 63 # 63 64 # It is not possible to prevent the ARM compiler for generic intrinsic functions. … … 69 70 # Add support for GCC stack protector 70 71 NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf 71 72 [LibraryClasses.AARCH64]73 NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf74 72 75 73 [PcdsFixedAtBuild]
Note:
See TracChangeset
for help on using the changeset viewer.