From 509bc208d835762c31987b00fab708c1d2ff2c5d Mon Sep 17 00:00:00 2001 From: vanjeff Date: Tue, 16 Dec 2008 09:21:45 +0000 Subject: code scrub: 1. updated functions header. 2. sync some comments for .S files. 3. fixed some error in AsmFuncs.S git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7044 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/DebugSupportDxe/Ipf/AsmFuncs.s | 2 - .../Universal/DebugSupportDxe/Ipf/Ds64Macros.i | 2 - .../Universal/DebugSupportDxe/Ipf/PlDebugSupport.c | 118 +++++++++++---------- .../Universal/DebugSupportDxe/Ipf/PlDebugSupport.h | 118 ++++++++++++--------- 4 files changed, 130 insertions(+), 110 deletions(-) (limited to 'MdeModulePkg/Universal/DebugSupportDxe/Ipf') diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ipf/AsmFuncs.s b/MdeModulePkg/Universal/DebugSupportDxe/Ipf/AsmFuncs.s index 03603eafa1..aa497707c4 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/Ipf/AsmFuncs.s +++ b/MdeModulePkg/Universal/DebugSupportDxe/Ipf/AsmFuncs.s @@ -10,8 +10,6 @@ /// 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: AsmFuncs.s -/// /// diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ipf/Ds64Macros.i b/MdeModulePkg/Universal/DebugSupportDxe/Ipf/Ds64Macros.i index 5855545f01..eb3f63d9aa 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/Ipf/Ds64Macros.i +++ b/MdeModulePkg/Universal/DebugSupportDxe/Ipf/Ds64Macros.i @@ -10,8 +10,6 @@ /// 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: Ds64Macros.i -/// /// diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.c b/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.c index d358b425de..1e1c89d5de 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.c +++ b/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.c @@ -1,5 +1,5 @@ /** @file - IPF specific debug support functions + IPF specific functions to support Debug Support protocol. Copyright (c) 2006 - 2008, Intel Corporation All rights reserved. This program and the accompanying materials @@ -12,9 +12,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -// -// private header files -// #include "PlDebugSupport.h" BOOLEAN mInHandler = FALSE; @@ -66,7 +63,9 @@ PlInitializeDebugSupportDriver ( /** Unload handler that is called during UnloadImage() - deallocates pool memory - used by the driver. Must be public because it's referenced from DebugSuport.c + used by the driver. + + Must be public because it's referenced from DebugSuport.c @param ImageHandle The firmware allocated handle for the EFI image. @@ -90,10 +89,12 @@ PlUnloadDebugSupportDriver ( /** C routine that is called for all registered exceptions. This is the main - exception dispatcher. Must be public because it's referenced from AsmFuncs.s. + exception dispatcher. + + Must be public because it's referenced from AsmFuncs.s. - @param ExceptionType Exception Type - @param Context System Context + @param ExceptionType Specifies which processor exception. + @param Context System Context. **/ VOID CommonHandler ( @@ -170,12 +171,11 @@ GetHandlerEntryPoint ( /** This is the worker function that uninstalls and removes all handlers. - @param ExceptionType Exception Type - @param NewBundles New Boundles - @param NewCallback New Callback + @param ExceptionType Specifies which processor exception. + @param NewBundles New Boundles. + @param NewCallback A pointer to the new function to be registered. @retval EFI_ALEADY_STARTED Ivt already hooked. - @retval others Indicates the request was not satisfied. @retval EFI_SUCCESS Successfully uninstalled. **/ @@ -248,9 +248,9 @@ ManageIvtEntryTable ( Saves original IVT contents and inserts a few new bundles which are fixed up to store the ExceptionType and then call the common handler. - @param ExceptionType Exception Type - @param NewBundles New Boundles - @param NewCallback New Callback + @param ExceptionType Specifies which processor exception. + @param NewBundles New Boundles. + @param NewCallback A pointer to the new function to be hooked. **/ VOID @@ -294,7 +294,7 @@ HookEntry ( /** Restores original IVT contents when unregistering a callback function. - @param ExceptionType Exception Type + @param ExceptionType Specifies which processor exception. **/ VOID @@ -324,7 +324,7 @@ UnhookEntry ( Records new callback in IvtEntryTable. - @param NewCallback New Callback + @param NewCallback A pointer to the interrupt handle. **/ VOID @@ -358,19 +358,17 @@ UnchainExternalInterrupt ( IvtEntryTable[EXCEPT_IPF_EXTERNAL_INTERRUPT].RegisteredCallback = NULL; } -// -// The rest of the functions in this file are all member functions for the -// DebugSupport protocol -// - /** - This is a DebugSupport protocol member function, hard - coded to support only 1 processor for now. - - @param This The DebugSupport instance - @param MaxProcessorIndex The maximuim supported processor index + Returns the maximum value that may be used for the ProcessorIndex parameter in + RegisterPeriodicCallback() and RegisterExceptionCallback(). + + Hard coded to support only 1 processor for now. - @retval EFI_SUCCESS Always returned with **MaxProcessorIndex set to 0. + @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. + @param MaxProcessorIndex Pointer to a caller-allocated UINTN in which the maximum supported + processor index is returned. Always 0 returned. + + @retval EFI_SUCCESS Always returned with **MaxProcessorIndex set to 0. **/ EFI_STATUS @@ -385,15 +383,18 @@ GetMaximumProcessorIndex ( } /** - DebugSupport protocol member function. - - @param This The DebugSupport instance - @param ProcessorIndex Which processor the callback applies to. - @param PeriodicCallback Callback function - - @retval EFI_SUCCESS Indicates the callback was registered. - @retval others Callback was not registered. - + Registers a function to be called back periodically in interrupt context. + + @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. + @param ProcessorIndex Specifies which processor the callback function applies to. + @param PeriodicCallback A pointer to a function of type PERIODIC_CALLBACK that is the main + periodic entry point of the debug agent. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback + function was previously registered. + @retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback + function. **/ EFI_STATUS EFIAPI @@ -407,16 +408,21 @@ RegisterPeriodicCallback ( } /** - DebugSupport protocol member function. - - @param This The DebugSupport instance - @param ProcessorIndex Which processor the callback applies to. - @param NewCallback Callback function - @param ExceptionType Which exception to hook - - @retval EFI_SUCCESS Indicates the callback was registered. - @retval others Callback was not registered. - + Registers a function to be called when a given processor exception occurs. + + This code executes in boot services context. + + @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. + @param ProcessorIndex Specifies which processor the callback function applies to. + @param ExceptionCallback A pointer to a function of type EXCEPTION_CALLBACK that is called + when the processor exception specified by ExceptionType occurs. + @param ExceptionType Specifies which processor exception to hook. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback + function was previously registered. + @retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback + function. **/ EFI_STATUS EFIAPI @@ -435,14 +441,16 @@ RegisterExceptionCallback ( } /** - DebugSupport protocol member function. Calls assembly routine to flush cache. - - @param This The DebugSupport instance - @param ProcessorIndex Which processor the callback applies to. - @param Start Physical base of the memory range to be invalidated - @param Length mininum number of bytes in instruction cache to invalidate - - @retval EFI_SUCCESS Always returned. + Invalidates processor instruction cache for a memory range. Subsequent execution in this range + causes a fresh memory fetch to retrieve code to be executed. + + @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. + @param ProcessorIndex Specifies which processor's instruction cache is to be invalidated. + @param Start Specifies the physical base of the memory range to be invalidated. + @param Length Specifies the minimum number of bytes in the processor's instruction + cache to invalidate. + + @retval EFI_SUCCESS Always returned. **/ EFI_STATUS diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.h b/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.h index e1e34a449c..9d556a17fe 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.h +++ b/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.h @@ -1,7 +1,7 @@ /** @file - IPF specific debugsupport types, macros, and definitions. + IPF specific types, macros, and definitions for Debug Support Driver. -Copyright (c) 2004 - 2006 Intel Corporation +Copyright (c) 2004 - 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 @@ -50,7 +50,9 @@ PlInitializeDebugSupportDriver ( /** Unload handler that is called during UnloadImage() - deallocates pool memory - used by the driver. Must be public because it's referenced from DebugSuport.c + used by the driver. + + Must be public because it's referenced from DebugSuport.c @param ImageHandle The firmware allocated handle for the EFI image. @@ -75,7 +77,7 @@ GetIva ( ); /** - HookStub will be copied from it's loaded location into the IVT when + C callable function that HookStub will be copied from it's loaded location into the IVT when an IVT entry is hooked. **/ @@ -85,7 +87,7 @@ HookStub ( ); /** - Chains an interrupt handler. + C callable function to chain an interrupt handler. **/ VOID @@ -94,7 +96,7 @@ ChainHandler ( ); /** - Unchains an interrupt handler. + C callable function to unchain an interrupt handler. **/ VOID @@ -129,13 +131,16 @@ InstructionCacheFlush ( ); /** - This is a DebugSupport protocol member function, hard - coded to support only 1 processor for now. - - @param This The DebugSupport instance - @param MaxProcessorIndex The maximuim supported processor index + Returns the maximum value that may be used for the ProcessorIndex parameter in + RegisterPeriodicCallback() and RegisterExceptionCallback(). + + Hard coded to support only 1 processor for now. - @retval EFI_SUCCESS Always returned with **MaxProcessorIndex set to 0. + @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. + @param MaxProcessorIndex Pointer to a caller-allocated UINTN in which the maximum supported + processor index is returned. Always 0 returned. + + @retval EFI_SUCCESS Always returned with **MaxProcessorIndex set to 0. **/ EFI_STATUS @@ -146,15 +151,18 @@ GetMaximumProcessorIndex ( ); /** - DebugSupport protocol member function. - - @param This The DebugSupport instance - @param ProcessorIndex Which processor the callback applies to. - @param PeriodicCallback Callback function - - @retval EFI_SUCCESS Indicates the callback was registered. - @retval others Callback was not registered. - + Registers a function to be called back periodically in interrupt context. + + @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. + @param ProcessorIndex Specifies which processor the callback function applies to. + @param PeriodicCallback A pointer to a function of type PERIODIC_CALLBACK that is the main + periodic entry point of the debug agent. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback + function was previously registered. + @retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback + function. **/ EFI_STATUS EFIAPI @@ -165,16 +173,21 @@ RegisterPeriodicCallback ( ); /** - DebugSupport protocol member function. - - @param This The DebugSupport instance - @param ProcessorIndex Which processor the callback applies to. - @param NewCallback Callback function - @param ExceptionType Which exception to hook - - @retval EFI_SUCCESS Indicates the callback was registered. - @retval others Callback was not registered. - + Registers a function to be called when a given processor exception occurs. + + This code executes in boot services context. + + @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. + @param ProcessorIndex Specifies which processor the callback function applies to. + @param ExceptionCallback A pointer to a function of type EXCEPTION_CALLBACK that is called + when the processor exception specified by ExceptionType occurs. + @param ExceptionType Specifies which processor exception to hook. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback + function was previously registered. + @retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback + function. **/ EFI_STATUS EFIAPI @@ -186,14 +199,16 @@ RegisterExceptionCallback ( ); /** - DebugSupport protocol member function. Calls assembly routine to flush cache. - - @param This The DebugSupport instance - @param ProcessorIndex Which processor the callback applies to. - @param Start Physical base of the memory range to be invalidated - @param Length mininum number of bytes in instruction cache to invalidate - - @retval EFI_SUCCESS Always returned. + Invalidates processor instruction cache for a memory range. Subsequent execution in this range + causes a fresh memory fetch to retrieve code to be executed. + + @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. + @param ProcessorIndex Specifies which processor's instruction cache is to be invalidated. + @param Start Specifies the physical base of the memory range to be invalidated. + @param Length Specifies the minimum number of bytes in the processor's instruction + cache to invalidate. + + @retval EFI_SUCCESS Always returned. **/ EFI_STATUS @@ -207,10 +222,12 @@ InvalidateInstructionCache ( /** C routine that is called for all registered exceptions. This is the main - exception dispatcher. Must be public because it's referenced from AsmFuncs.s. + exception dispatcher. + + Must be public because it's referenced from AsmFuncs.s. - @param ExceptionType Exception Type - @param Context System Context + @param ExceptionType Specifies which processor exception. + @param Context System Context. **/ VOID CommonHandler ( @@ -221,12 +238,11 @@ CommonHandler ( /** This is the worker function that uninstalls and removes all handlers. - @param ExceptionType Exception Type - @param NewBundles New Boundles - @param NewCallback New Callback + @param ExceptionType Specifies which processor exception. + @param NewBundles New Boundles. + @param NewCallback A pointer to the new function to be registered. @retval EFI_ALEADY_STARTED Ivt already hooked. - @retval others Indicates the request was not satisfied. @retval EFI_SUCCESS Successfully uninstalled. **/ @@ -241,9 +257,9 @@ ManageIvtEntryTable ( Saves original IVT contents and inserts a few new bundles which are fixed up to store the ExceptionType and then call the common handler. - @param ExceptionType Exception Type - @param NewBundles New Boundles - @param NewCallback New Callback + @param ExceptionType Specifies which processor exception. + @param NewBundles New Boundles. + @param NewCallback A pointer to the new function to be hooked. **/ VOID @@ -256,7 +272,7 @@ HookEntry ( /** Restores original IVT contents when unregistering a callback function. - @param ExceptionType Exception Type + @param ExceptionType Specifies which processor exception. **/ VOID @@ -269,7 +285,7 @@ UnhookEntry ( Records new callback in IvtEntryTable. - @param NewCallback New Callback. + @param NewCallback A pointer to the interrupt handle. **/ VOID -- cgit v1.2.3