ArmPkg: Move ArmSmcLib from ArmPlatformLib to ArmPkg
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 6 Mar 2013 00:01:49 +0000 (00:01 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 6 Mar 2013 00:01:49 +0000 (00:01 +0000)
A ArmSmcLib Null implementation has also been added for CPU without the ARM Security
Extension (Trustzone support).

Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14164 6f19259b-4bc3-4df7-8a09-765794883524

16 files changed:
ArmPkg/ArmPkg.dsc
ArmPkg/Include/Library/ArmSmcLib.h [new file with mode: 0644]
ArmPkg/Library/ArmSmcLib/Arm/ArmSmc.S [new file with mode: 0644]
ArmPkg/Library/ArmSmcLib/Arm/ArmSmc.asm [new file with mode: 0644]
ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf [new file with mode: 0644]
ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.S [new file with mode: 0644]
ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.asm [new file with mode: 0644]
ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.inf [new file with mode: 0644]
ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb.dsc.inc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress.dsc.inc
ArmPlatformPkg/Include/Library/ArmSmcLib.h [deleted file]
ArmPlatformPkg/Library/ArmSmcLib/ArmSmc.S [deleted file]
ArmPlatformPkg/Library/ArmSmcLib/ArmSmc.asm [deleted file]
ArmPlatformPkg/Library/ArmSmcLib/ArmSmcLib.inf [deleted file]
BeagleBoardPkg/BeagleBoardPkg.dsc

index da55d60..1b8cff1 100644 (file)
@@ -63,6 +63,7 @@
 \r
   ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf\r
   CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf\r
+  ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
   ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
   DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
 \r
   ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf\r
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
 \r
+  ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
+  ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.inf\r
+\r
   ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
 \r
   ArmPkg/Application/LinuxLoader/LinuxAtagLoader.inf\r
diff --git a/ArmPkg/Include/Library/ArmSmcLib.h b/ArmPkg/Include/Library/ArmSmcLib.h
new file mode 100644 (file)
index 0000000..ff946f2
--- /dev/null
@@ -0,0 +1,44 @@
+/** @file\r
+*\r
+*  Copyright (c) 2012, ARM Limited. All rights reserved.\r
+*\r
+*  This program and the accompanying materials\r
+*  are licensed and made available under the terms and conditions of the BSD License\r
+*  which accompanies this distribution.  The full text of the license may be found at\r
+*  http://opensource.org/licenses/bsd-license.php\r
+*\r
+*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+*\r
+**/\r
+\r
+#ifndef __ARM_SMC_LIB__\r
+#define __ARM_SMC_LIB__\r
+\r
+VOID\r
+ArmCallSmc (\r
+  IN OUT UINTN *Rx\r
+  );\r
+\r
+VOID\r
+ArmCallSmcArg1 (\r
+  IN OUT UINTN *Rx,\r
+  IN OUT UINTN *Arg1\r
+  );\r
+\r
+VOID\r
+ArmCallSmcArg2 (\r
+  IN OUT UINTN *Rx,\r
+  IN OUT UINTN *Arg1,\r
+  IN OUT UINTN *Arg2\r
+  );\r
+\r
+VOID\r
+ArmCallSmcArg3 (\r
+  IN OUT UINTN *Rx,\r
+  IN OUT UINTN *Arg1,\r
+  IN OUT UINTN *Arg2,\r
+  IN OUT UINTN *Arg3\r
+  );\r
+\r
+#endif\r
diff --git a/ArmPkg/Library/ArmSmcLib/Arm/ArmSmc.S b/ArmPkg/Library/ArmSmcLib/Arm/ArmSmc.S
new file mode 100644 (file)
index 0000000..c9c0740
--- /dev/null
@@ -0,0 +1,75 @@
+//\r
+//  Copyright (c) 2012, ARM Limited. All rights reserved.\r
+//\r
+//  This program and the accompanying materials\r
+//  are licensed and made available under the terms and conditions of the BSD License\r
+//  which accompanies this distribution.  The full text of the license may be found at\r
+//  http://opensource.org/licenses/bsd-license.php\r
+//\r
+//  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+//  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+//\r
+//\r
+\r
+.text\r
+.align 3\r
+.arch_extension sec\r
+\r
+GCC_ASM_EXPORT(ArmCallSmc)\r
+GCC_ASM_EXPORT(ArmCallSmcArg1)\r
+GCC_ASM_EXPORT(ArmCallSmcArg2)\r
+GCC_ASM_EXPORT(ArmCallSmcArg3)\r
+\r
+ASM_PFX(ArmCallSmc):\r
+    push    {r1}\r
+    mov     r1, r0\r
+    ldr     r0,[r1]\r
+    smc     #0\r
+    str     r0,[r1]\r
+    pop     {r1}\r
+    bx      lr\r
+\r
+ASM_PFX(ArmCallSmcArg1):\r
+    push    {r2-r3}\r
+    mov     r2, r0\r
+    mov     r3, r1\r
+    ldr     r0,[r2]\r
+    ldr     r1,[r3]\r
+    smc     #0\r
+    str     r0,[r2]\r
+    str     r1,[r3]\r
+    pop     {r2-r3}\r
+    bx      lr\r
+\r
+ASM_PFX(ArmCallSmcArg2):\r
+    push    {r3-r5}\r
+    mov     r3, r0\r
+    mov     r4, r1\r
+    mov     r5, r2\r
+    ldr     r0,[r3]\r
+    ldr     r1,[r4]\r
+    ldr     r2,[r5]\r
+    smc     #0\r
+    str     r0,[r3]\r
+    str     r1,[r4]\r
+    str     r2,[r5]\r
+    pop     {r3-r5}\r
+    bx      lr\r
+\r
+ASM_PFX(ArmCallSmcArg3):\r
+    push    {r4-r7}\r
+    mov     r4, r0\r
+    mov     r5, r1\r
+    mov     r6, r2\r
+    mov     r7, r3\r
+    ldr     r0,[r4]\r
+    ldr     r1,[r5]\r
+    ldr     r2,[r6]\r
+    ldr     r3,[r7]\r
+    smc     #0\r
+    str     r0,[r4]\r
+    str     r1,[r5]\r
+    str     r2,[r6]\r
+    str     r3,[r7]\r
+    pop     {r4-r7}\r
+    bx      lr\r
diff --git a/ArmPkg/Library/ArmSmcLib/Arm/ArmSmc.asm b/ArmPkg/Library/ArmSmcLib/Arm/ArmSmc.asm
new file mode 100644 (file)
index 0000000..f46bd7e
--- /dev/null
@@ -0,0 +1,75 @@
+//\r
+//  Copyright (c) 2012, ARM Limited. All rights reserved.\r
+//\r
+//  This program and the accompanying materials\r
+//  are licensed and made available under the terms and conditions of the BSD License\r
+//  which accompanies this distribution.  The full text of the license may be found at\r
+//  http://opensource.org/licenses/bsd-license.php\r
+//\r
+//  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+//  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+//\r
+//\r
+\r
+    EXPORT ArmCallSmc\r
+    EXPORT ArmCallSmcArg1\r
+    EXPORT ArmCallSmcArg2\r
+    EXPORT ArmCallSmcArg3\r
+\r
+    AREA   ArmSmc, CODE, READONLY\r
+\r
+ArmCallSmc\r
+    push    {r1}\r
+    mov     r1, r0\r
+    ldr     r0,[r1]\r
+    smc     #0\r
+    str     r0,[r1]\r
+    pop     {r1}\r
+    bx      lr\r
+\r
+ArmCallSmcArg1\r
+    push    {r2-r3}\r
+    mov     r2, r0\r
+    mov     r3, r1\r
+    ldr     r0,[r2]\r
+    ldr     r1,[r3]\r
+    smc     #0\r
+    str     r0,[r2]\r
+    str     r1,[r3]\r
+    pop     {r2-r3}\r
+    bx      lr\r
+\r
+ArmCallSmcArg2\r
+    push    {r3-r5}\r
+    mov     r3, r0\r
+    mov     r4, r1\r
+    mov     r5, r2\r
+    ldr     r0,[r3]\r
+    ldr     r1,[r4]\r
+    ldr     r2,[r5]\r
+    smc     #0\r
+    str     r0,[r3]\r
+    str     r1,[r4]\r
+    str     r2,[r5]\r
+    pop     {r3-r5}\r
+    bx      lr\r
+\r
+ArmCallSmcArg3\r
+    push    {r4-r7}\r
+    mov     r4, r0\r
+    mov     r5, r1\r
+    mov     r6, r2\r
+    mov     r7, r3\r
+    ldr     r0,[r4]\r
+    ldr     r1,[r5]\r
+    ldr     r2,[r6]\r
+    ldr     r3,[r7]\r
+    smc     #0\r
+    str     r0,[r4]\r
+    str     r1,[r5]\r
+    str     r2,[r6]\r
+    str     r3,[r7]\r
+    pop     {r4-r7}\r
+    bx      lr\r
+\r
+    END\r
diff --git a/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf b/ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
new file mode 100644 (file)
index 0000000..a3e12d2
--- /dev/null
@@ -0,0 +1,28 @@
+#/** @file\r
+#  \r
+#  Copyright (c) 2012-2013, ARM Ltd. All rights reserved.<BR>\r
+#  This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution.  The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#  \r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#  \r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = ArmSmcLib\r
+  FILE_GUID                      = eb3f17d5-a3cc-4eac-8912-84162d0f79da \r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = ArmSmcLib\r
+  \r
+[Sources.ARM]\r
+  Arm/ArmSmc.asm    | RVCT\r
+  Arm/ArmSmc.S      | GCC\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  ArmPkg/ArmPkg.dec\r
diff --git a/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.S b/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.S
new file mode 100644 (file)
index 0000000..4896dd0
--- /dev/null
@@ -0,0 +1,33 @@
+//\r
+//  Copyright (c) 2012-2013, ARM Limited. All rights reserved.\r
+//\r
+//  This program and the accompanying materials\r
+//  are licensed and made available under the terms and conditions of the BSD License\r
+//  which accompanies this distribution.  The full text of the license may be found at\r
+//  http://opensource.org/licenses/bsd-license.php\r
+//\r
+//  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+//  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+//\r
+//\r
+\r
+.text\r
+.align 3\r
+\r
+GCC_ASM_EXPORT(ArmCallSmc)\r
+GCC_ASM_EXPORT(ArmCallSmcArg1)\r
+GCC_ASM_EXPORT(ArmCallSmcArg2)\r
+GCC_ASM_EXPORT(ArmCallSmcArg3)\r
+\r
+ASM_PFX(ArmCallSmc):\r
+  bx     lr\r
+\r
+// Arg1 in R1\r
+ASM_PFX(ArmCallSmcArg1):\r
+  bx     lr\r
+\r
+ASM_PFX(ArmCallSmcArg2):\r
+  bx     lr\r
+\r
+ASM_PFX(ArmCallSmcArg3):\r
+  bx     lr\r
diff --git a/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.asm b/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.asm
new file mode 100644 (file)
index 0000000..24c2075
--- /dev/null
@@ -0,0 +1,34 @@
+//\r
+//  Copyright (c) 2012-2013, ARM Limited. All rights reserved.\r
+//\r
+//  This program and the accompanying materials\r
+//  are licensed and made available under the terms and conditions of the BSD License\r
+//  which accompanies this distribution.  The full text of the license may be found at\r
+//  http://opensource.org/licenses/bsd-license.php\r
+//\r
+//  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+//  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+//\r
+//\r
+\r
+    EXPORT ArmCallSmc\r
+    EXPORT ArmCallSmcArg1\r
+    EXPORT ArmCallSmcArg2\r
+    EXPORT ArmCallSmcArg3\r
+\r
+    AREA   ArmSmc, CODE, READONLY\r
+\r
+ArmCallSmc\r
+  bx     lr\r
+\r
+// Arg1 in R1\r
+ArmCallSmcArg1\r
+  bx     lr\r
+\r
+ArmCallSmcArg2\r
+  bx     lr\r
+\r
+ArmCallSmcArg3\r
+  bx     lr\r
+\r
+  END\r
diff --git a/ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.inf b/ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.inf
new file mode 100644 (file)
index 0000000..fed6e95
--- /dev/null
@@ -0,0 +1,31 @@
+#/** @file\r
+#  \r
+#  ArmSmcLib when no SMC support is desired (might be the case for CPU without the\r
+#  Trustzone support / ARM Security Extension)\r
+#\r
+#  Copyright (c) 2012-2013, ARM Ltd. All rights reserved.<BR>\r
+#  This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution.  The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#  \r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = ArmSmcLibNull\r
+  FILE_GUID                      = 140e8004-16e1-4de1-a352-c6ef51110ecf\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = ArmSmcLib\r
+  \r
+[Sources.ARM]\r
+  Arm/ArmSmcNull.asm    | RVCT\r
+  Arm/ArmSmcNull.S      | GCC\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  ArmPkg/ArmPkg.dec\r
index 385d296..52b324c 100644 (file)
@@ -61,6 +61,7 @@
   ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
   DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
   ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf\r
+  ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
 \r
   # RealView Emulation Board Specific Libraries\r
   EfiResetSystemLib|ArmPlatformPkg/ArmRealViewEbPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
index 38101df..17aba33 100644 (file)
@@ -45,7 +45,7 @@
   LcdPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf\r
   \r
   TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf \r
-  ArmSmcLib|ArmPlatformPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
+  ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
 \r
 [BuildOptions]\r
 !ifdef $(ARM_BIGLITTLE_TC2)\r
index 8672993..bbd00fd 100644 (file)
@@ -62,6 +62,7 @@
   DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
   ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf\r
   ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf\r
+  ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
 \r
   # Versatile Express Specific Libraries\r
   ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf\r
diff --git a/ArmPlatformPkg/Include/Library/ArmSmcLib.h b/ArmPlatformPkg/Include/Library/ArmSmcLib.h
deleted file mode 100644 (file)
index ff946f2..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/** @file\r
-*\r
-*  Copyright (c) 2012, ARM Limited. All rights reserved.\r
-*\r
-*  This program and the accompanying materials\r
-*  are licensed and made available under the terms and conditions of the BSD License\r
-*  which accompanies this distribution.  The full text of the license may be found at\r
-*  http://opensource.org/licenses/bsd-license.php\r
-*\r
-*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-*\r
-**/\r
-\r
-#ifndef __ARM_SMC_LIB__\r
-#define __ARM_SMC_LIB__\r
-\r
-VOID\r
-ArmCallSmc (\r
-  IN OUT UINTN *Rx\r
-  );\r
-\r
-VOID\r
-ArmCallSmcArg1 (\r
-  IN OUT UINTN *Rx,\r
-  IN OUT UINTN *Arg1\r
-  );\r
-\r
-VOID\r
-ArmCallSmcArg2 (\r
-  IN OUT UINTN *Rx,\r
-  IN OUT UINTN *Arg1,\r
-  IN OUT UINTN *Arg2\r
-  );\r
-\r
-VOID\r
-ArmCallSmcArg3 (\r
-  IN OUT UINTN *Rx,\r
-  IN OUT UINTN *Arg1,\r
-  IN OUT UINTN *Arg2,\r
-  IN OUT UINTN *Arg3\r
-  );\r
-\r
-#endif\r
diff --git a/ArmPlatformPkg/Library/ArmSmcLib/ArmSmc.S b/ArmPlatformPkg/Library/ArmSmcLib/ArmSmc.S
deleted file mode 100644 (file)
index 13f51a9..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-//\r
-//  Copyright (c) 2012, ARM Limited. All rights reserved.\r
-//\r
-//  This program and the accompanying materials\r
-//  are licensed and made available under the terms and conditions of the BSD License\r
-//  which accompanies this distribution.  The full text of the license may be found at\r
-//  http://opensource.org/licenses/bsd-license.php\r
-//\r
-//  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-//  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-//\r
-//\r
-\r
-.text\r
-.align 3\r
-.arch_extension sec\r
-\r
-GCC_ASM_EXPORT(ArmCallSmc)\r
-GCC_ASM_EXPORT(ArmCallSmcArg1)\r
-GCC_ASM_EXPORT(ArmCallSmcArg2)\r
-GCC_ASM_EXPORT(ArmCallSmcArg3)\r
-\r
-ASM_PFX(ArmCallSmc):\r
-    push    {r1}\r
-    mov     r1, r0\r
-    ldr     r0,[r1]\r
-    smc     #0\r
-    str     r0,[r1]\r
-    pop     {r1}\r
-    blx     lr\r
-\r
-// Arg1 in R1\r
-ASM_PFX(ArmCallSmcArg1):\r
-    push    {r2-r3}\r
-    mov     r2, r0\r
-    mov     r3, r1\r
-    ldr     r0,[r2]\r
-    ldr     r1,[r3]\r
-    smc     #0\r
-    str     r0,[r2]\r
-    str     r1,[r3]\r
-    pop     {r2-r3}\r
-    blx     lr\r
-\r
-ASM_PFX(ArmCallSmcArg2):\r
-    push    {r3-r5}\r
-    mov     r3, r0\r
-    mov     r4, r1\r
-    mov     r5, r2\r
-    ldr     r0,[r3]\r
-    ldr     r1,[r4]\r
-    ldr     r2,[r5]\r
-    smc     #0\r
-    str     r0,[r3]\r
-    str     r1,[r4]\r
-    str     r2,[r5]\r
-    pop     {r3-r5}\r
-    blx     lr\r
-\r
-ASM_PFX(ArmCallSmcArg3):\r
-    push    {r4-r7}\r
-    mov     r4, r0\r
-    mov     r5, r1\r
-    mov     r6, r2\r
-    mov     r7, r3\r
-    ldr     r0,[r4]\r
-    ldr     r1,[r5]\r
-    ldr     r2,[r6]\r
-    ldr     r3,[r7]\r
-    smc     #0\r
-    str     r0,[r4]\r
-    str     r1,[r5]\r
-    str     r2,[r6]\r
-    str     r3,[r7]\r
-    pop     {r4-r7}\r
-    blx     lr\r
diff --git a/ArmPlatformPkg/Library/ArmSmcLib/ArmSmc.asm b/ArmPlatformPkg/Library/ArmSmcLib/ArmSmc.asm
deleted file mode 100644 (file)
index 0efb177..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-//\r
-//  Copyright (c) 2012, ARM Limited. All rights reserved.\r
-//\r
-//  This program and the accompanying materials\r
-//  are licensed and made available under the terms and conditions of the BSD License\r
-//  which accompanies this distribution.  The full text of the license may be found at\r
-//  http://opensource.org/licenses/bsd-license.php\r
-//\r
-//  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-//  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-//\r
-//\r
-\r
-    EXPORT ArmCallSmc\r
-    EXPORT ArmCallSmcArg1\r
-    EXPORT ArmCallSmcArg2\r
-    EXPORT ArmCallSmcArg3\r
-\r
-    AREA   ArmSmc, CODE, READONLY\r
-\r
-ArmCallSmc\r
-    push    {r1}\r
-    mov     r1, r0\r
-    ldr     r0,[r1]\r
-    smc     #0\r
-    str     r0,[r1]\r
-    pop     {r1}\r
-    blx     lr\r
-\r
-// Arg1 in R1\r
-ArmCallSmcArg1\r
-    push    {r2-r3}\r
-    mov     r2, r0\r
-    mov     r3, r1\r
-    ldr     r0,[r2]\r
-    ldr     r1,[r3]\r
-    smc     #0\r
-    str     r0,[r2]\r
-    str     r1,[r3]\r
-    pop     {r2-r3}\r
-    blx     lr\r
-\r
-ArmCallSmcArg2\r
-    push    {r3-r5}\r
-    mov     r3, r0\r
-    mov     r4, r1\r
-    mov     r5, r2\r
-    ldr     r0,[r3]\r
-    ldr     r1,[r4]\r
-    ldr     r2,[r5]\r
-    smc     #0\r
-    str     r0,[r3]\r
-    str     r1,[r4]\r
-    str     r2,[r5]\r
-    pop     {r3-r5}\r
-    blx     lr\r
-\r
-ArmCallSmcArg3\r
-    push    {r4-r7}\r
-    mov     r4, r0\r
-    mov     r5, r1\r
-    mov     r6, r2\r
-    mov     r7, r3\r
-    ldr     r0,[r4]\r
-    ldr     r1,[r5]\r
-    ldr     r2,[r6]\r
-    ldr     r3,[r7]\r
-    smc     #0\r
-    str     r0,[r4]\r
-    str     r1,[r5]\r
-    str     r2,[r6]\r
-    str     r3,[r7]\r
-    pop     {r4-r7}\r
-    blx     lr\r
-\r
-    END\r
diff --git a/ArmPlatformPkg/Library/ArmSmcLib/ArmSmcLib.inf b/ArmPlatformPkg/Library/ArmSmcLib/ArmSmcLib.inf
deleted file mode 100644 (file)
index 5df2548..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#/** @file\r
-#  \r
-#  Copyright (c) 2012, ARM Ltd. All rights reserved.<BR>\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution.  The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  \r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#  \r
-#**/\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = ArmSmcLib\r
-  FILE_GUID                      = eb3f17d5-a3cc-4eac-8912-84162d0f79da \r
-  MODULE_TYPE                    = BASE\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = ArmSmcLib\r
-  \r
-[Sources.common]\r
-  ArmSmc.asm    | RVCT\r
-  ArmSmc.S      | GCC\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  ArmPlatformPkg/ArmPlatformPkg.dec\r
index c4e922c..0ae8150 100644 (file)
@@ -35,6 +35,7 @@
   ArmPlatformLib|BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf\r
   ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA8Lib/ArmCortexA8Lib.inf\r
   ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf\r
+  ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
   \r
   HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
   UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r