VSF Documented
freertos_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 __RTOS_MODEL_H__
19#define __RTOS_MODEL_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "hal/vsf_hal_cfg.h"
24
25#if defined(__VSF_ARCH_RTOS_MODEL_IMPLEMENT)
26# define __VSF_CLASS_IMPLEMENT__
27#endif
28
29#include "utilities/ooc_class.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/*============================ MACROS ========================================*/
36
37#ifndef VSF_SYSTIMER_CFG_IMPL_MODE
38# define VSF_SYSTIMER_CFG_IMPL_MODE VSF_SYSTIMER_IMPL_REQUEST_RESPONSE
39#endif
40
41// TODO: real priority number is configMAX_PRIORITIES from freertos configuration
42// but freertos headers are not available here to avoid namespace pollution
43//#define VSF_ARCH_RTOS_PRIORITY_NUM configMAX_PRIORITIES
44#define VSF_ARCH_RTOS_PRIORITY_NUM 4
45
46// TODO: real stack type is StackType_t from freertos configuration
47// but freertos headers are not available here to avoid namespace pollution
48//#define VSF_ARCH_RTOS_STACK_T StackType_t
49#define VSF_ARCH_RTOS_STACK_T uint32_t
50
51#define VSF_ARCH_IRQ_SUPPORT_STACK
52
53/*============================ MACROFIED FUNCTIONS ===========================*/
54/*============================ TYPES =========================================*/
55
56// TODO: real tick type is TickType_t from freertos configuration
57// but freertos headers are not available here to avoid namespace pollution
58//typedef TickType_t vsf_systimer_tick_t;
60typedef bool vsf_gint_state_t;
61
63 private_member(
64 // should be EventGroupHandle_t event, but avoid to expose header(s) of host os
65 void *event;
66 bool is_auto_reset;
67 bool is_set_pending;
68 )
69};
70
72 private_member(
73 // should be TaskHandle_t thread, but avoid to expose header(s) of host os
74 void *thread_handle;
75
76 struct {
77 const char *name;
79 vsf_arch_prio_t priority;
81 uint_fast32_t stack_depth;
82 } thread_param;
83 )
84};
85
86/*============================ GLOBAL VARIABLES ==============================*/
87/*============================ LOCAL VARIABLES ===============================*/
88/*============================ PROTOTYPES ====================================*/
89
90extern void vsf_freertos_start(void);
91
92extern bool __vsf_arch_model_low_level_init(void);
93
94#if VSF_ARCH_RTOS_CFG_MODE == VSF_ARCH_RTOS_MODE_SUSPEND_RESUME
96#endif
97
98#ifdef __cplusplus
99}
100#endif
101
102#endif
103/* EOF */
Definition linux_generic.h:104
Definition linux_generic.h:122
vsf_arch_prio_t
Definition cortex_a_generic.h:88
uint32_t vsf_systimer_tick_t
Definition freertos_generic.h:59
vsf_arch_prio_t __vsf_arch_get_current_priority(void)
Definition freertos_generic.c:316
void vsf_freertos_start(void)
Definition freertos_generic.c:426
#define VSF_ARCH_RTOS_STACK_T
Definition freertos_generic.h:49
bool vsf_gint_state_t
Definition freertos_generic.h:60
bool __vsf_arch_model_low_level_init(void)
Definition freertos_generic.c:304
#define vsf_class(__name)
Definition ooc_class.h:48
void(* vsf_arch_irq_thread_entry_t)(void *)
Definition rtos_generic.h:82
unsigned uint32_t
Definition stdint.h:9
unsigned int uint_fast32_t
Definition stdint.h:27