1 /* 2 * Arm SCP/MCP Software 3 * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 #ifndef ARCH_HELPERS_H 9 #define ARCH_HELPERS_H 10 /* 11 * This variable is used to ensure spurious nested calls won't 12 * enable interrupts. This is been defined in fwk_test.c 13 */ 14 extern unsigned int critical_section_nest_level; 15 16 /*! 17 * \brief Enables global CPU interrupts. (stub) 18 * 19 */ arch_interrupts_enable(unsigned int not_used)20inline static void arch_interrupts_enable(unsigned int not_used) 21 { 22 /* Decrement critical_section_nest_level only if in critical section */ 23 if (critical_section_nest_level > 0) { 24 critical_section_nest_level--; 25 } 26 } 27 28 /*! 29 * \brief Disables global CPU interrupts. (stub) 30 * 31 */ arch_interrupts_disable(void)32inline static unsigned int arch_interrupts_disable(void) 33 { 34 critical_section_nest_level++; 35 36 return 0; 37 } 38 39 /*! 40 * \brief Suspend execution of current CPU. 41 * 42 */ arch_suspend(void)43inline static void arch_suspend(void) 44 { 45 } 46 47 #endif /* ARCH_HELPERS_H */ 48