1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2018 Intel Corporation. All rights reserved.
4  *
5  * Author: Tomasz Lauda <tomasz.lauda@linux.intel.com>
6  */
7 
8 #ifndef __XTOS_XTOS_STRUCTS_H__
9 #define __XTOS_XTOS_STRUCTS_H__
10 
11 #include "xtos-internal.h"
12 #include <sof/common.h>
13 #include <sof/lib/memory.h>
14 
15 #include <xtensa/xtruntime-frames.h>
16 #include <stdint.h>
17 
18 struct idc;
19 struct notify;
20 struct schedulers;
21 struct task;
22 
23 struct thread_data {
24 	xtos_structures_pointers xtos_ptrs;
25 	volatile xtos_task_context *xtos_active_task;
26 };
27 
28 struct xtos_core_data {
29 #if CONFIG_MULTICORE
30 	struct XtosInterruptStructure xtos_int_data;
31 #endif
32 #if CONFIG_XT_INTERRUPT_LEVEL_1
33 	uint8_t xtos_stack_for_interrupt_1[SOF_STACK_SIZE] __aligned(16);
34 #endif
35 #if CONFIG_XT_INTERRUPT_LEVEL_2
36 	uint8_t xtos_stack_for_interrupt_2[SOF_STACK_SIZE] __aligned(16);
37 #endif
38 #if CONFIG_XT_INTERRUPT_LEVEL_3
39 	uint8_t xtos_stack_for_interrupt_3[SOF_STACK_SIZE] __aligned(16);
40 #endif
41 #if CONFIG_XT_INTERRUPT_LEVEL_4
42 	uint8_t xtos_stack_for_interrupt_4[SOF_STACK_SIZE] __aligned(16);
43 #endif
44 #if CONFIG_XT_INTERRUPT_LEVEL_5
45 	uint8_t xtos_stack_for_interrupt_5[SOF_STACK_SIZE] __aligned(16);
46 #endif
47 	xtos_task_context xtos_interrupt_ctx;
48 	uintptr_t xtos_saved_sp;
49 	struct thread_data *thread_data_ptr;
50 };
51 
52 struct core_context {
53 	struct thread_data td;
54 	struct task *main_task;
55 	struct schedulers *schedulers;
56 	struct notify *notify;
57 	struct idc *idc;
58 };
59 
60 #endif /* __XTOS_XTOS_STRUCTS_H__ */
61