ArmPkg/LinuxLoader: eliminate calls to deprecated string functions
Remove calls to deprecated string functions like AsciiStrCpy() and UnicodeStrToAsciiStr() Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
This commit is contained in:
@@ -72,7 +72,7 @@ SetupCmdlineTag (
|
|||||||
mLinuxKernelCurrentAtag->header.type = ATAG_CMDLINE;
|
mLinuxKernelCurrentAtag->header.type = ATAG_CMDLINE;
|
||||||
|
|
||||||
/* place CommandLine into tag */
|
/* place CommandLine into tag */
|
||||||
AsciiStrCpy (mLinuxKernelCurrentAtag->body.cmdline_tag.cmdline, CmdLine);
|
AsciiStrCpyS (mLinuxKernelCurrentAtag->body.cmdline_tag.cmdline, LineLength, CmdLine);
|
||||||
|
|
||||||
// move pointer to next tag
|
// move pointer to next tag
|
||||||
mLinuxKernelCurrentAtag = next_tag_address (mLinuxKernelCurrentAtag);
|
mLinuxKernelCurrentAtag = next_tag_address (mLinuxKernelCurrentAtag);
|
||||||
|
@@ -61,6 +61,7 @@ LinuxLoaderEntryPoint (
|
|||||||
LIST_ENTRY *ResourceLink;
|
LIST_ENTRY *ResourceLink;
|
||||||
SYSTEM_MEMORY_RESOURCE *Resource;
|
SYSTEM_MEMORY_RESOURCE *Resource;
|
||||||
EFI_PHYSICAL_ADDRESS SystemMemoryBase;
|
EFI_PHYSICAL_ADDRESS SystemMemoryBase;
|
||||||
|
UINTN Length;
|
||||||
|
|
||||||
Status = gBS->LocateProtocol (
|
Status = gBS->LocateProtocol (
|
||||||
&gEfiDevicePathFromTextProtocolGuid,
|
&gEfiDevicePathFromTextProtocolGuid,
|
||||||
@@ -182,12 +183,13 @@ LinuxLoaderEntryPoint (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (LinuxCommandLine != NULL) {
|
if (LinuxCommandLine != NULL) {
|
||||||
AsciiLinuxCommandLine = AllocatePool ((StrLen (LinuxCommandLine) + 1) * sizeof (CHAR8));
|
Length = StrLen (LinuxCommandLine) + 1;
|
||||||
|
AsciiLinuxCommandLine = AllocatePool (Length);
|
||||||
if (AsciiLinuxCommandLine == NULL) {
|
if (AsciiLinuxCommandLine == NULL) {
|
||||||
Status = EFI_OUT_OF_RESOURCES;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
goto Error;
|
goto Error;
|
||||||
}
|
}
|
||||||
UnicodeStrToAsciiStr (LinuxCommandLine, AsciiLinuxCommandLine);
|
UnicodeStrToAsciiStrS (LinuxCommandLine, AsciiLinuxCommandLine, Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user