1 /***************************************************************************//**
2 * \file startup_cat1b.h
3 * \version 1.1
4 *
5 * \brief Common startup header file for CAT1B devices. This file provides
6 * declarations for secure and non-secure vector table.
7 *
8 ********************************************************************************
9 * \copyright
10 * Copyright 2016-2021 Cypress Semiconductor Corporation
11 * SPDX-License-Identifier: Apache-2.0
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 *     http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *******************************************************************************/
25 
26 
27 #ifndef STARTUP_CAT1B_H_
28 #define STARTUP_CAT1B_H_
29 
30 #include "cy_device_headers.h"
31 
32 
33 typedef void (* cy_israddress_cat1b)(void);   /**< Type of ISR callbacks */
34 
35 #define CM33_FIXED_EXP_NR       (15u)
36 #define VECTORTABLE_SIZE        (MXCM33_SYSTEM_INT_NR + CM33_FIXED_EXP_NR + 1u) /* +1 is for Stack pointer */
37 #define VECTORTABLE_ALIGN       (VECTORTABLE_SIZE <= 512u ? 512u :1024u) /* alignment for 'n' entries is (nx4) */
38 
39 #if defined(__ARMCC_VERSION)
40 #if defined(CY_PDL_TZ_ENABLED)
41     extern cy_israddress_cat1b __s_vector_table_rw[VECTORTABLE_SIZE] __attribute__( ( section(".bss.noinit.RESET_RAM"))) __attribute__((aligned(VECTORTABLE_ALIGN)));
42 #else
43     extern cy_israddress_cat1b __ns_vector_table_rw[VECTORTABLE_SIZE] __attribute__( ( section(".bss.noinit.RESET_RAM"))) __attribute__((aligned(VECTORTABLE_ALIGN)));
44 #endif
45 #elif defined (__GNUC__)
46 #if defined(CY_PDL_TZ_ENABLED)
47     extern cy_israddress_cat1b __s_vector_table_rw[VECTORTABLE_SIZE] __attribute__( ( section(".ram_vectors"))) __attribute__((aligned(VECTORTABLE_ALIGN)));
48 #else
49     extern cy_israddress_cat1b __ns_vector_table_rw[VECTORTABLE_SIZE] __attribute__( ( section(".ram_vectors"))) __attribute__((aligned(VECTORTABLE_ALIGN)));
50 #endif
51 #elif defined (__ICCARM__)
52 #if defined(CY_PDL_TZ_ENABLED)
53     extern cy_israddress_cat1b __s_vector_table_rw[VECTORTABLE_SIZE]  __attribute__( ( section(".intvec_ram"))) __attribute__((aligned(VECTORTABLE_ALIGN)));
54 #else
55     extern cy_israddress_cat1b __ns_vector_table_rw[VECTORTABLE_SIZE] __attribute__( ( section(".intvec_ram"))) __attribute__((aligned(VECTORTABLE_ALIGN)));
56 #endif
57 #else
58     #error "An unsupported toolchain"
59 #endif  /* (__ARMCC_VERSION) */
60 
61 #endif /* STARTUP_CAT1B_H_ */
62