HiKeyHelper.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #
  2. # Copyright (c) 2014-2017, Linaro Limited. All rights reserved.
  3. #
  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. #
  9. # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  10. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  11. #
  12. #
  13. #include <AsmMacroIoLibV8.h>
  14. #include <Library/ArmLib.h>
  15. ASM_FUNC(ArmPlatformPeiBootAction)
  16. ret
  17. //UINTN
  18. //ArmPlatformGetCorePosition (
  19. // IN UINTN MpId
  20. // );
  21. // With this function: CorePos = (ClusterId * 4) + CoreId
  22. ASM_FUNC(ArmPlatformGetCorePosition)
  23. and x1, x0, #ARM_CORE_MASK
  24. and x0, x0, #ARM_CLUSTER_MASK
  25. add x0, x1, x0, LSR #6
  26. ret
  27. //UINTN
  28. //ArmPlatformGetPrimaryCoreMpId (
  29. // VOID
  30. // );
  31. ASM_FUNC(ArmPlatformGetPrimaryCoreMpId)
  32. MOV32 (w0, FixedPcdGet32(PcdArmPrimaryCore))
  33. ret
  34. //UINTN
  35. //ArmPlatformIsPrimaryCore (
  36. // IN UINTN MpId
  37. // );
  38. ASM_FUNC(ArmPlatformIsPrimaryCore)
  39. MOV32 (w1, FixedPcdGet32(PcdArmPrimaryCoreMask))
  40. and x0, x0, x1
  41. MOV32 (w1, FixedPcdGet32(PcdArmPrimaryCore))
  42. cmp w0, w1
  43. cset x0, eq
  44. ret