1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2015-2022, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef FWK_INTERNAL_CONTEXT_H
9 #define FWK_INTERNAL_CONTEXT_H
10 
11 #include <fwk_event.h>
12 #include <fwk_list.h>
13 
14 #include <stdbool.h>
15 
16 /*
17  * Context component context. Exposed for testing purposes only.
18  */
19 
20 struct __fwk_ctx {
21     /* Core framework component initialization completed flag */
22     bool initialized;
23 
24     /*
25      * Counter used to generate event cookies.
26      */
27     uint32_t event_cookie_counter;
28 
29     /*
30      * Queue of event structures that are free to be filled in and linked
31      * to the event queue or the ISR event queue.
32      */
33     struct fwk_slist free_event_queue;
34 
35     /* Queue of events, generated by ISRs, that are awaiting processing */
36     struct fwk_slist isr_event_queue;
37 
38     /* Queue of events that are awaiting processing */
39     struct fwk_slist event_queue;
40 
41     /* The event currently being processed */
42     struct fwk_event *current_event;
43 };
44 
45 /*
46  * \brief Get component context.
47  *
48  * \note Only for testing.
49  */
50 struct __fwk_ctx *__fwk_get_ctx(void);
51 
52 #endif /* FWK_INTERNAL_CONTEXT_H */
53