X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FCore%2FDxe%2FMisc%2FDebugImageInfo.c;h=afe668fe45a0b5739bbf4dfff7cf1458c95efe16;hb=db405d1b8948cdfdd3719e5d94af5eb8a9526e62;hp=3512477c8f83eb88e53724e060d3d8bf071651b4;hpb=28a00297189c323096aae8e2975de94e8549613c;p=mirror_edk2.git diff --git a/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c b/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c index 3512477c8f..afe668fe45 100644 --- a/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c +++ b/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c @@ -1,6 +1,9 @@ -/*++ +/** @file -Copyright (c) 2006 - 2007, Intel Corporation + Support functions for managing debug image info table when loading and unloading + images. + +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 @@ -9,53 +12,36 @@ 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. -Module Name: - - DebugImageInfo.c - -Abstract: - - Support functions for managing debug image info table when loading and unloading - images. - ---*/ +**/ #include -static EFI_DEBUG_IMAGE_INFO_TABLE_HEADER mDebugInfoTableHeader = { +STATIC EFI_DEBUG_IMAGE_INFO_TABLE_HEADER mDebugInfoTableHeader = { 0, // volatile UINT32 UpdateStatus; 0, // UINT32 TableSize; NULL // EFI_DEBUG_IMAGE_INFO *EfiDebugImageInfoTable; }; -static EFI_SYSTEM_TABLE_POINTER *mDebugTable = NULL; +STATIC EFI_SYSTEM_TABLE_POINTER *mDebugTable = NULL; -VOID -CoreInitializeDebugImageInfoTable ( - VOID - ) -/*++ - -Routine Description: +/** Creates and initializes the DebugImageInfo Table. Also creates the configuration table and registers it into the system table. -Arguments: - None - -Returns: - NA + Note: + This function allocates memory, frees it, and then allocates memory at an + address within the initial allocation. Since this function is called early + in DXE core initialization (before drivers are dispatched), this should not + be a problem. -Notes: - This function allocates memory, frees it, and then allocates memory at an - address within the initial allocation. Since this function is called early - in DXE core initialization (before drivers are dispatched), this should not - be a problem. - ---*/ +**/ +VOID +CoreInitializeDebugImageInfoTable ( + VOID + ) { EFI_STATUS Status; EFI_PHYSICAL_ADDRESS Mem; @@ -103,56 +89,42 @@ Notes: ASSERT_EFI_ERROR (Status); } -VOID -CoreUpdateDebugTableCrc32 ( - VOID - ) -/*++ - -Routine Description: +/** Update the CRC32 in the Debug Table. Since the CRC32 service is made available by the Runtime driver, we have to wait for the Runtime Driver to be installed before the CRC32 can be computed. This function is called elsewhere by the core when the runtime architectural protocol is produced. -Arguments: - None - -Returns: - NA - ---*/ +**/ +VOID +CoreUpdateDebugTableCrc32 ( + VOID + ) { ASSERT(mDebugTable != NULL); mDebugTable->Crc32 = 0; gDxeCoreBS->CalculateCrc32 ((VOID *)mDebugTable, sizeof (EFI_SYSTEM_TABLE_POINTER), &mDebugTable->Crc32); } + +/** + Adds a new DebugImageInfo structure to the DebugImageInfo Table. Re-Allocates + the table if it's not large enough to accomidate another entry. + + @param ImageInfoType type of debug image information + @param LoadedImage pointer to the loaded image protocol for the image being + loaded + @param ImageHandle image handle for the image being loaded + +**/ VOID CoreNewDebugImageInfoEntry ( IN UINT32 ImageInfoType, IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage, IN EFI_HANDLE ImageHandle ) -/*++ - -Routine Description: - - Adds a new DebugImageInfo structure to the DebugImageInfo Table. Re-Allocates - the table if it's not large enough to accomidate another entry. - -Arguments: - - ImageInfoType - type of debug image information - LoadedImage - pointer to the loaded image protocol for the image being loaded - ImageHandle - image handle for the image being loaded - -Returns: - NA - ---*/ { EFI_DEBUG_IMAGE_INFO *Table; EFI_DEBUG_IMAGE_INFO *NewTable; @@ -217,25 +189,17 @@ Returns: } -VOID -CoreRemoveDebugImageInfoEntry ( - EFI_HANDLE ImageHandle - ) -/*++ - -Routine Description: +/** Removes and frees an entry from the DebugImageInfo Table. -Arguments: - - ImageHandle - image handle for the image being unloaded + @param ImageHandle image handle for the image being unloaded -Returns: - - NA - ---*/ +**/ +VOID +CoreRemoveDebugImageInfoEntry ( + EFI_HANDLE ImageHandle + ) { EFI_DEBUG_IMAGE_INFO *Table; UINTN Index; @@ -258,3 +222,4 @@ Returns: mDebugInfoTableHeader.UpdateStatus &= ~EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS; } +