]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BeagleBoardPkg/Sec/Arm/ModuleEntryPoint.S
Update remaining ARM .S files with INTERWORK_FUNC macro. This is the 2nd half of...
[mirror_edk2.git] / BeagleBoardPkg / Sec / Arm / ModuleEntryPoint.S
index 882aed469c964df410590a05e163f850af6e3599..c8deed83b476df5697c863dc69598f2892afd044 100644 (file)
@@ -1,8 +1,8 @@
 #------------------------------------------------------------------------------ \r
 #\r
-# Copyright (c) 2008-2009 Apple Inc. All rights reserved.\r
+# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 #\r
-# All rights reserved. This program and the accompanying materials\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
@@ -20,6 +20,7 @@
 \r
 .globl ASM_PFX(CEntryPoint)\r
 .globl ASM_PFX(_ModuleEntryPoint)\r
+INTERWORK_FUNC(_ModuleEntryPoint)
 \r
 ASM_PFX(_ModuleEntryPoint):\r
 \r
@@ -35,11 +36,30 @@ ASM_PFX(_ModuleEntryPoint):
   orr     r0, r0, #0x00000002     /* set bit 1 (A) Align */\r
   orr     r0, r0, #0x00001000     /* set bit 12 (I) enable I-Cache */\r
   mcr     p15, 0, r0, c1, c0, 0\r
+\r
+  // Enable NEON register in case folks want to use them for optimizations (CopyMem)\r
+  mrc     p15, 0, r0, c1, c0, 2\r
+  orr     r0, r0, #0x00f00000   // Enable VPF access (V* instructions)\r
+  mcr     p15, 0, r0, c1, c0, 2\r
+  mov     r0, #0x40000000       // Set EN bit in FPEXC\r
+  mcr     p10,#0x7,r0,c8,c0,#0  // msr     FPEXC,r0 in ARM assembly\r
+   \r
  \r
   // Set CPU vectors to start of DRAM\r
-  mov     r0, #0x80000000\r
+  LoadConstantToReg (FixedPcdGet32(PcdCpuVectorBaseAddress) ,r0) // Get vector base\r
   mcr     p15, 0, r0, c12, c0, 0\r
-  /* before we call C code, lets setup the stack pointer in internal RAM*/\r
+  isb                               // Sync changes to control registers\r
+\r
+  // Fill vector table with branchs to current pc (jmp $)\r
+  ldr     r1, ShouldNeverGetHere\r
+  movs    r2, #0\r
+FillVectors:\r
+  str     r1, [r0, r2]\r
+  adds    r2, r2, #4\r
+  cmp     r2, #32\r
+  bne     FillVectors\r
+   \r
+  /* before we call C code, lets setup the stack pointer in internal RAM */\r
 stack_pointer_setup:\r
 \r
   //\r