gArmTokenSpaceGuid = { 0xBB11ECFE, 0x820F, 0x4968, { 0xBB, 0xA6, 0xF7, 0x6A, 0xFE, 0x30, 0x25, 0x96 } }\r
\r
[Protocols.common]\r
- gTimerDebugSupportProtocolGuid = { 0x68300561, 0x0197, 0x465d, { 0xb5, 0xa1, 0x28, 0xeb, 0xa1, 0x98, 0xdd, 0x0b } }\r
gVirtualUncachedPagesProtocolGuid = { 0xAD651C7D, 0x3C22, 0x4DBF, { 0x92, 0xe8, 0x38, 0xa7, 0xcd, 0xae, 0x87, 0xb2 } }\r
\r
[PcdsFeatureFlag.common]\r
+++ /dev/null
-/** @file\r
-\r
- Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-\r
- This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef __TIMERDEBUGSUPPORTPROTOCOL_H__\r
-#define __TIMERDEBUGSUPPORTPROTOCOL_H__\r
-\r
-//\r
-// Protocol GUID\r
-//\r
-#define TIMER_DEBUG_PROTOCOL_GUID { 0x68300561, 0x0197, 0x465d, { 0xb5, 0xa1, 0x28, 0xeb, 0xa1, 0x98, 0xdd, 0x0b } }\r
-\r
-\r
-\r
-//\r
-// Protocol interface structure\r
-//\r
-typedef struct _TIMER_DEBUG_SUPPORT_PROTOCOL TIMER_DEBUG_SUPPORT_PROTOCOL;\r
-\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *TIMER_DEBUG_SUPPORT_REGISTER_PERIODIC_CALLBACK) (\r
- IN TIMER_DEBUG_SUPPORT_PROTOCOL *This,\r
- IN EFI_PERIODIC_CALLBACK PeriodicCallback\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Register a periodic callback for debug support.\r
-\r
-Arguments:\r
- This - pointer to protocol\r
- PeriodicCallback - callback to be registered\r
- \r
-Returns:\r
- EFI_SUCCESS - callback registered\r
-\r
---*/\r
-;\r
-\r
-struct _TIMER_DEBUG_SUPPORT_PROTOCOL {\r
- TIMER_DEBUG_SUPPORT_REGISTER_PERIODIC_CALLBACK RegisterPeriodicCallback;\r
-};\r
-\r
-extern EFI_GUID gTimerDebugSupportProtocolGuid;\r
-\r
-#endif // __TIMERDEBUGSUPPORTPROTOCOL_H__\r
-\r
+++ /dev/null
-/** @file\r
-\r
- Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
- This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include <Uefi.h>\r
-\r
-#include <Library/CacheMaintenanceLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-\r
-#include <Protocol/Cpu.h>\r
-#include <Protocol/DebugSupport.h>\r
-#include <Protocol/TimerDebugSupport.h>\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DebugSupportGetMaximumProcessorIndex (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- OUT UINTN *MaxProcessorIndex\r
- )\r
-{\r
- if (MaxProcessorIndex == NULL) {\r
- return EFI_INVALID_PARAMETER;\r
- }\r
-\r
- *MaxProcessorIndex = 0;\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DebugSupportRegisterPeriodicCallback (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- IN UINTN ProcessorIndex,\r
- IN EFI_PERIODIC_CALLBACK PeriodicCallback\r
- )\r
-{\r
- TIMER_DEBUG_SUPPORT_PROTOCOL *Timer;\r
- EFI_STATUS Status;\r
-\r
- Status = gBS->LocateProtocol(&gTimerDebugSupportProtocolGuid, NULL, (VOID **)&Timer);\r
- if (EFI_ERROR(Status)) {\r
- return Status;\r
- }\r
-\r
- Status = Timer->RegisterPeriodicCallback(Timer, PeriodicCallback);\r
-\r
- return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DebugSupportRegisterExceptionCallback (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- IN UINTN ProcessorIndex,\r
- IN EFI_EXCEPTION_CALLBACK ExceptionCallback,\r
- IN EFI_EXCEPTION_TYPE ExceptionType\r
- )\r
-{\r
- EFI_CPU_ARCH_PROTOCOL *Cpu;\r
- EFI_STATUS Status;\r
-\r
- Status = gBS->LocateProtocol(&gEfiCpuArchProtocolGuid, NULL, (VOID **)&Cpu);\r
- if (EFI_ERROR(Status)) {\r
- return Status;\r
- }\r
-\r
- Status = Cpu->RegisterInterruptHandler(Cpu, ExceptionType, (EFI_CPU_INTERRUPT_HANDLER)ExceptionCallback);\r
-\r
- return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DebugSupportInvalidateInstructionCache (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- IN UINTN ProcessorIndex,\r
- IN VOID *Start,\r
- IN UINT64 Length\r
- )\r
-{\r
- InvalidateInstructionCacheRange(Start, Length);\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_DEBUG_SUPPORT_PROTOCOL mDebugSupport = {\r
- IsaArm,\r
- DebugSupportGetMaximumProcessorIndex,\r
- DebugSupportRegisterPeriodicCallback,\r
- DebugSupportRegisterExceptionCallback,\r
- DebugSupportInvalidateInstructionCache\r
-};\r
-\r
-EFI_STATUS\r
-DebugSupportDxeInitialize (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-{\r
- EFI_STATUS Status;\r
- EFI_HANDLE Handle = NULL;\r
-\r
- ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiDebugSupportProtocolGuid);\r
- Status = gBS->InstallMultipleProtocolInterfaces(&Handle, &gEfiDebugSupportProtocolGuid, &mDebugSupport, NULL);\r
-\r
- return Status;\r
-}\r
-\r
+++ /dev/null
-#/** @file\r
-# \r
-# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-# \r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
-#**/\r
-\r
-[Defines]\r
- INF_VERSION = 0x00010005\r
- BASE_NAME = ArmDebugSupportDxe\r
- FILE_GUID = 2e7c151b-cbd8-4df6-a0e3-cde660067c6a\r
- MODULE_TYPE = DXE_DRIVER\r
- VERSION_STRING = 1.0\r
-\r
- ENTRY_POINT = DebugSupportDxeInitialize\r
-\r
-[Sources.common]\r
- DebugSupport.c\r
-\r
-[Packages]\r
- MdePkg/MdePkg.dec\r
- EmbeddedePkg/EmbeddedePkg.dec\r
-\r
-[LibraryClasses]\r
- BaseMemoryLib\r
- CacheMaintenanceLib\r
- UefiDriverEntryPoint\r
- ArmLib\r
-\r
-[Protocols]\r
- gEfiCpuArchProtocolGuid\r
- gEfiDebugSupportProtocolGuid\r
- gTimerDebugSupportProtocolGuid\r
- \r
#include <Protocol/Timer.h>
#include <Protocol/HardwareInterrupt.h>
-#include <Protocol/TimerDebugSupport.h>
#include <Omap3530/Omap3530.h>
// The notification function to call on every timer interrupt.
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
//
OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
-
- if (mTimerPeriodicCallback) {
- mTimerPeriodicCallback(SystemContext);
- }
-
if (mTimerNotifyFunction) {
mTimerNotifyFunction(mTimerPeriod);
}
}
-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.
TimerDriverGenerateSoftInterrupt
};
-TIMER_DEBUG_SUPPORT_PROTOCOL gTimerDebugSupport = {
- TimerDriverRegisterPeriodicCallback
-};
-
/**
Initialize the state information for the Timer Architectural Protocol and
UINT32 TimerBaseAddress;
// 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);
// Set up the timer registers
- TimerBaseAddress = TimerBase(FixedPcdGet32(PcdOmap35xxArchTimer));
+ TimerBaseAddress = TimerBase (FixedPcdGet32(PcdOmap35xxArchTimer));
TISR = TimerBaseAddress + GPTIMER_TISR;
TCLR = TimerBaseAddress + GPTIMER_TCLR;
TLDR = TimerBaseAddress + GPTIMER_TLDR;
TIER = TimerBaseAddress + GPTIMER_TIER;
// Disable the timer
- Status = TimerDriverSetTimerPeriod(&gTimer, 0);
+ Status = TimerDriverSetTimerPeriod (&gTimer, 0);
ASSERT_EFI_ERROR (Status);
// Install interrupt handler
- gVector = InterruptVectorForTimer(FixedPcdGet32(PcdOmap35xxArchTimer));
- Status = gInterrupt->RegisterInterruptSource(gInterrupt, gVector, TimerInterruptHandler);
+ gVector = InterruptVectorForTimer (FixedPcdGet32(PcdOmap35xxArchTimer));
+ Status = gInterrupt->RegisterInterruptSource (gInterrupt, gVector, TimerInterruptHandler);
ASSERT_EFI_ERROR (Status);
// Set up default timer
- Status = TimerDriverSetTimerPeriod(&gTimer, FixedPcdGet32(PcdTimerPeriod));
+ Status = TimerDriverSetTimerPeriod (&gTimer, FixedPcdGet32(PcdTimerPeriod));
ASSERT_EFI_ERROR (Status);
// Install the Timer Architectural Protocol onto a new handle
- Status = gBS->InstallMultipleProtocolInterfaces(&Handle,
- &gEfiTimerArchProtocolGuid, &gTimer,
- &gTimerDebugSupportProtocolGuid, &gTimerDebugSupport,
- NULL);
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &Handle,
+ &gEfiTimerArchProtocolGuid, &gTimer,
+ NULL
+ );
ASSERT_EFI_ERROR(Status);
return Status;
[Protocols]
gEfiTimerArchProtocolGuid
gHardwareInterruptProtocolGuid
- gTimerDebugSupportProtocolGuid
[Pcd.common]
gEmbeddedTokenSpaceGuid.PcdTimerPeriod