// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
// Copyright (c) 2011 - 2016, 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
+// SPDX-License-Identifier: BSD-2-Clause-Patent\r
//\r
//------------------------------------------------------------------------------\r
\r
mrc p15, 0, r0, c1, c0, 0 // Read SCTLR into R0 (Read control register configuration data)\r
bx lr\r
\r
+ RVCT_ASM_EXPORT ArmWriteSctlr\r
+ mcr p15, 0, r0, c1, c0, 0\r
+ bx lr\r
\r
RVCT_ASM_EXPORT ArmReadCpuActlr\r
mrc p15, 0, r0, c1, c0, 1\r
isb\r
bx lr\r
\r
+ RVCT_ASM_EXPORT ArmGetPhysicalAddressBits\r
+ mrc p15, 0, r0, c0, c1, 4 ; MMFR0\r
+ and r0, r0, #0xf ; VMSA [3:0]\r
+ cmp r0, #5 ; >= 5 implies LPAE support\r
+ movlt r0, #32 ; 32 bits if no LPAE\r
+ movge r0, #40 ; 40 bits if LPAE\r
+ bx lr\r
+\r
END\r