2014-08-19 15:29:52 +02:00
|
|
|
#------------------------------------------------------------------------------
|
2011-09-27 18:31:20 +02:00
|
|
|
#
|
|
|
|
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
2013-08-06 12:59:19 +02:00
|
|
|
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.
|
2016-08-10 14:35:01 +02:00
|
|
|
# Copyright (c) 2016, Linaro Limited. All rights reserved.
|
2011-09-27 18:31:20 +02:00
|
|
|
#
|
2019-04-04 01:03:18 +02:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
2011-09-27 18:31:20 +02:00
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include <AsmMacroIoLib.h>
|
|
|
|
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(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
|
|
|
|
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(ArmEnableAsynchronousAbort)
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsie a
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(ArmDisableAsynchronousAbort)
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsid a
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(ArmEnableIrq)
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsie i
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(ArmDisableIrq)
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsid i
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(ArmEnableFiq)
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsie f
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(ArmDisableFiq)
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsid f
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(ArmEnableInterrupts)
|
2011-09-27 18:31:20 +02:00
|
|
|
cpsie if
|
|
|
|
isb
|
|
|
|
bx LR
|
|
|
|
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(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
|
|
|
// )
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(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
|
|
|
// )
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(ReadCLIDR)
|
2011-09-27 18:31:20 +02:00
|
|
|
mrc p15,1,r0,c0,c0,1 @ Read CP15 Cache Level ID Register
|
|
|
|
bx lr
|
|
|
|
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(ArmReadNsacr)
|
2013-08-06 12:59:19 +02:00
|
|
|
mrc p15, 0, r0, c1, c1, 2
|
|
|
|
bx lr
|
|
|
|
|
2016-08-10 14:35:01 +02:00
|
|
|
ASM_FUNC(ArmWriteNsacr)
|
2013-08-06 12:59:19 +02:00
|
|
|
mcr p15, 0, r0, c1, c1, 2
|
|
|
|
bx lr
|
|
|
|
|
2011-09-27 18:31:20 +02:00
|
|
|
ASM_FUNCTION_REMOVE_IF_UNREFERENCED
|