2 * Copyright (C) 2022 ARM Limited or its affiliates. All rights reserved.
4 * SPDX-License-Identifier: Apache-2.0
6 * Licensed under the Apache License, Version 2.0 (the License); you may
7 * not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 #include "RTE_Components.h"
23 #include CMSIS_device_header
25 #ifdef RTE_Compiler_EventRecorder
26 #include "EventRecorder.h"
30 #include "CV_Report.h"
32 //lint -e970 allow using int for main
35 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
38 /* Dummy Non-secure callable (entry) function */
39 __attribute__((cmse_nonsecure_entry)) int validationDummy(int x) {
47 // System Initialization
48 SystemCoreClockUpdate();
50 #ifdef RTE_Compiler_EventRecorder
51 // Initialize and start Event Recorder
52 (void)EventRecorderInitialize(EventRecordError, 1U);
53 (void)EventRecorderEnable(EventRecordAll, 0xFEU, 0xFEU);
65 #if defined(__CORTEX_A)
68 #if (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || \
69 (defined ( __GNUC__ ))
70 #define __IRQ __attribute__((interrupt("IRQ")))
71 #elif defined ( __CC_ARM )
73 #elif defined ( __ICCARM__ )
74 #define __IRQ __irq __arm
76 #error "Unsupported compiler!"
81 void IRQ_Handler(void);
83 void IRQ_Handler(void) {
84 const IRQn_ID_t irqn = IRQ_GetActiveIRQ();
85 IRQHandler_t const handler = IRQ_GetHandler(irqn);
86 if (handler != NULL) {
91 IRQ_EndOfInterrupt(irqn);
95 void Undef_Handler (void);
97 void Undef_Handler (void) {
98 cmsis_cv_abort(__FILENAME__, __LINE__, "Undefined Instruction!");
103 void SVC_Handler (void);
105 void SVC_Handler (void) {
109 void PAbt_Handler (void);
111 void PAbt_Handler (void) {
112 cmsis_cv_abort(__FILENAME__, __LINE__, "Prefetch Abort!");
117 void DAbt_Handler (void);
119 void DAbt_Handler (void) {
120 cmsis_cv_abort(__FILENAME__, __LINE__, "Data Abort!");
125 void FIQ_Handler (void);
127 void FIQ_Handler (void) {
131 #if defined(__CORTEX_M)
133 void HardFault_Handler(void);
135 void HardFault_Handler(void) {
136 cmsis_cv_abort(__FILENAME__, __LINE__, "HardFault!");