X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FDebugSupportDxe%2FDebugSupport.c;h=976e0e9713f9c7954567ec3112be4c27088c6a51;hp=a0ec6c5934bb5a8b4285e6bbcb40339b55899f68;hb=7601dbe7c5ed94c859600649fc316918bb3572b3;hpb=c1f23d63363d36947e76df61320bdd2e5e233946 diff --git a/MdeModulePkg/Universal/DebugSupportDxe/DebugSupport.c b/MdeModulePkg/Universal/DebugSupportDxe/DebugSupport.c index a0ec6c5934..976e0e9713 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/DebugSupport.c +++ b/MdeModulePkg/Universal/DebugSupportDxe/DebugSupport.c @@ -1,35 +1,20 @@ -/*++ +/** @file + Top level C file for debug support driver. Contains initialization function. -Copyright (c) 2006, 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 - 2008, 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 -Module Name: +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - DebugSupport.c +**/ -Abstract: +#include "PlDebugSupport.h" - Top level C file for debug support driver. Contains initialization function. - -Revision History - ---*/ - -// -// private header files -// -#include "plDebugSupport.h" - -// -// This is a global that is the actual interface -// -EFI_DEBUG_SUPPORT_PROTOCOL gDebugSupportProtocolInterface = { +EFI_DEBUG_SUPPORT_PROTOCOL mDebugSupportProtocolInterface = { EFI_ISA, GetMaximumProcessorIndex, RegisterPeriodicCallback, @@ -37,31 +22,26 @@ EFI_DEBUG_SUPPORT_PROTOCOL gDebugSupportProtocolInterface = { InvalidateInstructionCache }; -// -// Driver Entry Point -// + +/** + Debug Support Driver entry point. + + Checks to see if there's not already a Debug Support protocol installed for + the selected processor before installing it. + + @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval EFI_ALREADY_STARTED Debug Support protocol is installed already. + @retval other Some error occurs when executing this entry point. + +**/ EFI_STATUS InitializeDebugSupportDriver ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) -/*++ - -Routine Description: - Driver entry point. Checks to see there's not already a DebugSupport protocol - installed for the selected processor before installing protocol. - -Arguments: - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - -Returns: - - EFI_STATUS - ---*/ -// TODO: ImageHandle - add argument and description to function comment -// TODO: SystemTable - add argument and description to function comment { EFI_LOADED_IMAGE_PROTOCOL *LoadedImageProtocolPtr; EFI_STATUS Status; @@ -70,8 +50,6 @@ Returns: UINTN NumHandles; EFI_DEBUG_SUPPORT_PROTOCOL *DebugSupportProtocolPtr; - // - // Install Protocol Interface... // // First check to see that the debug support protocol for this processor // type is not already installed @@ -95,7 +73,10 @@ Returns: NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (Status == EFI_SUCCESS && DebugSupportProtocolPtr->Isa == EFI_ISA) { + if ((Status == EFI_SUCCESS) && (DebugSupportProtocolPtr->Isa == EFI_ISA)) { + // + // a Debug Support protocol has been installed for this processor + // FreePool (HandlePtr); Status = EFI_ALREADY_STARTED; goto ErrExit; @@ -120,26 +101,26 @@ Returns: goto ErrExit; } - LoadedImageProtocolPtr->Unload = plUnloadDebugSupportDriver; + LoadedImageProtocolPtr->Unload = PlUnloadDebugSupportDriver; // - // Call hook for platform specific initialization + // Call hook for processor specific initialization // - Status = plInitializeDebugSupportDriver (); + Status = PlInitializeDebugSupportDriver (); ASSERT (!EFI_ERROR (Status)); if (Status != EFI_SUCCESS) { goto ErrExit; } // - // Install DebugSupport protocol to new handle + // Install Debug Support protocol to new handle // Handle = NULL; Status = gBS->InstallProtocolInterface ( &Handle, &gEfiDebugSupportProtocolGuid, EFI_NATIVE_INTERFACE, - &gDebugSupportProtocolInterface + &mDebugSupportProtocolInterface ); ASSERT (!EFI_ERROR (Status)); if (Status != EFI_SUCCESS) {