Home | History | Annotate | Download | only in ArmVExpressLibCTA9x4
      1 //
      2 //  Copyright (c) 2013, ARM 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 
     14 #include <AsmMacroIoLib.h>
     15 #include <Library/ArmLib.h>
     16 
     17 #include <AutoGen.h>
     18 
     19   INCLUDE AsmMacroIoLib.inc
     20 
     21   EXPORT  ArmPlatformPeiBootAction
     22   EXPORT  ArmPlatformIsPrimaryCore
     23   EXPORT  ArmPlatformGetPrimaryCoreMpId
     24   EXPORT  ArmPlatformGetCorePosition
     25 
     26   IMPORT  _gPcd_FixedAtBuild_PcdArmPrimaryCore
     27   IMPORT  _gPcd_FixedAtBuild_PcdArmPrimaryCoreMask
     28 
     29   AREA CTA9x4Helper, CODE, READONLY
     30 
     31 //UINTN
     32 //ArmPlatformGetPrimaryCoreMpId (
     33 //  VOID
     34 //  );
     35 ArmPlatformGetPrimaryCoreMpId FUNCTION
     36   LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)
     37   ldr     r0, [r0]
     38   bx      lr
     39   ENDFUNC
     40 
     41 //UINTN
     42 //ArmPlatformIsPrimaryCore (
     43 //  IN UINTN MpId
     44 //  );
     45 ArmPlatformIsPrimaryCore FUNCTION
     46   LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r1)
     47   ldr   r1, [r1]
     48   and   r0, r0, r1
     49   LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r1)
     50   ldr   r1, [r1]
     51   cmp   r0, r1
     52   moveq r0, #1
     53   movne r0, #0
     54   bx    lr
     55   ENDFUNC
     56 
     57 //UINTN
     58 //ArmPlatformGetCorePosition (
     59 //  IN UINTN MpId
     60 //  );
     61 ArmPlatformGetCorePosition FUNCTION
     62   and   r0, r0, #ARM_CORE_MASK
     63   bx    lr
     64   ENDFUNC
     65 
     66 ArmPlatformPeiBootAction FUNCTION
     67   bx    lr
     68   ENDFUNC
     69 
     70   END
     71