VSF Documented
cortex_a_generic.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __CORTEX_A_GENERIC_H__
19#define __CORTEX_A_GENERIC_H__
20
21/*============================ INCLUDES ======================================*/
22#include "hal/vsf_hal_cfg.h"
23
24#define __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
25#include "hal/driver/driver.h"
26#undef __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31/*============================ MACROS ========================================*/
32
33#ifndef __LITTLE_ENDIAN
34# define __LITTLE_ENDIAN 1
35#endif
36#ifndef __BYTE_ORDER
37# define __BYTE_ORDER __LITTLE_ENDIAN
38#endif
39
40// TODO:
41#if __ARM_ARCH == 6 || __TARGET_ARCH_6_M == 1 || __TARGET_ARCH_6S_M == 1
42# ifndef VSF_ARCH_PRI_NUM
43# define VSF_ARCH_PRI_NUM 4
44# undef VSF_ARCH_PRI_BIT
45# define VSF_ARCH_PRI_BIT 2
46# endif
47
48# ifndef VSF_ARCH_PRI_BIT
49# define VSF_ARCH_PRI_BIT 2
50# endif
51#elif __ARM_ARCH >= 7 || __TARGET_ARCH_7_M == 1 || __TARGET_ARCH_7E_M == 1
52# ifndef VSF_ARCH_PRI_NUM
53# define VSF_ARCH_PRI_NUM 128
54# undef VSF_ARCH_PRI_BIT
55# define VSF_ARCH_PRI_BIT 7
56# endif
57
58# ifndef VSF_ARCH_PRI_BIT
59# define VSF_ARCH_PRI_BIT 7
60# endif
61#endif
62
63// software interrupt provided by arch
64#define VSF_ARCH_SWI_NUM 1
65#define __VSF_ARCH_SYSTIMER_BITS 24
66
67/*============================ MACROFIED FUNCTIONS ===========================*/
68
69#define vsf_arch_wakeup()
70
71/*============================ TYPES =========================================*/
72
74
75#define __VSF_ARCH_PRI_INDEX(__N, __UNUSED) \
76 __vsf_arch_prio_index_##__N = (__N),
77
78enum {
80};
81
82#define __VSF_ARCH_PRI(__N, __BIT) \
83 VSF_ARCH_PRIO_##__N = \
84 ((VSF_ARCH_PRI_NUM - 1 - __vsf_arch_prio_index_##__N)) & 0xFF, \
85 vsf_arch_prio_##__N = \
86 ((VSF_ARCH_PRI_NUM - 1 - __vsf_arch_prio_index_##__N)) & 0xFF,
87
88typedef enum vsf_arch_prio_t {
89 // avoid vsf_arch_prio_t to be optimized to 8bit
94
97
98/*============================ GLOBAL VARIABLES ==============================*/
99/*============================ LOCAL VARIABLES ===============================*/
100/*============================ PROTOTYPES ====================================*/
101
102static VSF_CAL_ALWAYS_INLINE void vsf_arch_set_stack(uint32_t stack)
103{
104 VSF_HAL_ASSERT(false);
105}
106
107#ifdef __cplusplus
108}
109#endif
110
111#endif
112/* EOF */
113
#define VSF_ARCH_PRI_NUM
Definition arm9_generic.h:46
vsf_arch_prio_t
Definition cortex_a_generic.h:88
@ __VSF_ARCH_PRIO_LEAST_MAX
Definition cortex_a_generic.h:90
@ __VSF_ARCH_PRIO_LEAST_MIN
Definition cortex_a_generic.h:91
@ VSF_ARCH_PRIO_INVALID
Definition cortex_a_generic.h:92
@ vsf_arch_prio_invalid
Definition cortex_a_generic.h:93
#define __VSF_ARCH_PRI(__N, __BIT)
Definition cortex_a_generic.h:82
uint64_t vsf_systimer_tick_t
Definition cortex_a_generic.h:73
#define __VSF_ARCH_PRI_INDEX(__N, __UNUSED)
Definition cortex_a_generic.h:75
#define VSF_ARCH_PRI_BIT
Definition mcs51_generic.h:42
unsigned uint32_t
Definition stdint.h:9
unsigned long long uint64_t
Definition stdint.h:11
#define INT16_MAX
Definition stdint.h:50
#define INT16_MIN
Definition stdint.h:45
#define VSF_HAL_ASSERT(__CON)
all hal modules use this configuration file
Definition vsf_hal_cfg.h:36
#define VSF_MREPEAT(__COUNT, __MACRO, __PARAM)
Definition vsf_repeat_macro.h:51