From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E3B1320954B84 for ; Thu, 15 Mar 2018 11:56:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 97A9D813F699; Thu, 15 Mar 2018 19:03:17 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-233.rdu2.redhat.com [10.10.121.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 722E2BDC58; Thu, 15 Mar 2018 19:03:15 +0000 (UTC) From: Laszlo Ersek To: edk2-devel-01 Cc: Ard Biesheuvel , Jordan Justen Date: Thu, 15 Mar 2018 20:02:56 +0100 Message-Id: <20180315190258.6580-4-lersek@redhat.com> In-Reply-To: <20180315190258.6580-1-lersek@redhat.com> References: <20180315190258.6580-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 15 Mar 2018 19:03:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 15 Mar 2018 19:03:17 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [PATCH 3/5] OvmfPkg/PlatformBootManagerLib: rejuvenate old-style function comments X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 18:56:54 -0000 The old-style "Routine Description: ..." comments use the leftmost column and are placed between the parameter list and the function body. Therefore they cause git-diff to produce bogus hunk headers that fail to name the function being patched. Convert these comment blocks to the current edk2 style. While at it, clean them up too. For PlatformBootManagerBeforeConsole() and PlatformBootManagerAfterConsole(), copy the descriptions from the call sites in "MdeModulePkg/Universal/BdsDxe/BdsEntry.c". They are more detailed than the comments in the lib class header "MdeModulePkg/Include/Library/PlatformBootManagerLib.h"; ArmVirtPkg already uses these comments. No functional changes. Cc: Ard Biesheuvel Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek --- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 172 ++++++++------------ 1 file changed, 70 insertions(+), 102 deletions(-) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c index 99b7db7cc05a..b155639f3c97 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -325,31 +325,30 @@ SaveS3BootScript ( VOID ); // // BDS Platform Functions // +/** + Do the platform init, can be customized by OEM/IBV + + Possible things that can be done in PlatformBootManagerBeforeConsole: + + > Update console variable: 1. include hot-plug devices; + > 2. Clear ConIn and add SOL for AMT + > Register new Driver#### or Boot#### + > Register new Key####: e.g.: F12 + > Signal ReadyToLock event + > Authentication action: 1. connect Auth devices; + > 2. Identify auto logon user. +**/ VOID EFIAPI PlatformBootManagerBeforeConsole ( VOID ) -/*++ - -Routine Description: - - Platform Bds init. Include the platform firmware vendor, revision - and so crc check. - -Arguments: - -Returns: - - None. - ---*/ { EFI_HANDLE Handle; EFI_STATUS Status; RETURN_STATUS PcdStatus; DEBUG ((EFI_D_INFO, "PlatformBootManagerBeforeConsole\n")); @@ -426,34 +425,27 @@ ConnectRootBridge ( FALSE // Recursive ); return Status; } +/** + Add IsaKeyboard to ConIn; add IsaSerial to ConOut, ConIn, ErrOut. + + @param[in] DeviceHandle Handle of the LPC Bridge device. + + @retval EFI_SUCCESS Console devices on the LPC bridge have been added to + ConOut, ConIn, and ErrOut. + + @return Error codes, due to EFI_DEVICE_PATH_PROTOCOL missing + from DeviceHandle. +**/ EFI_STATUS PrepareLpcBridgeDevicePath ( IN EFI_HANDLE DeviceHandle ) -/*++ - -Routine Description: - - Add IsaKeyboard to ConIn, - add IsaSerial to ConOut, ConIn, ErrOut. - LPC Bridge: 06 01 00 - -Arguments: - - DeviceHandle - Handle of PCIIO protocol. - -Returns: - - EFI_SUCCESS - LPC bridge is added to ConOut, ConIn, and ErrOut. - EFI_STATUS - No LPC bridge is added. - ---*/ { EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DevicePath; EFI_DEVICE_PATH_PROTOCOL *TempDevicePath; CHAR16 *DevPathStr; @@ -626,33 +618,26 @@ GetGopDevicePath ( gBS->FreePool (GopHandleBuffer); } return EFI_SUCCESS; } +/** + Add PCI display to ConOut. + + @param[in] DeviceHandle Handle of the PCI display device. + + @retval EFI_SUCCESS The PCI display device has been added to ConOut. + + @return Error codes, due to EFI_DEVICE_PATH_PROTOCOL missing + from DeviceHandle. +**/ EFI_STATUS PreparePciDisplayDevicePath ( IN EFI_HANDLE DeviceHandle ) -/*++ - -Routine Description: - - Add PCI VGA to ConOut. - PCI VGA: 03 00 00 - -Arguments: - - DeviceHandle - Handle of PCIIO protocol. - -Returns: - - EFI_SUCCESS - PCI VGA is added to ConOut. - EFI_STATUS - No PCI VGA device is added. - ---*/ { EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DevicePath; EFI_DEVICE_PATH_PROTOCOL *GopDevicePath; DevicePath = NULL; @@ -671,33 +656,27 @@ Returns: EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL); return EFI_SUCCESS; } -EFI_STATUS -PreparePciSerialDevicePath ( - IN EFI_HANDLE DeviceHandle - ) -/*++ - -Routine Description: - +/** Add PCI Serial to ConOut, ConIn, ErrOut. - PCI Serial: 07 00 02 -Arguments: + @param[in] DeviceHandle Handle of the PCI serial device. - DeviceHandle - Handle of PCIIO protocol. + @retval EFI_SUCCESS The PCI serial device has been added to ConOut, ConIn, + ErrOut. -Returns: - - EFI_SUCCESS - PCI Serial is added to ConOut, ConIn, and ErrOut. - EFI_STATUS - No PCI Serial device is added. - ---*/ + @return Error codes, due to EFI_DEVICE_PATH_PROTOCOL missing + from DeviceHandle. +**/ +EFI_STATUS +PreparePciSerialDevicePath ( + IN EFI_HANDLE DeviceHandle + ) { EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DevicePath; DevicePath = NULL; Status = gBS->HandleProtocol ( @@ -915,27 +894,23 @@ DetectAndPreparePlatformPciDevicePaths ( { mDetectVgaOnly = DetectVgaOnly; return VisitAllPciInstances (DetectAndPreparePlatformPciDevicePath); } +/** + Connect the predefined platform default console device. + + Always try to find and enable PCI display devices. + + @param[in] PlatformConsole Predefined platform default console device array. +**/ VOID PlatformInitializeConsole ( IN PLATFORM_CONSOLE_CONNECT_ENTRY *PlatformConsole ) -/*++ - -Routine Description: - - Connect the predefined platform default console device. Always try to find - and enable the vga device if have. - -Arguments: - - PlatformConsole - Predefined platform default console device array. ---*/ { UINTN Index; EFI_DEVICE_PATH_PROTOCOL *VarConout; EFI_DEVICE_PATH_PROTOCOL *VarConin; // @@ -1343,32 +1318,21 @@ PlatformBdsRestoreNvVarsFromHardDisk ( VisitingFileSystemInstance, NULL ); } +/** + Connect with predefined platform connect sequence. + + The OEM/IBV can customize with their own connect sequence. +**/ VOID PlatformBdsConnectSequence ( VOID ) -/*++ - -Routine Description: - - Connect with predefined platform connect sequence, - the OEM/IBV can customize with their own connect sequence. - -Arguments: - - None. - -Returns: - - None. - ---*/ { UINTN Index; RETURN_STATUS Status; DEBUG ((EFI_D_INFO, "PlatformBdsConnectSequence\n")); @@ -1428,26 +1392,30 @@ SaveS3BootScript ( (UINT32) sizeof Info, (EFI_PHYSICAL_ADDRESS)(UINTN) &Info); ASSERT_EFI_ERROR (Status); } +/** + Do the platform specific action after the console is ready + + Possible things that can be done in PlatformBootManagerAfterConsole: + + > Console post action: + > Dynamically switch output mode from 100x31 to 80x25 for certain senarino + > Signal console ready platform customized event + > Run diagnostics like memory testing + > Connect certain devices + > Dispatch aditional option roms + > Special boot: e.g.: USB boot, enter UI +**/ VOID EFIAPI PlatformBootManagerAfterConsole ( VOID ) -/*++ - -Routine Description: - - The function will execute with as the platform policy, current policy - is driven by boot mode. IBV/OEM can customize this code for their specific - policy action. - ---*/ { EFI_BOOT_MODE BootMode; DEBUG ((EFI_D_INFO, "PlatformBootManagerAfterConsole\n")); if (PcdGetBool (PcdOvmfFlashVariablesEnable)) { -- 2.14.1.3.gb7cf6e02401b