X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FC%2FEfiLdrImage%2FEfiLdrImage.c;fp=BaseTools%2FSource%2FC%2FEfiLdrImage%2FEfiLdrImage.c;h=1895e6961906c0aad5a2fca952bc8016318928b3;hb=f7496d717357b9af78414d19679b073403812340;hp=5368d22360ad2f7d020fed95456301f782369c21;hpb=39456d00f36e04b7e7efb208f350f4e83b6c3531;p=mirror_edk2.git diff --git a/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c b/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c index 5368d22360..1895e69619 100644 --- a/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c +++ b/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c @@ -5,15 +5,15 @@ FILE := EFILDR_HEADER EFILDR_IMAGE + + The order of EFILDR_IMAGE is same as the order of placing PeImageFileContent. - -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ @@ -36,8 +36,8 @@ typedef struct { UINT8 FileName[52]; } EFILDR_IMAGE; -typedef struct { - UINT32 Signature; +typedef struct { + UINT32 Signature; UINT32 HeaderCheckSum; UINT32 FileLength; UINT32 NumberOfImages; @@ -102,7 +102,7 @@ CountVerboseLevel ( } ++(*ReturnValue); } - + return EFI_SUCCESS; } @@ -176,29 +176,29 @@ Returns: UINT64 DebugLevel = 0; UINT64 VerboseLevel = 0; EFI_STATUS Status = EFI_SUCCESS; - + SetUtilityName (UTILITY_NAME); if (argc == 1) { printf ("Usage: EfiLdrImage -o OutImage LoaderImage PeImage1 PeImage2 ... PeImageN\n"); return STATUS_ERROR; } - + argc --; argv ++; if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) { Usage(); - return STATUS_SUCCESS; + return STATUS_SUCCESS; } if (stricmp (argv[0], "--version") == 0) { Version(); - return STATUS_SUCCESS; + return STATUS_SUCCESS; } while (argc > 0) { - + if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--output") == 0)) { OutputFileName = argv[1]; if (OutputFileName == NULL) { @@ -207,39 +207,39 @@ Returns: } argc -= 2; argv += 2; - continue; + continue; } - + if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) { argc --; argv ++; - continue; + continue; } - + if ((strlen(argv[0]) >= 2 && argv[0][0] == '-' && (argv[0][1] == 'v' || argv[0][1] == 'V')) || (stricmp (argv[0], "--verbose") == 0)) { VerboseLevel = 1; if (strlen(argv[0]) > 2) { Status = CountVerboseLevel (&argv[0][2], strlen(argv[0]) - 2, &VerboseLevel); if (EFI_ERROR (Status)) { Error (NULL, 0, 1003, "Invalid option value", "%s", argv[0]); - return STATUS_ERROR; + return STATUS_ERROR; } } - + argc --; argv ++; - continue; + continue; } - + if ((stricmp (argv[0], "-d") == 0) || (stricmp (argv[0], "--debug") == 0)) { Status = AsciiStringToUint64 (argv[1], FALSE, &DebugLevel); if (EFI_ERROR (Status)) { Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]); - return STATUS_ERROR; + return STATUS_ERROR; } argc -= 2; argv += 2; - continue; + continue; } // // Don't recognize the parameter, should be regarded as the input file name.