]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove Template stuff and teach people with BeagleBoard
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 30 Jan 2010 20:36:25 +0000 (20:36 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 30 Jan 2010 20:36:25 +0000 (20:36 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9876 6f19259b-4bc3-4df7-8a09-765794883524

14 files changed:
EmbeddedPkg/TemplateBds/BdsEntry.c [deleted file]
EmbeddedPkg/TemplateBds/BdsEntry.h [deleted file]
EmbeddedPkg/TemplateBds/FirmwareVolume.c [deleted file]
EmbeddedPkg/TemplateBds/TemplateBds.inf [deleted file]
EmbeddedPkg/TemplateCpuDxe/Arm/Exception.c [deleted file]
EmbeddedPkg/TemplateCpuDxe/Arm/Exceptions.S [deleted file]
EmbeddedPkg/TemplateCpuDxe/Arm/Exceptions.asm [deleted file]
EmbeddedPkg/TemplateCpuDxe/CpuDxe.c [deleted file]
EmbeddedPkg/TemplateCpuDxe/CpuDxe.h [deleted file]
EmbeddedPkg/TemplateCpuDxe/IA32/Exception.c [deleted file]
EmbeddedPkg/TemplateCpuDxe/TemplateCpuDxe.inf [deleted file]
EmbeddedPkg/TemplateCpuDxe/X64/Exception.c [deleted file]
EmbeddedPkg/TemplateTimerDxe/TemplateTimerDxe.inf [deleted file]
EmbeddedPkg/TemplateTimerDxe/Timer.c [deleted file]

diff --git a/EmbeddedPkg/TemplateBds/BdsEntry.c b/EmbeddedPkg/TemplateBds/BdsEntry.c
deleted file mode 100644 (file)
index dcdf499..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/** @file\r
-  The entry of the embedded BDS. This BDS does not follow the Boot Manager requirements \r
-  of the UEFI specification as it is designed to implement an embedded systmes \r
-  propriatary boot scheme.\r
-\r
-  This template assume a DXE driver produces a SerialIo protocol not using the EFI \r
-  driver module and it will attempt to connect a console on top of this.\r
-\r
-  Copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
-  \r
-  All rights reserved. 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 "BdsEntry.h"\r
-\r
-\r
-BOOLEAN     gConsolePresent = FALSE;\r
-\r
-\r
-EFI_HANDLE  mBdsImageHandle = NULL;\r
-EFI_BDS_ARCH_PROTOCOL  gBdsProtocol = {\r
-  BdsEntry,\r
-};\r
-\r
-\r
\r
\r
-/**\r
-  This function uses policy data from the platform to determine what operating \r
-  system or system utility should be loaded and invoked.  This function call \r
-  also optionally make the use of user input to determine the operating system \r
-  or system utility to be loaded and invoked.  When the DXE Core has dispatched \r
-  all the drivers on the dispatch queue, this function is called.  This \r
-  function will attempt to connect the boot devices required to load and invoke \r
-  the selected operating system or system utility.  During this process, \r
-  additional firmware volumes may be discovered that may contain addition DXE \r
-  drivers that can be dispatched by the DXE Core.   If a boot device cannot be \r
-  fully connected, this function calls the DXE Service Dispatch() to allow the \r
-  DXE drivers from any newly discovered firmware volumes to be dispatched.  \r
-  Then the boot device connection can be attempted again.  If the same boot \r
-  device connection operation fails twice in a row, then that boot device has \r
-  failed, and should be skipped.  This function should never return.\r
-\r
-  @param  This             The EFI_BDS_ARCH_PROTOCOL instance.\r
-\r
-  @return None.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-BdsEntry (\r
-  IN EFI_BDS_ARCH_PROTOCOL  *This\r
-  )\r
-{\r
-  EFI_STATUS    Status;\r
-  UINTN         NoHandles;\r
-  EFI_HANDLE    *Buffer;\r
-  UINTN         Index;\r
-  EFI_HANDLE    FvHandle;\r
-  EFI_GUID      *NameGuid;\r
-  \r
-  //\r
-  // This code assumes that a DXE driver produces a SerialIo protocol not following the EFI\r
-  // driver model. At a minimum we need to connect an EFI driver model terminal driver on top \r
-  // of the serial driver. \r
-  //\r
-  Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Buffer);\r
-  if (!EFI_ERROR (Status)) {\r
-    for (Index = 0; Index < NoHandles; Index++) {\r
-      // For every Serial IO protocol in the system connect EFI drivers to it.\r
-      // This should cause the terminal driver to bind to the Serial IO protocol and produce a \r
-      // child handle that produces SimpleTextOut & SImpleTextIn protocols\r
-      gBS->ConnectController (Buffer[Index], NULL, NULL, TRUE);\r
-    }\r
-    \r
-    FreePool (Buffer);\r
-  }\r
-\r
-  //\r
-  // Now we need to setup the EFI System Table with information about the console devices.\r
-  // This code is normally in the console spliter driver on platforms that support multiple \r
-  // consoles at the same time\r
-  //\r
-  Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSimpleTextOutProtocolGuid, NULL, &NoHandles, &Buffer);\r
-  if (!EFI_ERROR (Status)) {\r
-    // Use the first SimpleTextOut we find and update the EFI System Table\r
-    gST->ConsoleOutHandle = Buffer[0];\r
-    gST->StandardErrorHandle = Buffer[0];\r
-    Status = gBS->HandleProtocol (Buffer[0], &gEfiSimpleTextOutProtocolGuid, (VOID **)&gST->ConOut);\r
-    ASSERT_EFI_ERROR (Status);\r
-    \r
-    gST->StdErr = gST->ConOut;\r
-          \r
-    FreePool (Buffer);\r
-    \r
-    gConsolePresent = TRUE;\r
-  }\r
-\r
-  Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSimpleTextInProtocolGuid, NULL, &NoHandles, &Buffer);\r
-  if (!EFI_ERROR (Status)) {\r
-    // Use the first SimpleTextIn we find and update the EFI System Table\r
-    gST->ConsoleInHandle = Buffer[0];\r
-    Status = gBS->HandleProtocol (Buffer[0], &gEfiSimpleTextInProtocolGuid, (VOID **)&gST->ConIn);\r
-    ASSERT_EFI_ERROR (Status);\r
-    \r
-    FreePool (Buffer);\r
-  }\r
-\r
-  //\r
-  // We now have EFI Consoles up and running. Print () will work now. DEBUG () and ASSERT () worked \r
-  // prior to this point as they were configured to use a more primative output scheme.\r
-  //\r
-\r
-  \r
-  //\r
-  // Platform specific stuff goes here\r
-  //\r
-\r
-\r
-  //\r
-  // Normal UEFI behavior is to process Globally Defined Variables as defined in Chapter 3 \r
-  // (Boot Manager) of the UEFI specification. For this embedded system we don't do this.\r
-  //\r
-\r
-  //\r
-  // Search all the FVs for an application with a UI Section of Ebl. A .FDF file can be used\r
-  // to control the names of UI sections in an FV.\r
-  //\r
-  Status = FindApplicationMatchingUiSection (L"Ebl", &FvHandle, &NameGuid);\r
-  if (EFI_ERROR (Status)) {\r
-    //\r
-    // Just load the first application we find reguardless of name.\r
-    // This is the fallback path.\r
-    //\r
-    Status = FindApplicationMatchingUiSection (NULL, &FvHandle, &NameGuid);\r
-    // Nothing to boot\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-\r
-  Status = LoadPeCoffSectionFromFv (FvHandle, NameGuid);\r
-\r
-  //\r
-  // EFI does not define the bavior if all boot attemps fail and the last one returns. \r
-  // So we make a policy choice to reset the system since this BDS does not have a UI.\r
-  //\r
-  gRT->ResetSystem (EfiResetCold, Status, 0, NULL);\r
-\r
-  return ;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-BdsInitialize (\r
-  IN EFI_HANDLE                            ImageHandle,\r
-  IN EFI_SYSTEM_TABLE                      *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  mBdsImageHandle = ImageHandle;\r
-\r
-  //\r
-  // Install protocol interface\r
-  //\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &mBdsImageHandle,\r
-                  &gEfiBdsArchProtocolGuid, &gBdsProtocol,\r
-                  NULL\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
-\r
-\r
diff --git a/EmbeddedPkg/TemplateBds/BdsEntry.h b/EmbeddedPkg/TemplateBds/BdsEntry.h
deleted file mode 100644 (file)
index 31eb6d7..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>\r
-\r
-  All rights reserved. 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
-\r
-#ifndef __BDS_ENTRY_H__\r
-#define __BDS_ENTRY_H__\r
-\r
-#include <PiDxe.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/DxeServicesTableLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-#include <Protocol/Bds.h>\r
-#include <Protocol/SerialIo.h>\r
-#include <Protocol/FirmwareVolume2.h>\r
-#include <Protocol/SimpleTextIn.h>\r
-#include <Protocol/SimpleTextOut.h>\r
-\r
-\r
-\r
-\r
-EFI_STATUS\r
-LoadPeCoffSectionFromFv (\r
- IN  EFI_HANDLE   FvHandle,  \r
- IN  EFI_GUID     *NameGuid\r
- );\r
-\r
-EFI_STATUS\r
-FindApplicationMatchingUiSection (\r
-  IN  CHAR16      *UiString,\r
-  OUT EFI_HANDLE  *FvHandle,\r
-  OUT EFI_GUID    **NameGuid\r
-  );\r
-\r
-VOID\r
-EFIAPI\r
-BdsEntry (\r
-  IN EFI_BDS_ARCH_PROTOCOL  *This\r
-  );\r
-\r
-#endif\r
-\r
diff --git a/EmbeddedPkg/TemplateBds/FirmwareVolume.c b/EmbeddedPkg/TemplateBds/FirmwareVolume.c
deleted file mode 100644 (file)
index b6a2206..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/** @file\r
-  The entry of the embedded BDS. This BDS does not follow the Boot Manager requirements \r
-  of the UEFI specification as it is designed to implement an embedded systmes \r
-  propriatary boot scheme.\r
-\r
-  This template assume a DXE driver produces a SerialIo protocol not using the EFI \r
-  driver module and it will attempt to connect a console on top of this.\r
-\r
-  Copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
-  \r
-  All rights reserved. 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 "BdsEntry.h"\r
-\r
-\r
-EFI_STATUS\r
-FindApplicationMatchingUiSection (\r
-  IN  CHAR16      *UiString,\r
-  OUT EFI_HANDLE  *FvHandle,\r
-  OUT EFI_GUID    **NameGuid\r
-  )\r
-{\r
-  EFI_STATUS                    Status;\r
-  EFI_STATUS                    NextStatus;\r
-  UINTN                         NoHandles;\r
-  EFI_HANDLE                    *Buffer;\r
-  UINTN                         Index;\r
-  EFI_FV_FILETYPE               FileType;\r
-  EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;\r
-  VOID                          *Key;\r
-  EFI_FV_FILE_ATTRIBUTES        Attributes;\r
-  UINTN                         Size;\r
-  UINTN                         UiStringLen;\r
-  CHAR16                        *UiSection;\r
-  UINT32                        Authentication;\r
-  \r
-  \r
-  UiStringLen = 0;\r
-  if (UiString != NULL) {\r
-    UiStringLen = StrLen (UiString);\r
-  }\r
-  \r
-  Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiFirmwareVolume2ProtocolGuid, NULL, &NoHandles, &Buffer);\r
-  if (!EFI_ERROR (Status)) {\r
-    for (Index = 0; Index < NoHandles; Index++) {\r
-      Status = gBS->HandleProtocol (Buffer[Index], &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv);\r
-      if (!EFI_ERROR (Status)) {\r
-        Key = AllocatePool (Fv->KeySize);\r
-        FileType = EFI_FV_FILETYPE_APPLICATION;\r
-        \r
-        do {\r
-          NextStatus = Fv->GetNextFile (Fv, Key, &FileType, *NameGuid, &Attributes, &Size);\r
-          if (!EFI_ERROR (NextStatus)) {\r
-            if (UiString == NULL) {\r
-              //\r
-              // If UiString is NULL match first application we find.\r
-              //\r
-              *FvHandle = Buffer[Index];\r
-              FreePool (Key);\r
-              return Status;\r
-            }\r
-            \r
-            UiSection = NULL;\r
-            Status = Fv->ReadSection (\r
-                          Fv, \r
-                          *NameGuid, \r
-                          EFI_SECTION_USER_INTERFACE, \r
-                          0,\r
-                          (VOID **)&UiSection,\r
-                          &Size,\r
-                          &Authentication\r
-                          );\r
-            if (!EFI_ERROR (Status)) {\r
-              if (StrnCmp (UiString, UiSection, UiStringLen)) {\r
-                //\r
-                // We found a UiString match. \r
-                //\r
-                *FvHandle = Buffer[Index];\r
-                FreePool (Key);\r
-                FreePool (UiSection);\r
-                return Status;\r
-              }\r
-              FreePool (UiSection);\r
-            }\r
-          }\r
-        } while (!EFI_ERROR (NextStatus));\r
-        \r
-        FreePool (Key);\r
-      }\r
-    }\r
-    \r
-    FreePool (Buffer);\r
-   }\r
-\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
-\r
-EFI_DEVICE_PATH *\r
-FvFileDevicePath (\r
-  IN  EFI_HANDLE   FvHandle,\r
-  IN  EFI_GUID     *NameGuid\r
-  )\r
-{ \r
-  EFI_DEVICE_PATH_PROTOCOL          *DevicePath;\r
-  MEDIA_FW_VOL_FILEPATH_DEVICE_PATH NewNode;\r
-\r
-  DevicePath = DevicePathFromHandle (FvHandle);\r
-\r
-  EfiInitializeFwVolDevicepathNode (&NewNode, NameGuid);\r
-  \r
-  return AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&NewNode);\r
-}\r
-\r
-\r
-\r
-EFI_STATUS\r
-LoadPeCoffSectionFromFv (\r
- IN  EFI_HANDLE   FvHandle,  \r
- IN  EFI_GUID     *NameGuid\r
- )\r
-{\r
-  EFI_STATUS                    Status;\r
-  EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;\r
-  VOID                          *Buffer;\r
-  UINTN                         BufferSize;\r
-  UINT32                        Authentication;\r
-  EFI_DEVICE_PATH_PROTOCOL      *DevicePath;\r
-  EFI_HANDLE                    ImageHandle;\r
-\r
-  Status = gBS->HandleProtocol (FvHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = Fv->ReadSection (Fv, NameGuid, EFI_SECTION_PE32, 0, &Buffer, &BufferSize, &Authentication);\r
-  if (!EFI_ERROR (Status)) {\r
-    DevicePath = FvFileDevicePath (FvHandle, NameGuid);\r
-    Status = gBS->LoadImage (TRUE, gImageHandle, DevicePath, Buffer, BufferSize, &ImageHandle);\r
-    if (!EFI_ERROR (Status)) {\r
-      // ExitData is NULL so we need to pass in a size of zero\r
-      BufferSize = 0;\r
-      Status = gBS->StartImage (ImageHandle, &BufferSize, NULL);\r
-    }\r
-    \r
-    FreePool (Buffer);\r
-  }\r
-\r
-  \r
-  return Status;\r
-}\r
\r
diff --git a/EmbeddedPkg/TemplateBds/TemplateBds.inf b/EmbeddedPkg/TemplateBds/TemplateBds.inf
deleted file mode 100644 (file)
index 0b7e7a7..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#/** @file\r
-#  \r
-#    Component discription file for Bds module\r
-#  \r
-#  Copyright (c) 2008, Intel Corporation. <BR>\r
-#  All rights reserved. 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                      = TemplateBds\r
-  FILE_GUID                      = 3C85595C-70FD-447D-B0CB-7F6BBA9C9BEB\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = BdsInitialize\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources.common]\r
-  BdsEntry.c\r
-  FirmwareVolume.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-\r
-[LibraryClasses]\r
-  DevicePathLib\r
-  BaseLib\r
-  HobLib\r
-  UefiRuntimeServicesTableLib\r
-  ReportStatusCodeLib\r
-  PerformanceLib\r
-  DxeServicesTableLib\r
-  MemoryAllocationLib\r
-  UefiLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  DebugLib\r
-  PrintLib\r
-  UefiDriverEntryPoint\r
-\r
-[Guids]\r
-  \r
-\r
-[Protocols]\r
-  gEfiBdsArchProtocolGuid                       \r
-  gEfiSimpleTextInProtocolGuid             \r
-  gEfiSimpleTextOutProtocolGuid             \r
-  gEfiSerialIoProtocolGuid                      \r
-  gEfiDevicePathProtocolGuid   \r
-  gEfiFirmwareVolume2ProtocolGuid\r
-\r
-[depex]\r
-  TRUE\r
diff --git a/EmbeddedPkg/TemplateCpuDxe/Arm/Exception.c b/EmbeddedPkg/TemplateCpuDxe/Arm/Exception.c
deleted file mode 100644 (file)
index e32d47e..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
-  \r
-  All rights reserved. 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 <CpuDxe.h>\r
-#include <Library/CacheMaintenanceLib.h>\r
-\r
-VOID\r
-ExceptionHandlersStart (\r
-       VOID\r
-       );\r
-\r
-VOID\r
-ExceptionHandlersEnd (\r
-       VOID\r
-       );\r
-\r
-VOID\r
-CommonExceptionEntry (\r
-       VOID\r
-       );\r
-\r
-VOID\r
-AsmCommonExceptionEntry (\r
-       VOID\r
-       );\r
-\r
-\r
-EFI_EXCEPTION_CALLBACK  gExceptionHandlers[MAX_ARM_EXCEPTION + 1];\r
-\r
-\r
-/**\r
-  This function registers and enables the handler specified by InterruptHandler for a processor \r
-  interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
-  handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
-  The installed handler is called once for each processor interrupt or exception.\r
-\r
-  @param  InterruptType    A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
-                           are enabled and FALSE if interrupts are disabled.\r
-  @param  InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
-                           when a processor interrupt occurs. If this parameter is NULL, then the handler\r
-                           will be uninstalled.\r
-\r
-  @retval EFI_SUCCESS           The handler for the processor interrupt was successfully installed or uninstalled.\r
-  @retval EFI_ALREADY_STARTED   InterruptHandler is not NULL, and a handler for InterruptType was\r
-                                previously installed.\r
-  @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
-                                previously installed.\r
-  @retval EFI_UNSUPPORTED       The interrupt specified by InterruptType is not supported.\r
-\r
-**/\r
-EFI_STATUS\r
-RegisterInterruptHandler (\r
-  IN EFI_EXCEPTION_TYPE             InterruptType,\r
-  IN EFI_CPU_INTERRUPT_HANDLER      InterruptHandler\r
-  )\r
-{\r
-       if (InterruptType > MAX_ARM_EXCEPTION) {\r
-               return EFI_UNSUPPORTED;\r
-       }\r
-\r
-       if ((InterruptHandler == NULL) && (gExceptionHandlers[InterruptType] == NULL)) {\r
-               return EFI_INVALID_PARAMETER;\r
-       }\r
-\r
-       if ((InterruptHandler != NULL) && (gExceptionHandlers[InterruptType] != NULL)) {\r
-               return EFI_ALREADY_STARTED;\r
-       }\r
-\r
-       gExceptionHandlers[InterruptType] = InterruptHandler;\r
-\r
-       return EFI_SUCCESS;\r
-}\r
-\r
-\r
-\r
-\r
-VOID\r
-EFIAPI\r
-DefaultSWIExceptionHandler(\r
-       IN     EFI_EXCEPTION_TYPE                                               ExceptionType,\r
-       IN OUT EFI_SYSTEM_CONTEXT                                               SystemContext\r
-       )\r
-{\r
-       return;\r
-}\r
-\r
-\r
-VOID\r
-EFIAPI\r
-DefaultExceptionHandler(\r
-       IN     EFI_EXCEPTION_TYPE                                               ExceptionType,\r
-       IN OUT EFI_SYSTEM_CONTEXT                                               SystemContext\r
-       )\r
-{\r
-       DEBUG ((EFI_D_ERROR, "Exception %d from %x\n", ExceptionType, SystemContext.SystemContextArm->PC));\r
-  ASSERT (FALSE);\r
-\r
-       return;\r
-}\r
-\r
-\r
-\r
-EFI_STATUS\r
-InitializeExceptions (\r
-       IN EFI_CPU_ARCH_PROTOCOL    *Cpu\r
-       )\r
-{\r
-       EFI_STATUS    Status = EFI_SUCCESS;\r
-       UINTN                                   Offset;\r
-       UINTN                                   Length;\r
-       UINTN                                   Index;\r
-       BOOLEAN                         Enabled;\r
-\r
-  //\r
-  // Disable interrupts\r
-  //\r
-       Cpu->GetInterruptState (Cpu, &Enabled);\r
-  Cpu->DisableInterrupt (Cpu);\r
-\r
-  //\r
-  // Initialize the C entry points for interrupts\r
-  //\r
-       for (Index = 0; Index <= MAX_ARM_EXCEPTION; Index++) {\r
-    if (Index == EXCEPT_ARM_SOFTWARE_INTERRUPT) {\r
-      Status = Cpu->RegisterInterruptHandler (Cpu, Index, DefaultSWIExceptionHandler);\r
-    } else {\r
-      Status = Cpu->RegisterInterruptHandler (Cpu, Index, DefaultExceptionHandler);\r
-               }\r
-               ASSERT_EFI_ERROR (Status);\r
-       }\r
-\r
-       //\r
-       // Copy an implementation of the ARM exception vectors to 0x0.\r
-       //\r
-       Length = (UINTN)ExceptionHandlersEnd - (UINTN)ExceptionHandlersStart;\r
-\r
-       CopyMem ((VOID *)(UINTN)PcdGet32 (PcdCpuVectorBaseAddress), (VOID *)ExceptionHandlersStart, Length);\r
-\r
-  //\r
-  // Patch in the common Assembly exception handler\r
-  //\r
-       Offset = (UINTN)CommonExceptionEntry - (UINTN)ExceptionHandlersStart;\r
-       *(UINTN *) ((UINT8 *)(UINTN)PcdGet32 (PcdCpuVectorBaseAddress)  + Offset) = (UINTN)AsmCommonExceptionEntry;\r
-\r
-  //\r
-  // Flush Caches since we updated executable stuff\r
-  //\r
-       InvalidateInstructionCache ();\r
-\r
-       if (Enabled) {\r
-         // \r
-         // Restore interrupt state\r
-         //\r
-               Status = Cpu->EnableInterrupt (Cpu);\r
-       }\r
-\r
-       return Status;\r
-}\r
-\r
-\r
-\r
-/**\r
-  This function reads the processor timer specified by TimerIndex and returns it in TimerValue.\r
-\r
-  @param  TimerIndex       Specifies which processor timer is to be returned in TimerValue. This parameter\r
-                           must be between 0 and NumberOfTimers-1.\r
-  @param  TimerValue       Pointer to the returned timer value.\r
-  @param  TimerPeriod      A pointer to the amount of time that passes in femtoseconds for each increment\r
-                           of TimerValue.\r
-\r
-  @retval EFI_SUCCESS           The processor timer value specified by TimerIndex was returned in TimerValue.\r
-  @retval EFI_DEVICE_ERROR      An error occurred attempting to read one of the processor's timers.\r
-  @retval EFI_INVALID_PARAMETER TimerValue is NULL or TimerIndex is not valid.\r
-  @retval EFI_UNSUPPORTED       The processor does not have any readable timers.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-GetTimerValue (\r
-  IN  UINT32                         TimerIndex,\r
-  OUT UINT64                         *TimerValue,\r
-  OUT UINT64                         *TimerPeriod   OPTIONAL\r
-  )\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-/**\r
-  This function flushes the range of addresses from Start to Start+Length \r
-  from the processor's data cache. If Start is not aligned to a cache line \r
-  boundary, then the bytes before Start to the preceding cache line boundary \r
-  are also flushed. If Start+Length is not aligned to a cache line boundary, \r
-  then the bytes past Start+Length to the end of the next cache line boundary \r
-  are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be \r
-  supported. If the data cache is fully coherent with all DMA operations, then \r
-  this function can just return EFI_SUCCESS. If the processor does not support \r
-  flushing a range of the data cache, then the entire data cache can be flushed.\r
-\r
-  @param  Start            The beginning physical address to flush from the processor's data\r
-                           cache.\r
-  @param  Length           The number of bytes to flush from the processor's data cache. This\r
-                           function may flush more bytes than Length specifies depending upon\r
-                           the granularity of the flush operation that the processor supports.\r
-  @param  FlushType        Specifies the type of flush operation to perform.\r
-\r
-  @retval EFI_SUCCESS           The address range from Start to Start+Length was flushed from\r
-                                the processor's data cache.\r
-  @retval EFI_UNSUPPORTED       The processor does not support the cache flush type specified\r
-                                by FlushType.\r
-  @retval EFI_DEVICE_ERROR      The address range from Start to Start+Length could not be flushed\r
-                                from the processor's data cache.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-FlushCpuDataCache (\r
-  IN EFI_PHYSICAL_ADDRESS            Start,\r
-  IN UINT64                          Length,\r
-  IN EFI_CPU_FLUSH_TYPE              FlushType\r
-  )\r
-{\r
-  if (FlushType == EfiCpuFlushTypeWriteBackInvalidate) {\r
-    WriteBackInvalidateDataCacheRange((VOID *)(UINTN)Start, (UINTN)Length);\r
-    return EFI_SUCCESS;\r
-  } else if (FlushType == EfiCpuFlushTypeInvalidate) {\r
-    InvalidateDataCacheRange((VOID *)(UINTN)Start, (UINTN)Length);\r
-    return EFI_SUCCESS;\r
-  } else if (FlushType == EfiCpuFlushTypeWriteBack) {\r
-    WriteBackDataCacheRange((VOID *)(UINTN)Start, (UINTN)Length);\r
-    return EFI_SUCCESS;\r
-  } else {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-}\r
-\r
-\r
-\r
-\r
diff --git a/EmbeddedPkg/TemplateCpuDxe/Arm/Exceptions.S b/EmbeddedPkg/TemplateCpuDxe/Arm/Exceptions.S
deleted file mode 100755 (executable)
index d864759..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-#------------------------------------------------------------------------------ 
-#
-# Copyright (c) 2008-2009 Apple Inc. All rights reserved.
-#
-# 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
-# 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.
-#
-#------------------------------------------------------------------------------
-
-.text
-.align 2
-
-.globl _ExceptionHandlersStart
-.globl _ExceptionHandlersEnd
-.globl _CommonExceptionEntry
-.globl _AsmCommonExceptionEntry
-.globl _gExceptionHandlers
-
-_ExceptionHandlersStart:
-
-_Reset:
-        b               _ResetEntry
-
-_UndefinedInstruction:
-        b               _UndefinedInstructionEntry
-
-_SoftwareInterrupt:
-        b               _SoftwareInterruptEntry
-
-_PrefetchAbort:
-        b               _PrefetchAbortEntry
-
-_DataAbort:
-        b               _DataAbortEntry
-
-_ReservedException:
-        b               _ReservedExceptionEntry
-
-_Irq:
-        b               _IrqEntry
-
-_Fiq:
-        b               _FiqEntry
-
-_ResetEntry:
-        stmfd           sp!,{r0-r1}
-        mov             r0,#0
-        ldr             r1,_CommonExceptionEntry
-        bx              r1
-
-_UndefinedInstructionEntry:
-        stmfd           sp!,{r0-r1}
-        mov             r0,#1
-        ldr             r1,_CommonExceptionEntry
-        bx              r1
-
-_SoftwareInterruptEntry:
-        stmfd           sp!,{r0-r1}
-        mov             r0,#2
-        ldr             r1,_CommonExceptionEntry
-        bx              r1
-
-_PrefetchAbortEntry:
-        stmfd           sp!,{r0-r1}
-        mov             r0,#3
-        sub             lr,lr,#4
-        ldr             r1,_CommonExceptionEntry
-        bx              r1
-
-_DataAbortEntry:
-        stmfd           sp!,{r0-r1}
-        mov             r0,#4
-        sub             lr,lr,#8
-        ldr             r1,_CommonExceptionEntry
-        bx              r1
-
-_ReservedExceptionEntry:
-        stmfd           sp!,{r0-r1}
-        mov             r0,#5
-        ldr             r1,_CommonExceptionEntry
-        bx              r1
-
-_IrqEntry:
-        stmfd           sp!,{r0-r1}
-        mov             r0,#6
-        sub             lr,lr,#4
-        ldr             r1,_CommonExceptionEntry
-        bx              r1
-
-_FiqEntry:
-        stmfd           sp!,{r0-r1}
-        mov             r0,#7
-        sub             lr,lr,#4
-        ldr             r1,_CommonExceptionEntry
-        bx              r1
-
-_CommonExceptionEntry:
-        .byte             0x12
-        .byte             0x34
-        .byte             0x56
-        .byte             0x78
-
-_ExceptionHandlersEnd:
-
-LIndirectgExceptionHandlers:
-        .long             _gExceptionHandlers
-
-_AsmCommonExceptionEntry:
-        mrc             p15, 0, r1, c6, c0, 2   @ Read IFAR
-        stmfd           sp!,{r1}                @ Store the IFAR
-        
-        mrc             p15, 0, r1, c5, c0, 1   @ Read IFSR
-        stmfd           sp!,{r1}                @ Store the IFSR
-        
-        mrc             p15, 0, r1, c6, c0, 0   @ Read DFAR
-        stmfd           sp!,{r1}                @ Store the DFAR
-        
-        mrc             p15, 0, r1, c5, c0, 0   @ Read DFSR
-        stmfd           sp!,{r1}                @ Store the DFSR
-        
-        mrs             r1,spsr                 @ Read SPSR (which is the pre-exception CPSR)
-        stmfd           sp!,{r1}                @ Store the SPSR
-        
-        stmfd           sp!,{lr}                @ Store the link register (which is the pre-exception PC)
-        stmfd           sp,{sp,lr}^             @ Store user/system mode stack pointer and link register
-        nop                                     @ Required by ARM architecture
-        sub             sp,sp,#0x08             @ Adjust stack pointer
-        stmfd           sp!,{r2-r12}            @ Store general purpose registers
-        
-        ldr             r3,[sp,#0x40]           @ Read saved R1 from the stack (it was saved by the exception entry routine)
-        ldr             r2,[sp,#0x3C]           @ Read saved R0 from the stack (it was saved by the exception entry routine)
-        stmfd           sp!,{r2-r3}                @ Store general purpose registers R0 and R1
-        
-        mov             r1,sp                   @ Prepare System Context pointer as an argument for the exception handler
-        
-        ldr             r2,LIndirectgExceptionHandlers  @ Offset to 32-bit address of exception handler
-        ldr             r2,[r2]                         @ Load exception handler table
-        ldr             r3,[r2,r0,lsl #2]               @ Index to find the handler for this exception
-        
-//        blx             r3                      @ Call exception handler
-        bx             r3                      @ Call exception handler
-        
-        ldr             r2,[sp,#0x40]           @ Load CPSR from context, in case it has changed
-        msr             SPSR_cxsf,r2            @ Store it back to the SPSR to be restored when exiting this handler
-
-        ldmfd           sp!,{r0-r12}            @ Restore general purpose registers
-        ldmia           sp,{sp,lr}^             @ Restore user/system mode stack pointer and link register
-        nop                                     @ Required by ARM architecture
-        add             sp,sp,#0x08             @ Adjust stack pointer
-        ldmfd           sp!,{lr}                @ Restore the link register (which is the pre-exception PC)
-        add             sp,sp,#0x1C             @ Clear out the remaining stack space
-        movs            pc,lr                   @ Return from exception
-        
diff --git a/EmbeddedPkg/TemplateCpuDxe/Arm/Exceptions.asm b/EmbeddedPkg/TemplateCpuDxe/Arm/Exceptions.asm
deleted file mode 100755 (executable)
index b91639d..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-//------------------------------------------------------------------------------ 
-//
-// Copyright (c) 2008-2009 Apple Inc. All rights reserved.
-//
-// 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
-// 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.
-//
-//------------------------------------------------------------------------------
-
-        EXPORT ExceptionHandlersStart
-        EXPORT ExceptionHandlersEnd
-        EXPORT CommonExceptionEntry
-        EXPORT AsmCommonExceptionEntry
-        IMPORT gExceptionHandlers
-
-        AREA   DxeExceptionHandlers, CODE, READONLY
-
-ExceptionHandlersStart
-
-Reset
-        B               ResetEntry
-
-UndefinedInstruction
-        B               UndefinedInstructionEntry
-
-SoftwareInterrupt
-        B               SoftwareInterruptEntry
-
-PrefetchAbort
-        B               PrefetchAbortEntry
-
-DataAbort
-        B               DataAbortEntry
-
-ReservedException
-        B               ReservedExceptionEntry
-
-Irq
-        B               IrqEntry
-
-Fiq
-        B               FiqEntry
-
-ResetEntry
-        STMFD           SP!,{R0-R1}
-        MOV             R0,#0
-        LDR             R1,CommonExceptionEntry
-        BX              R1
-
-UndefinedInstructionEntry
-        STMFD           SP!,{R0-R1}
-        MOV             R0,#1
-        LDR             R1,CommonExceptionEntry
-        BX              R1
-
-SoftwareInterruptEntry
-        STMFD           SP!,{R0-R1}
-        MOV             R0,#2
-        LDR             R1,CommonExceptionEntry
-        BX              R1
-
-PrefetchAbortEntry
-        STMFD           SP!,{R0-R1}
-        MOV             R0,#3
-        SUB             LR,LR,#4
-        LDR             R1,CommonExceptionEntry
-        BX              R1
-
-DataAbortEntry
-        STMFD           SP!,{R0-R1}
-        MOV             R0,#4
-        SUB             LR,LR,#8
-        LDR             R1,CommonExceptionEntry
-        BX              R1
-
-ReservedExceptionEntry
-        STMFD           SP!,{R0-R1}
-        MOV             R0,#5
-        LDR             R1,CommonExceptionEntry
-        BX              R1
-
-IrqEntry
-        STMFD           SP!,{R0-R1}
-        MOV             R0,#6
-        SUB             LR,LR,#4
-        LDR             R1,CommonExceptionEntry
-        BX              R1
-
-FiqEntry
-        STMFD           SP!,{R0-R1}
-        MOV             R0,#7
-        SUB             LR,LR,#4
-        LDR             R1,CommonExceptionEntry
-        BX              R1
-
-CommonExceptionEntry
-        DCD             0x12345678
-
-ExceptionHandlersEnd
-
-AsmCommonExceptionEntry
-        MRC             p15, 0, r1, c6, c0, 2   ; Read IFAR
-        STMFD           SP!,{R1}                ; Store the IFAR
-        
-        MRC             p15, 0, r1, c5, c0, 1   ; Read IFSR
-        STMFD           SP!,{R1}                ; Store the IFSR
-        
-        MRC             p15, 0, r1, c6, c0, 0   ; Read DFAR
-        STMFD           SP!,{R1}                ; Store the DFAR
-        
-        MRC             p15, 0, r1, c5, c0, 0   ; Read DFSR
-        STMFD           SP!,{R1}                ; Store the DFSR
-        
-        MRS             R1,SPSR                 ; Read SPSR (which is the pre-exception CPSR)
-        STMFD           SP!,{R1}                ; Store the SPSR
-        
-        STMFD           SP!,{LR}                ; Store the link register (which is the pre-exception PC)
-        STMFD           SP,{SP,LR}^             ; Store user/system mode stack pointer and link register
-        NOP                                     ; Required by ARM architecture
-        SUB             SP,SP,#0x08             ; Adjust stack pointer
-        STMFD           SP!,{R2-R12}            ; Store general purpose registers
-        
-        LDR             R3,[SP,#0x40]           ; Read saved R1 from the stack (it was saved by the exception entry routine)
-        LDR             R2,[SP,#0x3C]           ; Read saved R0 from the stack (it was saved by the exception entry routine)
-        STMFD           SP!,{R2-R3}                ; Store general purpose registers R0 and R1
-        
-        MOV             R1,SP                   ; Prepare System Context pointer as an argument for the exception handler
-        
-        LDR             R2,=gExceptionHandlers  ; Load exception handler table
-        LDR             R3,[R2,R0,LSL #2]       ; Index to find the handler for this exception
-        
-        BLX             R3                      ; Call exception handler
-        
-        LDR             R2,[SP,#0x40]           ; Load CPSR from context, in case it has changed
-        MSR             SPSR_cxsf,R2            ; Store it back to the SPSR to be restored when exiting this handler
-
-        LDMFD           SP!,{R0-R12}            ; Restore general purpose registers
-        LDM             SP,{SP,LR}^             ; Restore user/system mode stack pointer and link register
-        NOP                                     ; Required by ARM architecture
-        ADD             SP,SP,#0x08             ; Adjust stack pointer
-        LDMFD           SP!,{LR}                ; Restore the link register (which is the pre-exception PC)
-        ADD             SP,SP,#0x1C             ; Clear out the remaining stack space
-        MOVS            PC,LR                   ; Return from exception
-        
-        END
-
-
diff --git a/EmbeddedPkg/TemplateCpuDxe/CpuDxe.c b/EmbeddedPkg/TemplateCpuDxe/CpuDxe.c
deleted file mode 100644 (file)
index 90bf8a9..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
-  \r
-  All rights reserved. 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 "CpuDxe.h"\r
-\r
-\r
-\r
-/**\r
-  This function flushes the range of addresses from Start to Start+Length \r
-  from the processor's data cache. If Start is not aligned to a cache line \r
-  boundary, then the bytes before Start to the preceding cache line boundary \r
-  are also flushed. If Start+Length is not aligned to a cache line boundary, \r
-  then the bytes past Start+Length to the end of the next cache line boundary \r
-  are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be \r
-  supported. If the data cache is fully coherent with all DMA operations, then \r
-  this function can just return EFI_SUCCESS. If the processor does not support \r
-  flushing a range of the data cache, then the entire data cache can be flushed.\r
-\r
-  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
-  @param  Start            The beginning physical address to flush from the processor's data\r
-                           cache.\r
-  @param  Length           The number of bytes to flush from the processor's data cache. This\r
-                           function may flush more bytes than Length specifies depending upon\r
-                           the granularity of the flush operation that the processor supports.\r
-  @param  FlushType        Specifies the type of flush operation to perform.\r
-\r
-  @retval EFI_SUCCESS           The address range from Start to Start+Length was flushed from\r
-                                the processor's data cache.\r
-  @retval EFI_UNSUPPORTED       The processor does not support the cache flush type specified\r
-                                by FlushType.\r
-  @retval EFI_DEVICE_ERROR      The address range from Start to Start+Length could not be flushed\r
-                                from the processor's data cache.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CpuFlushCpuDataCache (\r
-  IN EFI_CPU_ARCH_PROTOCOL           *This,\r
-  IN EFI_PHYSICAL_ADDRESS            Start,\r
-  IN UINT64                          Length,\r
-  IN EFI_CPU_FLUSH_TYPE              FlushType\r
-  )\r
-{\r
-  return FlushCpuDataCache (Start, Length, FlushType);\r
-}\r
-\r
-\r
-/**\r
-  This function enables interrupt processing by the processor. \r
-\r
-  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
-\r
-  @retval EFI_SUCCESS           Interrupts are enabled on the processor.\r
-  @retval EFI_DEVICE_ERROR      Interrupts could not be enabled on the processor.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CpuEnableInterrupt (\r
-  IN EFI_CPU_ARCH_PROTOCOL          *This\r
-  )\r
-{\r
-  EnableInterrupts (); \r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  This function disables interrupt processing by the processor.\r
-\r
-  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
-\r
-  @retval EFI_SUCCESS           Interrupts are disabled on the processor.\r
-  @retval EFI_DEVICE_ERROR      Interrupts could not be disabled on the processor.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CpuDisableInterrupt (\r
-  IN EFI_CPU_ARCH_PROTOCOL          *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Disables CPU interrupts.\r
-\r
-Arguments:\r
-  This                - Protocol instance structure\r
-\r
-Returns: \r
-  EFI_SUCCESS           - If interrupts were disabled in the CPU.\r
-  EFI_DEVICE_ERROR      - If interrupts could not be disabled on the CPU.\r
-\r
---*/\r
-{\r
-  DisableInterrupts ();\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  This function retrieves the processor's current interrupt state a returns it in \r
-  State. If interrupts are currently enabled, then TRUE is returned. If interrupts \r
-  are currently disabled, then FALSE is returned.\r
-\r
-  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
-  @param  State            A pointer to the processor's current interrupt state. Set to TRUE if\r
-                           interrupts are enabled and FALSE if interrupts are disabled.\r
-\r
-  @retval EFI_SUCCESS           The processor's current interrupt state was returned in State.\r
-  @retval EFI_INVALID_PARAMETER State is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CpuGetInterruptState (\r
-  IN  EFI_CPU_ARCH_PROTOCOL         *This,\r
-  OUT BOOLEAN                       *State\r
-  )\r
-{\r
-  if (State == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *State = GetInterruptState ();\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
-  This function generates an INIT on the processor. If this function succeeds, then the\r
-  processor will be reset, and control will not be returned to the caller. If InitType is \r
-  not supported by this processor, or the processor cannot programmatically generate an \r
-  INIT without help from external hardware, then EFI_UNSUPPORTED is returned. If an error \r
-  occurs attempting to generate an INIT, then EFI_DEVICE_ERROR is returned.\r
-\r
-  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
-  @param  InitType         The type of processor INIT to perform.\r
-\r
-  @retval EFI_SUCCESS           The processor INIT was performed. This return code should never be seen.\r
-  @retval EFI_UNSUPPORTED       The processor INIT operation specified by InitType is not supported\r
-                                by this processor.\r
-  @retval EFI_DEVICE_ERROR      The processor INIT failed.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CpuInit (\r
-  IN EFI_CPU_ARCH_PROTOCOL           *This,\r
-  IN EFI_CPU_INIT_TYPE               InitType\r
-  )\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-/**\r
-  This function registers and enables the handler specified by InterruptHandler for a processor \r
-  interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
-  handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
-  The installed handler is called once for each processor interrupt or exception.\r
-\r
-  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
-  @param  InterruptType    A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
-                           are enabled and FALSE if interrupts are disabled.\r
-  @param  InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
-                           when a processor interrupt occurs. If this parameter is NULL, then the handler\r
-                           will be uninstalled.\r
-\r
-  @retval EFI_SUCCESS           The handler for the processor interrupt was successfully installed or uninstalled.\r
-  @retval EFI_ALREADY_STARTED   InterruptHandler is not NULL, and a handler for InterruptType was\r
-                                previously installed.\r
-  @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
-                                previously installed.\r
-  @retval EFI_UNSUPPORTED       The interrupt specified by InterruptType is not supported.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CpuRegisterInterruptHandler (\r
-  IN EFI_CPU_ARCH_PROTOCOL          *This,\r
-  IN EFI_EXCEPTION_TYPE             InterruptType,\r
-  IN EFI_CPU_INTERRUPT_HANDLER      InterruptHandler\r
-  )\r
-{\r
-  return RegisterInterruptHandler (InterruptType, InterruptHandler);\r
-}\r
-\r
-\r
-/**\r
-  This function reads the processor timer specified by TimerIndex and returns it in TimerValue.\r
-\r
-  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
-  @param  TimerIndex       Specifies which processor timer is to be returned in TimerValue. This parameter\r
-                           must be between 0 and NumberOfTimers-1.\r
-  @param  TimerValue       Pointer to the returned timer value.\r
-  @param  TimerPeriod      A pointer to the amount of time that passes in femtoseconds for each increment\r
-                           of TimerValue.\r
-\r
-  @retval EFI_SUCCESS           The processor timer value specified by TimerIndex was returned in TimerValue.\r
-  @retval EFI_DEVICE_ERROR      An error occurred attempting to read one of the processor's timers.\r
-  @retval EFI_INVALID_PARAMETER TimerValue is NULL or TimerIndex is not valid.\r
-  @retval EFI_UNSUPPORTED       The processor does not have any readable timers.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CpuGetTimerValue (\r
-  IN  EFI_CPU_ARCH_PROTOCOL          *This,\r
-  IN  UINT32                         TimerIndex,\r
-  OUT UINT64                         *TimerValue,\r
-  OUT UINT64                         *TimerPeriod   OPTIONAL\r
-  )\r
-{  \r
-  return GetTimerValue (TimerIndex, TimerValue, TimerPeriod);\r
-}\r
-\r
-\r
-/**\r
-  This function modifies the attributes for the memory region specified by BaseAddress and\r
-  Length from their current attributes to the attributes specified by Attributes.\r
-\r
-  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
-  @param  BaseAddress      The physical address that is the start address of a memory region.\r
-  @param  Length           The size in bytes of the memory region.\r
-  @param  Attributes       The bit mask of attributes to set for the memory region.\r
-\r
-  @retval EFI_SUCCESS           The attributes were set for the memory region.\r
-  @retval EFI_ACCESS_DENIED     The attributes for the memory resource range specified by\r
-                                BaseAddress and Length cannot be modified.\r
-  @retval EFI_INVALID_PARAMETER Length is zero.\r
-  @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to modify the attributes of\r
-                                the memory resource range.\r
-  @retval EFI_UNSUPPORTED       The processor does not support one or more bytes of the memory\r
-                                resource range specified by BaseAddress and Length.\r
-                                The bit mask of attributes is not support for the memory resource\r
-                                range specified by BaseAddress and Length.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CpuSetMemoryAttributes (\r
-  IN EFI_CPU_ARCH_PROTOCOL     *This,\r
-  IN EFI_PHYSICAL_ADDRESS      BaseAddress,\r
-  IN UINT64                    Length,\r
-  IN UINT64                    Attributes\r
-  )\r
-{\r
-  //\r
-  // This is used to set cachability via the MMU on ARM\r
-  //\r
-  // This more about optimization and we can usually run fine if the default\r
-  // settings for cachability are good.\r
-  //\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-\r
-\r
-//\r
-// Globals used to initialize the protocol\r
-//\r
-EFI_HANDLE              mCpuHandle = NULL;\r
-EFI_CPU_ARCH_PROTOCOL   mCpu = {\r
-  CpuFlushCpuDataCache,\r
-  CpuEnableInterrupt,\r
-  CpuDisableInterrupt,\r
-  CpuGetInterruptState,\r
-  CpuInit,\r
-  CpuRegisterInterruptHandler,\r
-  CpuGetTimerValue,\r
-  CpuSetMemoryAttributes,\r
-  0,          // NumberOfTimers\r
-  4,          // DmaBufferAlignment\r
-};\r
-\r
-\r
-/**\r
-  Initialize the state information for the CPU Architectural Protocol\r
-\r
-  @param  ImageHandle   of the loaded driver\r
-  @param  SystemTable   Pointer to the System Table\r
-\r
-  @retval EFI_SUCCESS           Protocol registered\r
-  @retval EFI_OUT_OF_RESOURCES  Cannot allocate protocol data structure\r
-  @retval EFI_DEVICE_ERROR      Hardware problems\r
-\r
-**/\r
-EFI_STATUS\r
-CpuDxeInitialize (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS                  Status;\r
-\r
-  InitializeExceptions (&mCpu);\r
-\r
-  //\r
-  // Install CPU Architectural Protocol and the thunk protocol\r
-  //\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &mCpuHandle,\r
-                  &gEfiCpuArchProtocolGuid,  &mCpu,\r
-                  NULL\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
-\r
diff --git a/EmbeddedPkg/TemplateCpuDxe/CpuDxe.h b/EmbeddedPkg/TemplateCpuDxe/CpuDxe.h
deleted file mode 100644 (file)
index c81d801..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation <BR>                                                         \r
-  Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.\r
-\r
-  All rights reserved. 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
\r
-#include <PiDxe.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/DxeServicesTableLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-#include <Protocol/Cpu.h>\r
-#include <Protocol/DebugSupport.h>\r
-\r
-\r
-\r
-/**\r
-  This function registers and enables the handler specified by InterruptHandler for a processor \r
-  interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
-  handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
-  The installed handler is called once for each processor interrupt or exception.\r
-\r
-  @param  InterruptType    A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
-                           are enabled and FALSE if interrupts are disabled.\r
-  @param  InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
-                           when a processor interrupt occurs. If this parameter is NULL, then the handler\r
-                           will be uninstalled.\r
-\r
-  @retval EFI_SUCCESS           The handler for the processor interrupt was successfully installed or uninstalled.\r
-  @retval EFI_ALREADY_STARTED   InterruptHandler is not NULL, and a handler for InterruptType was\r
-                                previously installed.\r
-  @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
-                                previously installed.\r
-  @retval EFI_UNSUPPORTED       The interrupt specified by InterruptType is not supported.\r
-\r
-**/\r
-EFI_STATUS\r
-RegisterInterruptHandler (\r
-  IN EFI_EXCEPTION_TYPE             InterruptType,\r
-  IN EFI_CPU_INTERRUPT_HANDLER      InterruptHandler\r
-  );\r
-\r
-\r
-EFI_STATUS\r
-InitializeExceptions (\r
-       IN EFI_CPU_ARCH_PROTOCOL    *Cpu\r
-       );\r
-\r
-\r
-/**\r
-  This function reads the processor timer specified by TimerIndex and returns it in TimerValue.\r
-\r
-  @param  TimerIndex       Specifies which processor timer is to be returned in TimerValue. This parameter\r
-                           must be between 0 and NumberOfTimers-1.\r
-  @param  TimerValue       Pointer to the returned timer value.\r
-  @param  TimerPeriod      A pointer to the amount of time that passes in femtoseconds for each increment\r
-                           of TimerValue.\r
-\r
-  @retval EFI_SUCCESS           The processor timer value specified by TimerIndex was returned in TimerValue.\r
-  @retval EFI_DEVICE_ERROR      An error occurred attempting to read one of the processor's timers.\r
-  @retval EFI_INVALID_PARAMETER TimerValue is NULL or TimerIndex is not valid.\r
-  @retval EFI_UNSUPPORTED       The processor does not have any readable timers.\r
-\r
-**/\r
-EFI_STATUS\r
-GetTimerValue (\r
-  IN  UINT32                         TimerIndex,\r
-  OUT UINT64                         *TimerValue,\r
-  OUT UINT64                         *TimerPeriod   OPTIONAL\r
-  );\r
-\r
-\r
-/**\r
-  This function flushes the range of addresses from Start to Start+Length \r
-  from the processor's data cache. If Start is not aligned to a cache line \r
-  boundary, then the bytes before Start to the preceding cache line boundary \r
-  are also flushed. If Start+Length is not aligned to a cache line boundary, \r
-  then the bytes past Start+Length to the end of the next cache line boundary \r
-  are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be \r
-  supported. If the data cache is fully coherent with all DMA operations, then \r
-  this function can just return EFI_SUCCESS. If the processor does not support \r
-  flushing a range of the data cache, then the entire data cache can be flushed.\r
-\r
-  @param  Start            The beginning physical address to flush from the processor's data\r
-                           cache.\r
-  @param  Length           The number of bytes to flush from the processor's data cache. This\r
-                           function may flush more bytes than Length specifies depending upon\r
-                           the granularity of the flush operation that the processor supports.\r
-  @param  FlushType        Specifies the type of flush operation to perform.\r
-\r
-  @retval EFI_SUCCESS           The address range from Start to Start+Length was flushed from\r
-                                the processor's data cache.\r
-  @retval EFI_UNSUPPORTED       The processor does not support the cache flush type specified\r
-                                by FlushType.\r
-  @retval EFI_DEVICE_ERROR      The address range from Start to Start+Length could not be flushed\r
-                                from the processor's data cache.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-FlushCpuDataCache (\r
-  IN EFI_PHYSICAL_ADDRESS            Start,\r
-  IN UINT64                          Length,\r
-  IN EFI_CPU_FLUSH_TYPE              FlushType\r
-  );\r
-\r
-\r
diff --git a/EmbeddedPkg/TemplateCpuDxe/IA32/Exception.c b/EmbeddedPkg/TemplateCpuDxe/IA32/Exception.c
deleted file mode 100644 (file)
index 5ba38e1..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
-  \r
-  All rights reserved. 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 <CpuDxe.h>\r
-\r
-\r
-EFI_EXCEPTION_CALLBACK  gExceptionHandlers[0x100];\r
-\r
-\r
-/**\r
-  This function registers and enables the handler specified by InterruptHandler for a processor \r
-  interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
-  handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
-  The installed handler is called once for each processor interrupt or exception.\r
-\r
-  @param  InterruptType    A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
-                           are enabled and FALSE if interrupts are disabled.\r
-  @param  InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
-                           when a processor interrupt occurs. If this parameter is NULL, then the handler\r
-                           will be uninstalled.\r
-\r
-  @retval EFI_SUCCESS           The handler for the processor interrupt was successfully installed or uninstalled.\r
-  @retval EFI_ALREADY_STARTED   InterruptHandler is not NULL, and a handler for InterruptType was\r
-                                previously installed.\r
-  @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
-                                previously installed.\r
-  @retval EFI_UNSUPPORTED       The interrupt specified by InterruptType is not supported.\r
-\r
-**/\r
-EFI_STATUS\r
-RegisterInterruptHandler (\r
-  IN EFI_EXCEPTION_TYPE             InterruptType,\r
-  IN EFI_CPU_INTERRUPT_HANDLER      InterruptHandler\r
-  )\r
-{\r
-       if (InterruptType > 0xFF) {\r
-               return EFI_UNSUPPORTED;\r
-       }\r
-\r
-       if ((InterruptHandler == NULL) && (gExceptionHandlers[InterruptType] == NULL)) {\r
-               return EFI_INVALID_PARAMETER;\r
-       }\r
-\r
-       if ((InterruptHandler != NULL) && (gExceptionHandlers[InterruptType] != NULL)) {\r
-               return EFI_ALREADY_STARTED;\r
-       }\r
-\r
-       gExceptionHandlers[InterruptType] = InterruptHandler;\r
-\r
-       return EFI_SUCCESS;\r
-}\r
-\r
-\r
-\r
-\r
-VOID\r
-EFIAPI\r
-DefaultExceptionHandler (\r
-       IN     EFI_EXCEPTION_TYPE                                               ExceptionType,\r
-       IN OUT EFI_SYSTEM_CONTEXT                                               SystemContext\r
-       )\r
-{\r
-       DEBUG ((EFI_D_ERROR, "Exception %d from %x\n", ExceptionType, SystemContext.SystemContextIa32->Eip));\r
-  ASSERT (FALSE);\r
-\r
-       return;\r
-}\r
-\r
-\r
-\r
-EFI_STATUS\r
-InitializeExceptions (\r
-       IN EFI_CPU_ARCH_PROTOCOL    *Cpu\r
-       )\r
-{\r
-  // You need to initialize gExceptionHandlers[] to point to DefaultExceptionHandler()\r
-  // and write all the assembly to handle the interrupts.\r
-  ASSERT (FALSE);\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-\r
-/**\r
-  This function reads the processor timer specified by TimerIndex and returns it in TimerValue.\r
-\r
-  @param  TimerIndex       Specifies which processor timer is to be returned in TimerValue. This parameter\r
-                           must be between 0 and NumberOfTimers-1.\r
-  @param  TimerValue       Pointer to the returned timer value.\r
-  @param  TimerPeriod      A pointer to the amount of time that passes in femtoseconds for each increment\r
-                           of TimerValue.\r
-\r
-  @retval EFI_SUCCESS           The processor timer value specified by TimerIndex was returned in TimerValue.\r
-  @retval EFI_DEVICE_ERROR      An error occurred attempting to read one of the processor's timers.\r
-  @retval EFI_INVALID_PARAMETER TimerValue is NULL or TimerIndex is not valid.\r
-  @retval EFI_UNSUPPORTED       The processor does not have any readable timers.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-GetTimerValue (\r
-  IN  UINT32                         TimerIndex,\r
-  OUT UINT64                         *TimerValue,\r
-  OUT UINT64                         *TimerPeriod   OPTIONAL\r
-  )\r
-{\r
-  if (TimerValue == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  if (TimerIndex == 0) {\r
-    *TimerValue = AsmReadTsc ();\r
-    if (TimerPeriod != NULL) {\r
-      //\r
-      // BugBug: Hard coded. Don't know how to do this generically\r
-      //\r
-      *TimerPeriod = 1000000000;\r
-    }\r
-    return EFI_SUCCESS;\r
-  }\r
-  return EFI_INVALID_PARAMETER;\r
-}\r
-\r
-\r
-/**\r
-  This function flushes the range of addresses from Start to Start+Length \r
-  from the processor's data cache. If Start is not aligned to a cache line \r
-  boundary, then the bytes before Start to the preceding cache line boundary \r
-  are also flushed. If Start+Length is not aligned to a cache line boundary, \r
-  then the bytes past Start+Length to the end of the next cache line boundary \r
-  are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be \r
-  supported. If the data cache is fully coherent with all DMA operations, then \r
-  this function can just return EFI_SUCCESS. If the processor does not support \r
-  flushing a range of the data cache, then the entire data cache can be flushed.\r
-\r
-  @param  Start            The beginning physical address to flush from the processor's data\r
-                           cache.\r
-  @param  Length           The number of bytes to flush from the processor's data cache. This\r
-                           function may flush more bytes than Length specifies depending upon\r
-                           the granularity of the flush operation that the processor supports.\r
-  @param  FlushType        Specifies the type of flush operation to perform.\r
-\r
-  @retval EFI_SUCCESS           The address range from Start to Start+Length was flushed from\r
-                                the processor's data cache.\r
-  @retval EFI_UNSUPPORTED       The processor does not support the cache flush type specified\r
-                                by FlushType.\r
-  @retval EFI_DEVICE_ERROR      The address range from Start to Start+Length could not be flushed\r
-                                from the processor's data cache.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-FlushCpuDataCache (\r
-  IN EFI_PHYSICAL_ADDRESS            Start,\r
-  IN UINT64                          Length,\r
-  IN EFI_CPU_FLUSH_TYPE              FlushType\r
-  )\r
-{\r
-  if (FlushType == EfiCpuFlushTypeWriteBackInvalidate) {\r
-    AsmWbinvd ();\r
-    return EFI_SUCCESS;\r
-  } else if (FlushType == EfiCpuFlushTypeInvalidate) {\r
-    AsmInvd ();  \r
-    return EFI_SUCCESS;\r
-  } else {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-}\r
-\r
-\r
-\r
-\r
diff --git a/EmbeddedPkg/TemplateCpuDxe/TemplateCpuDxe.inf b/EmbeddedPkg/TemplateCpuDxe/TemplateCpuDxe.inf
deleted file mode 100644 (file)
index 3d931cd..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#/** @file\r
-#  \r
-#    Component discription file for Bds module\r
-#  \r
-#  Copyright (c) 2008, Intel Corporation. <BR>\r
-#  All rights reserved. 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                      = TemplateCpuDxe\r
-  FILE_GUID                      = CB6DC1E4-5B27-41E8-BC27-9AA50B62081E\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = CpuDxeInitialize\r
-\r
-\r
-[Sources.common]\r
-  CpuDxe.c\r
-\r
-[Sources.ARM]\r
-  Arm/Exception.c\r
-  Arm/Exceptions.asm \r
-  Arm/Exceptions.S  \r
-\r
-[Sources.IA32]\r
-  IA32/Exception.c\r
-\r
-[Sources.X64]\r
-  X64/Exception.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  EmbeddedPkg/EmbeddedPkg.dec\r
-  \r
-[Packages.ARM]\r
-  ArmPkg/ArmPkg.dec\r
-\r
-[LibraryClasses]\r
-  BaseLib\r
-  UefiRuntimeServicesTableLib\r
-  ReportStatusCodeLib\r
-  PerformanceLib\r
-  DxeServicesTableLib\r
-  MemoryAllocationLib\r
-  UefiLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  DebugLib\r
-  UefiDriverEntryPoint\r
-  CacheMaintenanceLib\r
-\r
-[Protocols]\r
-  gEfiCpuArchProtocolGuid                       \r
-\r
-[Pcd.ARM]\r
-  gArmTokenSpaceGuid.PcdCpuVectorBaseAddress\r
-\r
-\r
-[depex]\r
-  TRUE\r
diff --git a/EmbeddedPkg/TemplateCpuDxe/X64/Exception.c b/EmbeddedPkg/TemplateCpuDxe/X64/Exception.c
deleted file mode 100644 (file)
index f86eda0..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
-  \r
-  All rights reserved. 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 <CpuDxe.h>\r
-\r
-\r
-EFI_EXCEPTION_CALLBACK  gExceptionHandlers[0x100];\r
-\r
-\r
-/**\r
-  This function registers and enables the handler specified by InterruptHandler for a processor \r
-  interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
-  handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
-  The installed handler is called once for each processor interrupt or exception.\r
-\r
-  @param  InterruptType    A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
-                           are enabled and FALSE if interrupts are disabled.\r
-  @param  InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
-                           when a processor interrupt occurs. If this parameter is NULL, then the handler\r
-                           will be uninstalled.\r
-\r
-  @retval EFI_SUCCESS           The handler for the processor interrupt was successfully installed or uninstalled.\r
-  @retval EFI_ALREADY_STARTED   InterruptHandler is not NULL, and a handler for InterruptType was\r
-                                previously installed.\r
-  @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
-                                previously installed.\r
-  @retval EFI_UNSUPPORTED       The interrupt specified by InterruptType is not supported.\r
-\r
-**/\r
-EFI_STATUS\r
-RegisterInterruptHandler (\r
-  IN EFI_EXCEPTION_TYPE             InterruptType,\r
-  IN EFI_CPU_INTERRUPT_HANDLER      InterruptHandler\r
-  )\r
-{\r
-       if (InterruptType > 0xFF) {\r
-               return EFI_UNSUPPORTED;\r
-       }\r
-\r
-       if ((InterruptHandler == NULL) && (gExceptionHandlers[InterruptType] == NULL)) {\r
-               return EFI_INVALID_PARAMETER;\r
-       }\r
-\r
-       if ((InterruptHandler != NULL) && (gExceptionHandlers[InterruptType] != NULL)) {\r
-               return EFI_ALREADY_STARTED;\r
-       }\r
-\r
-       gExceptionHandlers[InterruptType] = InterruptHandler;\r
-\r
-       return EFI_SUCCESS;\r
-}\r
-\r
-\r
-\r
-\r
-VOID\r
-EFIAPI\r
-DefaultExceptionHandler (\r
-       IN     EFI_EXCEPTION_TYPE                                               ExceptionType,\r
-       IN OUT EFI_SYSTEM_CONTEXT                                               SystemContext\r
-       )\r
-{\r
-       DEBUG ((EFI_D_ERROR, "Exception %d from %x\n", ExceptionType, SystemContext.SystemContextX64->Rip));\r
-  ASSERT (FALSE);\r
-\r
-       return;\r
-}\r
-\r
-\r
-\r
-EFI_STATUS\r
-InitializeExceptions (\r
-       IN EFI_CPU_ARCH_PROTOCOL    *Cpu\r
-       )\r
-{\r
-  // You need to initialize gExceptionHandlers[] to point to DefaultExceptionHandler()\r
-  // and write all the assembly to handle the interrupts.\r
-  ASSERT (FALSE);\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-\r
-/**\r
-  This function reads the processor timer specified by TimerIndex and returns it in TimerValue.\r
-\r
-  @param  TimerIndex       Specifies which processor timer is to be returned in TimerValue. This parameter\r
-                           must be between 0 and NumberOfTimers-1.\r
-  @param  TimerValue       Pointer to the returned timer value.\r
-  @param  TimerPeriod      A pointer to the amount of time that passes in femtoseconds for each increment\r
-                           of TimerValue.\r
-\r
-  @retval EFI_SUCCESS           The processor timer value specified by TimerIndex was returned in TimerValue.\r
-  @retval EFI_DEVICE_ERROR      An error occurred attempting to read one of the processor's timers.\r
-  @retval EFI_INVALID_PARAMETER TimerValue is NULL or TimerIndex is not valid.\r
-  @retval EFI_UNSUPPORTED       The processor does not have any readable timers.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-GetTimerValue (\r
-  IN  UINT32                         TimerIndex,\r
-  OUT UINT64                         *TimerValue,\r
-  OUT UINT64                         *TimerPeriod   OPTIONAL\r
-  )\r
-{\r
-  if (TimerValue == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  if (TimerIndex == 0) {\r
-    *TimerValue = AsmReadTsc ();\r
-    if (TimerPeriod != NULL) {\r
-      //\r
-      // BugBug: Hard coded. Don't know how to do this generically\r
-      //\r
-      *TimerPeriod = 1000000000;\r
-    }\r
-    return EFI_SUCCESS;\r
-  }\r
-  return EFI_INVALID_PARAMETER;\r
-}\r
-\r
-\r
-/**\r
-  This function flushes the range of addresses from Start to Start+Length \r
-  from the processor's data cache. If Start is not aligned to a cache line \r
-  boundary, then the bytes before Start to the preceding cache line boundary \r
-  are also flushed. If Start+Length is not aligned to a cache line boundary, \r
-  then the bytes past Start+Length to the end of the next cache line boundary \r
-  are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be \r
-  supported. If the data cache is fully coherent with all DMA operations, then \r
-  this function can just return EFI_SUCCESS. If the processor does not support \r
-  flushing a range of the data cache, then the entire data cache can be flushed.\r
-\r
-  @param  Start            The beginning physical address to flush from the processor's data\r
-                           cache.\r
-  @param  Length           The number of bytes to flush from the processor's data cache. This\r
-                           function may flush more bytes than Length specifies depending upon\r
-                           the granularity of the flush operation that the processor supports.\r
-  @param  FlushType        Specifies the type of flush operation to perform.\r
-\r
-  @retval EFI_SUCCESS           The address range from Start to Start+Length was flushed from\r
-                                the processor's data cache.\r
-  @retval EFI_UNSUPPORTED       The processor does not support the cache flush type specified\r
-                                by FlushType.\r
-  @retval EFI_DEVICE_ERROR      The address range from Start to Start+Length could not be flushed\r
-                                from the processor's data cache.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-FlushCpuDataCache (\r
-  IN EFI_PHYSICAL_ADDRESS            Start,\r
-  IN UINT64                          Length,\r
-  IN EFI_CPU_FLUSH_TYPE              FlushType\r
-  )\r
-{\r
-  if (FlushType == EfiCpuFlushTypeWriteBackInvalidate) {\r
-    AsmWbinvd ();\r
-    return EFI_SUCCESS;\r
-  } else if (FlushType == EfiCpuFlushTypeInvalidate) {\r
-    AsmInvd ();  \r
-    return EFI_SUCCESS;\r
-  } else {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-}\r
-\r
-\r
-\r
-\r
diff --git a/EmbeddedPkg/TemplateTimerDxe/TemplateTimerDxe.inf b/EmbeddedPkg/TemplateTimerDxe/TemplateTimerDxe.inf
deleted file mode 100644 (file)
index 3911a08..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#/** @file\r
-#  \r
-#    Component discription file for Bds module\r
-#  \r
-#  Copyright (c) 2008, Apple Inc. <BR>\r
-#  All rights reserved. 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                      = TemplateTimerDxe\r
-  FILE_GUID                      = E697928E-7C98-4501-8406-21F5509549CC\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = TimerInitialize\r
-\r
-[Sources.common]\r
-  Timer.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  EmbeddedPkg/EmbeddedPkg.dec\r
-\r
-[LibraryClasses]\r
-  BaseLib\r
-  UefiRuntimeServicesTableLib\r
-  PerformanceLib\r
-  UefiLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  DebugLib\r
-  UefiDriverEntryPoint\r
-  IoLib\r
-\r
-[Guids]\r
-\r
-[Protocols]\r
-  gEfiTimerArchProtocolGuid  \r
-  gHardwareInterruptProtocolGuid\r
-\r
-[Pcd.common]\r
-  gEmbeddedTokenSpaceGuid.PcdTimerBaseAddress\r
-  gEmbeddedTokenSpaceGuid.PcdTimerVector\r
-  gEmbeddedTokenSpaceGuid.PcdTimerPeriod\r
-\r
-[Depex]\r
-  gHardwareInterruptProtocolGuid
\ No newline at end of file
diff --git a/EmbeddedPkg/TemplateTimerDxe/Timer.c b/EmbeddedPkg/TemplateTimerDxe/Timer.c
deleted file mode 100644 (file)
index a48d4b5..0000000
+++ /dev/null
@@ -1,377 +0,0 @@
-/** @file\r
-  Template for Timer Architecture Protocol driver of the ARM flavor\r
-\r
-  Copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
-  \r
-  All rights reserved. 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
-\r
-#include <PiDxe.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/IoLib.h>\r
-\r
-#include <Protocol/Timer.h>\r
-#include <Protocol/HardwareInterrupt.h>\r
-\r
-//\r
-// Get Base Address of timer block from platform .DSC file\r
-//\r
-#define TIMER_BASE ((UINTN)FixedPcdGet32 (PcdTimerBaseAddress) + 0x00c0)\r
-\r
-\r
-#define TIMER_CMD    ((UINTN)FixedPcdGet32 (PcdTimerBaseAddress) + 0x00000004)\r
-#define TIMER_DATA   ((UINTN)FixedPcdGet32 (PcdTimerBaseAddress) + 0x00000008)\r
-\r
-//\r
-// The notification function to call on every timer interrupt.\r
-// A bug in the compiler prevents us from initializing this here.\r
-//\r
-volatile EFI_TIMER_NOTIFY mTimerNotifyFunction;\r
-\r
-//\r
-// The current period of the timer interrupt\r
-//\r
-volatile UINT64           mTimerPeriod = 0;\r
-\r
-//\r
-// Cached copy of the Hardware Interrupt protocol instance\r
-//\r
-EFI_HARDWARE_INTERRUPT_PROTOCOL *gInterrupt = NULL;\r
-\r
-\r
-/**\r
-  C Interrupt Handler calledin the interrupt context when Source interrupt is active.\r
-\r
-  @param Source         Source of the interrupt. Hardware routing off a specific platform defines\r
-                        what source means.\r
-  @param SystemContext  Pointer to system register context. Mostly used by debuggers and will\r
-                        update the system context after the return from the interrupt if \r
-                        modified. Don't change these values unless you know what you are doing\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-TimerInterruptHandler (\r
-       IN HARDWARE_INTERRUPT_SOURCE            Source,\r
-  IN  EFI_SYSTEM_CONTEXT          SystemContext        \r
-       )\r
-{\r
-       EFI_TPL                                                 OriginalTPL;\r
-\r
-  //\r
-  // DXE core uses this callback for the EFI timer tick. The DXE core uses locks \r
-  // that raise to TPL_HIGH and then restore back to current level. Thus we need\r
-  // to make sure TPL level is set to TPL_HIGH while we are handling the timer tick. \r
-  //\r
-       OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
-\r
-  MmioWrite32 (TIMER_CMD, 0);\r
-\r
-       if (mTimerNotifyFunction) {\r
-               mTimerNotifyFunction (mTimerPeriod);\r
-       }\r
-\r
-  // restore state\r
-       gBS->RestoreTPL (OriginalTPL);\r
-}\r
-\r
-\r
-\r
-/**\r
-  This function registers the handler NotifyFunction so it is called every time \r
-  the timer interrupt fires.  It also passes the amount of time since the last \r
-  handler call to the NotifyFunction.  If NotifyFunction is NULL, then the \r
-  handler is unregistered.  If the handler is registered, then EFI_SUCCESS is \r
-  returned.  If the CPU does not support registering a timer interrupt handler, \r
-  then EFI_UNSUPPORTED is returned.  If an attempt is made to register a handler \r
-  when a handler is already registered, then EFI_ALREADY_STARTED is returned.  \r
-  If an attempt is made to unregister a handler when a handler is not registered, \r
-  then EFI_INVALID_PARAMETER is returned.  If an error occurs attempting to \r
-  register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR \r
-  is returned.\r
-\r
-  @param  This             The EFI_TIMER_ARCH_PROTOCOL instance.\r
-  @param  NotifyFunction   The function to call when a timer interrupt fires. This\r
-                           function executes at TPL_HIGH_LEVEL. The DXE Core will\r
-                           register a handler for the timer interrupt, so it can know\r
-                           how much time has passed. This information is used to\r
-                           signal timer based events. NULL will unregister the handler.\r
-\r
-  @retval EFI_SUCCESS           The timer handler was registered.\r
-  @retval EFI_UNSUPPORTED       The platform does not support timer interrupts.\r
-  @retval EFI_ALREADY_STARTED   NotifyFunction is not NULL, and a handler is already\r
-                                registered.\r
-  @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not\r
-                                previously registered.\r
-  @retval EFI_DEVICE_ERROR      The timer handler could not be registered.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-TimerDriverRegisterHandler (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This,\r
-  IN EFI_TIMER_NOTIFY         NotifyFunction\r
-  )\r
-{\r
-  //\r
-  // Check for invalid parameters\r
-  //\r
-  if (NotifyFunction == NULL && mTimerNotifyFunction == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (NotifyFunction != NULL && mTimerNotifyFunction != NULL) {\r
-    return EFI_ALREADY_STARTED;\r
-  }\r
-\r
-  mTimerNotifyFunction = NotifyFunction;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-\r
-/**\r
-  This function adjusts the period of timer interrupts to the value specified \r
-  by TimerPeriod.  If the timer period is updated, then the selected timer \r
-  period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned.  If \r
-  the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.  \r
-  If an error occurs while attempting to update the timer period, then the \r
-  timer hardware will be put back in its state prior to this call, and \r
-  EFI_DEVICE_ERROR is returned.  If TimerPeriod is 0, then the timer interrupt \r
-  is disabled.  This is not the same as disabling the CPU's interrupts.  \r
-  Instead, it must either turn off the timer hardware, or it must adjust the \r
-  interrupt controller so that a CPU interrupt is not generated when the timer \r
-  interrupt fires. \r
-\r
-  @param  This             The EFI_TIMER_ARCH_PROTOCOL instance.\r
-  @param  TimerPeriod      The rate to program the timer interrupt in 100 nS units. If\r
-                           the timer hardware is not programmable, then EFI_UNSUPPORTED is\r
-                           returned. If the timer is programmable, then the timer period\r
-                           will be rounded up to the nearest timer period that is supported\r
-                           by the timer hardware. If TimerPeriod is set to 0, then the\r
-                           timer interrupts will be disabled.\r
-\r
-  @retval EFI_SUCCESS           The timer period was changed.\r
-  @retval EFI_UNSUPPORTED       The platform cannot change the period of the timer interrupt.\r
-  @retval EFI_DEVICE_ERROR      The timer period could not be changed due to a device error.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-TimerDriverSetTimerPeriod (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This,\r
-  IN UINT64                   TimerPeriod\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-  UINT64      TimerCount;\r
-  \r
-  if (TimerPeriod == 0) {\r
-    //\r
-    // Disable interrupt 0 and timer\r
-    //\r
-    MmioAnd32 (TIMER_DATA, 0);\r
-\r
-               Status = gInterrupt->DisableInterruptSource (gInterrupt, FixedPcdGet32 (PcdTimerVector));    \r
-  } else {\r
-               //\r
-               // Convert TimerPeriod into Timer F counts\r
-               //\r
-               TimerCount = DivU64x32 (TimerPeriod + 5, 10);\r
-\r
-               //\r
-               // Program Timer F with the new count value\r
-               //\r
-               MmioWrite32 (TIMER_DATA, (UINT32)TimerCount);\r
-\r
-               //\r
-               // Enable interrupt and initialize and enable timer.\r
-               //\r
-               MmioOr32 (TIMER_CMD, 0x11);\r
-\r
-               Status = gInterrupt->EnableInterruptSource (gInterrupt,  FixedPcdGet32 (PcdTimerVector));    \r
-  }\r
-\r
-       //\r
-       // Save the new timer period\r
-       //\r
-       mTimerPeriod = TimerPeriod;\r
-  return Status;\r
-}\r
-\r
-\r
-/**\r
-  This function retrieves the period of timer interrupts in 100 ns units, \r
-  returns that value in TimerPeriod, and returns EFI_SUCCESS.  If TimerPeriod \r
-  is NULL, then EFI_INVALID_PARAMETER is returned.  If a TimerPeriod of 0 is \r
-  returned, then the timer is currently disabled.\r
-\r
-  @param  This             The EFI_TIMER_ARCH_PROTOCOL instance.\r
-  @param  TimerPeriod      A pointer to the timer period to retrieve in 100 ns units. If\r
-                           0 is returned, then the timer is currently disabled.\r
-\r
-  @retval EFI_SUCCESS           The timer period was returned in TimerPeriod.\r
-  @retval EFI_INVALID_PARAMETER TimerPeriod is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-TimerDriverGetTimerPeriod (\r
-  IN EFI_TIMER_ARCH_PROTOCOL   *This,\r
-  OUT UINT64                   *TimerPeriod\r
-  )\r
-{\r
-  if (TimerPeriod == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *TimerPeriod = mTimerPeriod;\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-\r
-/**\r
-  This function generates a soft timer interrupt. If the platform does not support soft \r
-  timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned. \r
-  If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler() \r
-  service, then a soft timer interrupt will be generated. If the timer interrupt is \r
-  enabled when this service is called, then the registered handler will be invoked. The \r
-  registered handler should not be able to distinguish a hardware-generated timer \r
-  interrupt from a software-generated timer interrupt.\r
-\r
-  @param  This             The EFI_TIMER_ARCH_PROTOCOL instance.\r
-\r
-  @retval EFI_SUCCESS           The soft timer interrupt was generated.\r
-  @retval EFI_UNSUPPORTED       The platform does not support the generation of soft timer interrupts.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-TimerDriverGenerateSoftInterrupt (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This\r
-  )\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-/**\r
-  Interface stucture for the Timer Architectural Protocol.\r
-\r
-  @par Protocol Description:\r
-  This protocol provides the services to initialize a periodic timer \r
-  interrupt, and to register a handler that is called each time the timer\r
-  interrupt fires.  It may also provide a service to adjust the rate of the\r
-  periodic timer interrupt.  When a timer interrupt occurs, the handler is \r
-  passed the amount of time that has passed since the previous timer \r
-  interrupt.\r
-\r
-  @param RegisterHandler\r
-  Registers a handler that will be called each time the \r
-  timer interrupt fires.  TimerPeriod defines the minimum \r
-  time between timer interrupts, so TimerPeriod will also \r
-  be the minimum time between calls to the registered \r
-  handler.\r
-\r
-  @param SetTimerPeriod\r
-  Sets the period of the timer interrupt in 100 nS units.  \r
-  This function is optional, and may return EFI_UNSUPPORTED.  \r
-  If this function is supported, then the timer period will \r
-  be rounded up to the nearest supported timer period.\r
-\r
-  @param GetTimerPeriod\r
-  Retrieves the period of the timer interrupt in 100 nS units.\r
-\r
-  @param GenerateSoftInterrupt\r
-  Generates a soft timer interrupt that simulates the firing of \r
-  the timer interrupt. This service can be used to invoke the \r
-  registered handler if the timer interrupt has been masked for \r
-  a period of time.\r
-\r
-**/\r
-EFI_TIMER_ARCH_PROTOCOL   gTimer = {\r
-  TimerDriverRegisterHandler,\r
-  TimerDriverSetTimerPeriod,\r
-  TimerDriverGetTimerPeriod,\r
-  TimerDriverGenerateSoftInterrupt\r
-};\r
-\r
-EFI_HANDLE  gTimerHandle = NULL;\r
-\r
-\r
-/**\r
-  Initialize the state information for the Timer Architectural Protocol\r
-\r
-  @param  ImageHandle   of the loaded driver\r
-  @param  SystemTable   Pointer to the System Table\r
-\r
-  @retval EFI_SUCCESS           Protocol registered\r
-  @retval EFI_OUT_OF_RESOURCES  Cannot allocate protocol data structure\r
-  @retval EFI_DEVICE_ERROR      Hardware problems\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-TimerInitialize (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-       //\r
-       // Find the interrupt controller protocol.  ASSERT if not found.\r
-       //\r
-       Status = gBS->LocateProtocol (&gHardwareInterruptProtocolGuid, NULL, ( VOID ** )&gInterrupt);\r
-       ASSERT_EFI_ERROR (Status);\r
-\r
-  MmioWrite32 (TIMER_CMD, 0x01);\r
-\r
-  //\r
-  // Force the timer to be disabled\r
-  //\r
-  Status = TimerDriverSetTimerPeriod (&gTimer, 0);\r
-       ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Install interrupt handler\r
-  //\r
-  Status = gInterrupt->RegisterInterruptSource (gInterrupt,  FixedPcdGet32 (PcdTimerVector), TimerInterruptHandler);\r
-       ASSERT_EFI_ERROR (Status);\r
-\r
-       //\r
-       // Force the timer to be enabled at its default period\r
-       //\r
-       Status = TimerDriverSetTimerPeriod (&gTimer, FixedPcdGet32 (PcdTimerPeriod));\r
-       ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  //\r
-  // Install the Timer Architectural Protocol onto a new handle\r
-  //\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &gTimerHandle,\r
-                  &gEfiTimerArchProtocolGuid,  &gTimer,\r
-                  NULL\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
-\r