2014-08-19 15:29:52 +02:00
|
|
|
//------------------------------------------------------------------------------
|
2011-09-27 18:31:20 +02:00
|
|
|
//
|
|
|
|
// Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
2013-08-06 12:59:19 +02:00
|
|
|
// Copyright (c) 2011-2013, ARM Limited. All rights reserved.
|
2011-09-27 18:31:20 +02:00
|
|
|
//
|
|
|
|
// This program and the accompanying materials
|
|
|
|
// are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
// which accompanies this distribution. The full text of the license may be found at
|
|
|
|
// http://opensource.org/licenses/bsd-license.php
|
|
|
|
//
|
|
|
|
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
|
|
|
|
INCLUDE AsmMacroExport.inc
|
2011-09-27 18:31:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ArmIsMpCore
|
2011-09-27 18:31:20 +02:00
|
|
|
mrc p15,0,R0,c0,c0,5
|
|
|
|
// Get Multiprocessing extension (bit31) & U bit (bit30)
|
|
|
|
and R0, R0, #0xC0000000
|
2014-08-20 19:57:34 +02:00
|
|
|
// if (bit31 == 1) && (bit30 == 0) then the processor is part of a multiprocessor system
|
|
|
|
cmp R0, #0x80000000
|
|
|
|
moveq R0, #1
|
|
|
|
movne R0, #0
|
2011-09-27 18:31:20 +02:00
|
|
|
bx LR
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ArmEnableAsynchronousAbort
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsie a
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ArmDisableAsynchronousAbort
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsid a
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ArmEnableIrq
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsie i
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ArmDisableIrq
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsid i
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ArmEnableFiq
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsie f
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ArmDisableFiq
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsid f
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ArmEnableInterrupts
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsie if
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ArmDisableInterrupts
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsid if
|
|
|
|
isb
|
|
|
|
bx LR
|
2014-08-19 15:29:52 +02:00
|
|
|
|
|
|
|
// UINT32
|
2011-09-27 18:31:20 +02:00
|
|
|
// ReadCCSIDR (
|
|
|
|
// IN UINT32 CSSELR
|
2014-08-19 15:29:52 +02:00
|
|
|
// )
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ReadCCSIDR
|
2011-09-27 18:31:20 +02:00
|
|
|
mcr p15,2,r0,c0,c0,0 ; Write Cache Size Selection Register (CSSELR)
|
|
|
|
isb
|
|
|
|
mrc p15,1,r0,c0,c0,0 ; Read current CP15 Cache Size ID Register (CCSIDR)
|
|
|
|
bx lr
|
2014-08-19 15:29:52 +02:00
|
|
|
|
|
|
|
// UINT32
|
2011-09-27 18:31:20 +02:00
|
|
|
// ReadCLIDR (
|
|
|
|
// IN UINT32 CSSELR
|
2014-08-19 15:29:52 +02:00
|
|
|
// )
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ReadCLIDR
|
2011-09-27 18:31:20 +02:00
|
|
|
mrc p15,1,r0,c0,c0,1 ; Read CP15 Cache Level ID Register
|
|
|
|
bx lr
|
2013-08-06 12:59:19 +02:00
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ArmReadNsacr
|
2013-08-06 12:59:19 +02:00
|
|
|
mrc p15, 0, r0, c1, c1, 2
|
|
|
|
bx lr
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT ArmWriteNsacr
|
2013-08-06 12:59:19 +02:00
|
|
|
mcr p15, 0, r0, c1, c1, 2
|
|
|
|
bx lr
|
|
|
|
|
2012-07-04 22:06:23 +02:00
|
|
|
END
|