Add X64 support for DebugSupport driver.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2067 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2
2006-12-07 08:31:19 +00:00
parent b2b5e78fbb
commit 5fd59c656c
10 changed files with 2051 additions and 217 deletions

View File

@@ -1,6 +1,7 @@
/*++
Copyright (c) 2006, Intel Corporation
/**@file
IA32 specific debug support functions
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
@@ -9,17 +10,7 @@ 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:
plDebugSupport.c
Abstract:
IA32 specific debug support functions
Revision History
--*/
**/
//
// private header files
@@ -117,7 +108,6 @@ Returns:
Other possibilities are passed through by CreateEntryStub
--*/
// TODO: ) - add argument and description to function comment
{
BOOLEAN OldIntFlagState;
EFI_STATUS Status;
@@ -199,7 +189,6 @@ Returns:
Other possible return values are passed through from UnHookEntry and HookEntry.
--*/
// TODO: ) - add argument and description to function comment
{
EFI_STATUS Status;
@@ -246,12 +235,13 @@ GetMaximumProcessorIndex (
Routine Description: This is a DebugSupport protocol member function.
Arguments:
This - The DebugSupport instance
MaxProcessorIndex - The maximuim supported processor index
Returns: Always returns EFI_SUCCESS with *MaxProcessorIndex set to 0
Returns:
Always returns EFI_SUCCESS with *MaxProcessorIndex set to 0
--*/
// TODO: This - add argument and description to function comment
// TODO: MaxProcessorIndex - add argument and description to function comment
{
*MaxProcessorIndex = 0;
return (EFI_SUCCESS);
@@ -269,13 +259,20 @@ RegisterPeriodicCallback (
Routine Description: This is a DebugSupport protocol member function.
Arguments:
This - The DebugSupport instance
ProcessorIndex - Which processor the callback applies to.
PeriodicCallback - Callback function
Returns:
EFI_SUCCESS
EFI_INVALID_PARAMETER - requested uninstalling a handler from a vector that has
no handler registered for it
EFI_ALREADY_STARTED - requested install to a vector that already has a handler registered.
Other possible return values are passed through from UnHookEntry and HookEntry.
--*/
// TODO: This - add argument and description to function comment
// TODO: ProcessorIndex - add argument and description to function comment
// TODO: PeriodicCallback - add argument and description to function comment
{
return ManageIdtEntryTable (PeriodicCallback, SYSTEM_TIMER_VECTOR);
}
@@ -296,16 +293,21 @@ Routine Description:
This code executes in boot services context.
Arguments:
This - The DebugSupport instance
ProcessorIndex - Which processor the callback applies to.
NewCallback - Callback function
ExceptionType - Which exception to hook
Returns:
None
EFI_SUCCESS
EFI_INVALID_PARAMETER - requested uninstalling a handler from a vector that has
no handler registered for it
EFI_ALREADY_STARTED - requested install to a vector that already has a handler registered.
Other possible return values are passed through from UnHookEntry and HookEntry.
--*/
// TODO: This - add argument and description to function comment
// TODO: ProcessorIndex - add argument and description to function comment
// TODO: NewCallback - add argument and description to function comment
// TODO: ExceptionType - add argument and description to function comment
{
return ManageIdtEntryTable (NewCallback, ExceptionType);
}
@@ -322,21 +324,21 @@ InvalidateInstructionCache (
Routine Description:
This is a DebugSupport protocol member function.
For IA32, this is a no-op since the instruction and data caches are coherent.
Calls assembly routine to flush cache.
Arguments:
This - The DebugSupport instance
ProcessorIndex - Which processor the callback applies to.
Start - Physical base of the memory range to be invalidated
Length - mininum number of bytes in instruction cache to invalidate
Returns:
None
EFI_SUCCESS - always return success
--*/
// TODO: This - add argument and description to function comment
// TODO: ProcessorIndex - add argument and description to function comment
// TODO: Start - add argument and description to function comment
// TODO: Length - add argument and description to function comment
// TODO: EFI_SUCCESS - add return value to function comment
{
AsmWbinvd ();
return EFI_SUCCESS;
}
@@ -358,9 +360,9 @@ Returns:
EFI_SUCCESS
EFI_UNSUPPORTED - if IA32 processor does not support FXSTOR/FXRSTOR instructions,
the context save will fail, so these processor's are not supported.
EFI_OUT_OF_RESOURCES - not resource to finish initialization
--*/
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
{
if (!FxStorSupport ()) {
return EFI_UNSUPPORTED;
@@ -393,10 +395,9 @@ Arguments:
Returns:
None
EFI_SUCCESS - always return success
--*/
// TODO: EFI_SUCCESS - add return value to function comment
{
EFI_EXCEPTION_TYPE ExceptionType;
@@ -420,14 +421,14 @@ Routine Description: Common piece of code that invokes the registered handlers.
This code executes in exception context so no efi calls are allowed.
Arguments:
ExceptionType - exception type
ContextRecord - system context
Returns:
None
--*/
// TODO: ExceptionType - add argument and description to function comment
// TODO: ContextRecord - add argument and description to function comment
{
if (IdtEntryTable[ExceptionType].RegisteredCallback != NULL) {
if (ExceptionType != SYSTEM_TIMER_VECTOR) {