-
Notifications
You must be signed in to change notification settings - Fork 204
/
cfe_es_global.h
175 lines (149 loc) · 4.27 KB
/
cfe_es_global.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*
** GSC-18128-1, "Core Flight Executive Version 6.7"
**
** Copyright (c) 2006-2019 United States Government as represented by
** the Administrator of the National Aeronautics and Space Administration.
** All Rights Reserved.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/*
** File:
** cfe_es_global.h
**
** Purpose:
** This file contains the ES global data definitions.
**
** References:
** Flight Software Branch C Coding Standard Version 1.0a
** cFE Flight Software Application Developers Guide
**
*/
#ifndef _cfe_es_global_
#define _cfe_es_global_
/*
** Includes:
*/
#include "osapi.h"
#include "private/cfe_private.h"
#include "private/cfe_es_resetdata_typedef.h"
#include "cfe_es.h"
#include "cfe_es_apps.h"
#include "cfe_es_cds.h"
#include "cfe_es_perf.h"
#include "cfe_es_generic_pool.h"
#include "cfe_es_mempool.h"
#include "cfe_es_cds_mempool.h"
#include "cfe_time.h"
#include "cfe_platform_cfg.h"
#include "cfe_evs.h"
#include "cfe_psp.h"
#include <signal.h>
/*
** Typedefs
*/
/*
** CFE_ES_GenCounterRecord_t is an internal structure used to keep track of
** Generic Counters that are active in the system.
*/
typedef struct
{
CFE_ES_CounterId_t CounterId; /**< The actual counter ID of this entry, or undefined */
uint32 Counter;
char CounterName[OS_MAX_API_NAME]; /* Counter Name */
} CFE_ES_GenCounterRecord_t;
/*
* Encapsulates the state of the ES background task
*/
typedef struct
{
CFE_ES_TaskId_t TaskID; /**< ES ID of the background task */
osal_id_t WorkSem; /**< Semaphore that is given whenever background work is pending */
uint32 NumJobsRunning; /**< Current Number of active jobs (updated by background task) */
} CFE_ES_BackgroundTaskState_t;
/*
** Executive Services Global Memory Data
** This is the regular global data that is not preserved on a
** processor reset.
*/
typedef struct
{
/*
** Debug Variables
*/
CFE_ES_DebugVariables_t DebugVars;
/*
** Shared Data Semaphore
*/
osal_id_t SharedDataMutex;
/*
** Performance Data Mutex
*/
osal_id_t PerfDataMutex;
/*
** Startup Sync
*/
volatile sig_atomic_t SystemState;
/*
** ES Task Table
*/
uint32 RegisteredTasks;
CFE_ES_TaskRecord_t TaskTable[OS_MAX_TASKS];
/*
** ES App Table
*/
uint32 RegisteredCoreApps;
uint32 RegisteredExternalApps;
CFE_ResourceId_t LastAppId;
CFE_ES_AppRecord_t AppTable[CFE_PLATFORM_ES_MAX_APPLICATIONS];
/*
** ES Shared Library Table
*/
uint32 RegisteredLibs;
CFE_ResourceId_t LastLibId;
CFE_ES_LibRecord_t LibTable[CFE_PLATFORM_ES_MAX_LIBRARIES];
/*
** ES Generic Counters Table
*/
CFE_ResourceId_t LastCounterId;
CFE_ES_GenCounterRecord_t CounterTable[CFE_PLATFORM_ES_MAX_GEN_COUNTERS];
/*
** Critical Data Store Management Variables
*/
CFE_ES_CDS_Instance_t CDSVars;
bool CDSIsAvailable; /**< \brief Whether or not the CDS service is active/valid */
/*
* Background task for handling long-running, non real time tasks
* such as maintenance, file writes, and other items.
*/
CFE_ES_BackgroundTaskState_t BackgroundTask;
/*
** Memory Pools
*/
CFE_ResourceId_t LastMemPoolId;
CFE_ES_MemPoolRecord_t MemPoolTable[CFE_PLATFORM_ES_MAX_MEMORY_POOLS];
} CFE_ES_Global_t;
/*
** The Executive Services Global Data declaration
*/
extern CFE_ES_Global_t CFE_ES_Global;
/*
** The Executive Services Nonvolatile Data declaration
*/
extern CFE_ES_ResetData_t *CFE_ES_ResetDataPtr;
/*
** Functions used to lock/unlock shared data
*/
extern void CFE_ES_LockSharedData(const char *FunctionName, int32 LineNumber);
extern void CFE_ES_UnlockSharedData(const char *FunctionName, int32 LineNumber);
#endif