mirror of https://github.com/acidanthera/audk.git
Remove DebugSupport driver for ARM and DebugSupportProtocol. In edk2 you can link debugger into DXE core directly so you don't need a debug support. Also we are going to FIQ for debugger ctrl-c break in, so no need to hook the timer infrastructure.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10495 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
5f4dc6dd9e
commit
23d3998ad5
|
@ -42,7 +42,6 @@
|
||||||
gArmTokenSpaceGuid = { 0xBB11ECFE, 0x820F, 0x4968, { 0xBB, 0xA6, 0xF7, 0x6A, 0xFE, 0x30, 0x25, 0x96 } }
|
gArmTokenSpaceGuid = { 0xBB11ECFE, 0x820F, 0x4968, { 0xBB, 0xA6, 0xF7, 0x6A, 0xFE, 0x30, 0x25, 0x96 } }
|
||||||
|
|
||||||
[Protocols.common]
|
[Protocols.common]
|
||||||
gTimerDebugSupportProtocolGuid = { 0x68300561, 0x0197, 0x465d, { 0xb5, 0xa1, 0x28, 0xeb, 0xa1, 0x98, 0xdd, 0x0b } }
|
|
||||||
gVirtualUncachedPagesProtocolGuid = { 0xAD651C7D, 0x3C22, 0x4DBF, { 0x92, 0xe8, 0x38, 0xa7, 0xcd, 0xae, 0x87, 0xb2 } }
|
gVirtualUncachedPagesProtocolGuid = { 0xAD651C7D, 0x3C22, 0x4DBF, { 0x92, 0xe8, 0x38, 0xa7, 0xcd, 0xae, 0x87, 0xb2 } }
|
||||||
|
|
||||||
[PcdsFeatureFlag.common]
|
[PcdsFeatureFlag.common]
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
/** @file
|
|
||||||
|
|
||||||
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
#ifndef __TIMERDEBUGSUPPORTPROTOCOL_H__
|
|
||||||
#define __TIMERDEBUGSUPPORTPROTOCOL_H__
|
|
||||||
|
|
||||||
//
|
|
||||||
// Protocol GUID
|
|
||||||
//
|
|
||||||
#define TIMER_DEBUG_PROTOCOL_GUID { 0x68300561, 0x0197, 0x465d, { 0xb5, 0xa1, 0x28, 0xeb, 0xa1, 0x98, 0xdd, 0x0b } }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Protocol interface structure
|
|
||||||
//
|
|
||||||
typedef struct _TIMER_DEBUG_SUPPORT_PROTOCOL TIMER_DEBUG_SUPPORT_PROTOCOL;
|
|
||||||
|
|
||||||
|
|
||||||
typedef
|
|
||||||
EFI_STATUS
|
|
||||||
(EFIAPI *TIMER_DEBUG_SUPPORT_REGISTER_PERIODIC_CALLBACK) (
|
|
||||||
IN TIMER_DEBUG_SUPPORT_PROTOCOL *This,
|
|
||||||
IN EFI_PERIODIC_CALLBACK PeriodicCallback
|
|
||||||
)
|
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
Register a periodic callback for debug support.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
This - pointer to protocol
|
|
||||||
PeriodicCallback - callback to be registered
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
EFI_SUCCESS - callback registered
|
|
||||||
|
|
||||||
--*/
|
|
||||||
;
|
|
||||||
|
|
||||||
struct _TIMER_DEBUG_SUPPORT_PROTOCOL {
|
|
||||||
TIMER_DEBUG_SUPPORT_REGISTER_PERIODIC_CALLBACK RegisterPeriodicCallback;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern EFI_GUID gTimerDebugSupportProtocolGuid;
|
|
||||||
|
|
||||||
#endif // __TIMERDEBUGSUPPORTPROTOCOL_H__
|
|
||||||
|
|
|
@ -1,119 +0,0 @@
|
||||||
/** @file
|
|
||||||
|
|
||||||
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
#include <Uefi.h>
|
|
||||||
|
|
||||||
#include <Library/CacheMaintenanceLib.h>
|
|
||||||
#include <Library/DebugLib.h>
|
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
|
||||||
|
|
||||||
#include <Protocol/Cpu.h>
|
|
||||||
#include <Protocol/DebugSupport.h>
|
|
||||||
#include <Protocol/TimerDebugSupport.h>
|
|
||||||
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
DebugSupportGetMaximumProcessorIndex (
|
|
||||||
IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
|
|
||||||
OUT UINTN *MaxProcessorIndex
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (MaxProcessorIndex == NULL) {
|
|
||||||
return EFI_INVALID_PARAMETER;
|
|
||||||
}
|
|
||||||
|
|
||||||
*MaxProcessorIndex = 0;
|
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
DebugSupportRegisterPeriodicCallback (
|
|
||||||
IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
|
|
||||||
IN UINTN ProcessorIndex,
|
|
||||||
IN EFI_PERIODIC_CALLBACK PeriodicCallback
|
|
||||||
)
|
|
||||||
{
|
|
||||||
TIMER_DEBUG_SUPPORT_PROTOCOL *Timer;
|
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
Status = gBS->LocateProtocol(&gTimerDebugSupportProtocolGuid, NULL, (VOID **)&Timer);
|
|
||||||
if (EFI_ERROR(Status)) {
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = Timer->RegisterPeriodicCallback(Timer, PeriodicCallback);
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
DebugSupportRegisterExceptionCallback (
|
|
||||||
IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
|
|
||||||
IN UINTN ProcessorIndex,
|
|
||||||
IN EFI_EXCEPTION_CALLBACK ExceptionCallback,
|
|
||||||
IN EFI_EXCEPTION_TYPE ExceptionType
|
|
||||||
)
|
|
||||||
{
|
|
||||||
EFI_CPU_ARCH_PROTOCOL *Cpu;
|
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
Status = gBS->LocateProtocol(&gEfiCpuArchProtocolGuid, NULL, (VOID **)&Cpu);
|
|
||||||
if (EFI_ERROR(Status)) {
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = Cpu->RegisterInterruptHandler(Cpu, ExceptionType, (EFI_CPU_INTERRUPT_HANDLER)ExceptionCallback);
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
DebugSupportInvalidateInstructionCache (
|
|
||||||
IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
|
|
||||||
IN UINTN ProcessorIndex,
|
|
||||||
IN VOID *Start,
|
|
||||||
IN UINT64 Length
|
|
||||||
)
|
|
||||||
{
|
|
||||||
InvalidateInstructionCacheRange(Start, Length);
|
|
||||||
return EFI_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
EFI_DEBUG_SUPPORT_PROTOCOL mDebugSupport = {
|
|
||||||
IsaArm,
|
|
||||||
DebugSupportGetMaximumProcessorIndex,
|
|
||||||
DebugSupportRegisterPeriodicCallback,
|
|
||||||
DebugSupportRegisterExceptionCallback,
|
|
||||||
DebugSupportInvalidateInstructionCache
|
|
||||||
};
|
|
||||||
|
|
||||||
EFI_STATUS
|
|
||||||
DebugSupportDxeInitialize (
|
|
||||||
IN EFI_HANDLE ImageHandle,
|
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
|
||||||
)
|
|
||||||
{
|
|
||||||
EFI_STATUS Status;
|
|
||||||
EFI_HANDLE Handle = NULL;
|
|
||||||
|
|
||||||
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiDebugSupportProtocolGuid);
|
|
||||||
Status = gBS->InstallMultipleProtocolInterfaces(&Handle, &gEfiDebugSupportProtocolGuid, &mDebugSupport, NULL);
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
#/** @file
|
|
||||||
#
|
|
||||||
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
#**/
|
|
||||||
|
|
||||||
[Defines]
|
|
||||||
INF_VERSION = 0x00010005
|
|
||||||
BASE_NAME = ArmDebugSupportDxe
|
|
||||||
FILE_GUID = 2e7c151b-cbd8-4df6-a0e3-cde660067c6a
|
|
||||||
MODULE_TYPE = DXE_DRIVER
|
|
||||||
VERSION_STRING = 1.0
|
|
||||||
|
|
||||||
ENTRY_POINT = DebugSupportDxeInitialize
|
|
||||||
|
|
||||||
[Sources.common]
|
|
||||||
DebugSupport.c
|
|
||||||
|
|
||||||
[Packages]
|
|
||||||
MdePkg/MdePkg.dec
|
|
||||||
EmbeddedePkg/EmbeddedePkg.dec
|
|
||||||
|
|
||||||
[LibraryClasses]
|
|
||||||
BaseMemoryLib
|
|
||||||
CacheMaintenanceLib
|
|
||||||
UefiDriverEntryPoint
|
|
||||||
ArmLib
|
|
||||||
|
|
||||||
[Protocols]
|
|
||||||
gEfiCpuArchProtocolGuid
|
|
||||||
gEfiDebugSupportProtocolGuid
|
|
||||||
gTimerDebugSupportProtocolGuid
|
|
||||||
|
|
|
@ -27,14 +27,12 @@
|
||||||
|
|
||||||
#include <Protocol/Timer.h>
|
#include <Protocol/Timer.h>
|
||||||
#include <Protocol/HardwareInterrupt.h>
|
#include <Protocol/HardwareInterrupt.h>
|
||||||
#include <Protocol/TimerDebugSupport.h>
|
|
||||||
|
|
||||||
#include <Omap3530/Omap3530.h>
|
#include <Omap3530/Omap3530.h>
|
||||||
|
|
||||||
|
|
||||||
// The notification function to call on every timer interrupt.
|
// The notification function to call on every timer interrupt.
|
||||||
volatile EFI_TIMER_NOTIFY mTimerNotifyFunction = (EFI_TIMER_NOTIFY)NULL;
|
volatile EFI_TIMER_NOTIFY mTimerNotifyFunction = (EFI_TIMER_NOTIFY)NULL;
|
||||||
volatile EFI_PERIODIC_CALLBACK mTimerPeriodicCallback = (EFI_PERIODIC_CALLBACK)NULL;
|
|
||||||
|
|
||||||
|
|
||||||
// The current period of the timer interrupt
|
// The current period of the timer interrupt
|
||||||
|
@ -85,11 +83,6 @@ TimerInterruptHandler (
|
||||||
//
|
//
|
||||||
OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
|
OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
|
||||||
|
|
||||||
|
|
||||||
if (mTimerPeriodicCallback) {
|
|
||||||
mTimerPeriodicCallback(SystemContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mTimerNotifyFunction) {
|
if (mTimerNotifyFunction) {
|
||||||
mTimerNotifyFunction(mTimerPeriod);
|
mTimerNotifyFunction(mTimerPeriod);
|
||||||
}
|
}
|
||||||
|
@ -276,27 +269,6 @@ TimerDriverGenerateSoftInterrupt (
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
TimerDriverRegisterPeriodicCallback (
|
|
||||||
IN TIMER_DEBUG_SUPPORT_PROTOCOL *This,
|
|
||||||
IN EFI_PERIODIC_CALLBACK PeriodicCallback
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if ((PeriodicCallback == NULL) && (mTimerPeriodicCallback == NULL)) {
|
|
||||||
return EFI_INVALID_PARAMETER;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((PeriodicCallback != NULL) && (mTimerPeriodicCallback != NULL)) {
|
|
||||||
return EFI_ALREADY_STARTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
mTimerPeriodicCallback = PeriodicCallback;
|
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Interface stucture for the Timer Architectural Protocol.
|
Interface stucture for the Timer Architectural Protocol.
|
||||||
|
|
||||||
|
@ -338,10 +310,6 @@ EFI_TIMER_ARCH_PROTOCOL gTimer = {
|
||||||
TimerDriverGenerateSoftInterrupt
|
TimerDriverGenerateSoftInterrupt
|
||||||
};
|
};
|
||||||
|
|
||||||
TIMER_DEBUG_SUPPORT_PROTOCOL gTimerDebugSupport = {
|
|
||||||
TimerDriverRegisterPeriodicCallback
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize the state information for the Timer Architectural Protocol and
|
Initialize the state information for the Timer Architectural Protocol and
|
||||||
|
@ -368,11 +336,11 @@ TimerInitialize (
|
||||||
UINT32 TimerBaseAddress;
|
UINT32 TimerBaseAddress;
|
||||||
|
|
||||||
// Find the interrupt controller protocol. ASSERT if not found.
|
// Find the interrupt controller protocol. ASSERT if not found.
|
||||||
Status = gBS->LocateProtocol(&gHardwareInterruptProtocolGuid, NULL, (VOID **)&gInterrupt);
|
Status = gBS->LocateProtocol (&gHardwareInterruptProtocolGuid, NULL, (VOID **)&gInterrupt);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
// Set up the timer registers
|
// Set up the timer registers
|
||||||
TimerBaseAddress = TimerBase(FixedPcdGet32(PcdOmap35xxArchTimer));
|
TimerBaseAddress = TimerBase (FixedPcdGet32(PcdOmap35xxArchTimer));
|
||||||
TISR = TimerBaseAddress + GPTIMER_TISR;
|
TISR = TimerBaseAddress + GPTIMER_TISR;
|
||||||
TCLR = TimerBaseAddress + GPTIMER_TCLR;
|
TCLR = TimerBaseAddress + GPTIMER_TCLR;
|
||||||
TLDR = TimerBaseAddress + GPTIMER_TLDR;
|
TLDR = TimerBaseAddress + GPTIMER_TLDR;
|
||||||
|
@ -380,23 +348,24 @@ TimerInitialize (
|
||||||
TIER = TimerBaseAddress + GPTIMER_TIER;
|
TIER = TimerBaseAddress + GPTIMER_TIER;
|
||||||
|
|
||||||
// Disable the timer
|
// Disable the timer
|
||||||
Status = TimerDriverSetTimerPeriod(&gTimer, 0);
|
Status = TimerDriverSetTimerPeriod (&gTimer, 0);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
// Install interrupt handler
|
// Install interrupt handler
|
||||||
gVector = InterruptVectorForTimer(FixedPcdGet32(PcdOmap35xxArchTimer));
|
gVector = InterruptVectorForTimer (FixedPcdGet32(PcdOmap35xxArchTimer));
|
||||||
Status = gInterrupt->RegisterInterruptSource(gInterrupt, gVector, TimerInterruptHandler);
|
Status = gInterrupt->RegisterInterruptSource (gInterrupt, gVector, TimerInterruptHandler);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
// Set up default timer
|
// Set up default timer
|
||||||
Status = TimerDriverSetTimerPeriod(&gTimer, FixedPcdGet32(PcdTimerPeriod));
|
Status = TimerDriverSetTimerPeriod (&gTimer, FixedPcdGet32(PcdTimerPeriod));
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
// Install the Timer Architectural Protocol onto a new handle
|
// Install the Timer Architectural Protocol onto a new handle
|
||||||
Status = gBS->InstallMultipleProtocolInterfaces(&Handle,
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
|
&Handle,
|
||||||
&gEfiTimerArchProtocolGuid, &gTimer,
|
&gEfiTimerArchProtocolGuid, &gTimer,
|
||||||
&gTimerDebugSupportProtocolGuid, &gTimerDebugSupport,
|
NULL
|
||||||
NULL);
|
);
|
||||||
ASSERT_EFI_ERROR(Status);
|
ASSERT_EFI_ERROR(Status);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiTimerArchProtocolGuid
|
gEfiTimerArchProtocolGuid
|
||||||
gHardwareInterruptProtocolGuid
|
gHardwareInterruptProtocolGuid
|
||||||
gTimerDebugSupportProtocolGuid
|
|
||||||
|
|
||||||
[Pcd.common]
|
[Pcd.common]
|
||||||
gEmbeddedTokenSpaceGuid.PcdTimerPeriod
|
gEmbeddedTokenSpaceGuid.PcdTimerPeriod
|
||||||
|
|
Loading…
Reference in New Issue