Arm11Lib.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /** @file
  2. Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
  3. Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.
  4. This program and the accompanying materials
  5. are licensed and made available under the terms and conditions of the BSD License
  6. which accompanies this distribution. The full text of the license may be found at
  7. http://opensource.org/licenses/bsd-license.php
  8. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  10. **/
  11. #include <Chipset/ARM1176JZ-S.h>
  12. #include <Library/ArmLib.h>
  13. #include <Library/DebugLib.h>
  14. #include <Library/PcdLib.h>
  15. VOID
  16. EFIAPI
  17. ArmWriteVBar (
  18. IN UINTN VectorBase
  19. )
  20. {
  21. ASSERT(FeaturePcdGet (PcdRelocateVectorTable) == TRUE);
  22. if (VectorBase == 0x0) {
  23. ArmSetLowVectors ();
  24. } else if (VectorBase == 0xFFFF0000) {
  25. ArmSetHighVectors ();
  26. } else {
  27. // Feature not supported by ARM11. The Vector Table is either at 0x0 or 0xFFFF0000
  28. ASSERT(0);
  29. }
  30. }
  31. UINTN
  32. EFIAPI
  33. ArmReadVBar (
  34. VOID
  35. )
  36. {
  37. ASSERT((FeaturePcdGet (PcdRelocateVectorTable) == TRUE) && ((PcdGet32 (PcdCpuVectorBaseAddress) == 0x0) || (PcdGet32 (PcdCpuVectorBaseAddress) == 0xFFFF0000)));
  38. return PcdGet32 (PcdCpuVectorBaseAddress);
  39. }