1 /*
2  * Copyright (c) 2020 Intel Corporation
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef SEGGER_SEGGER_SYSVIEW_CONF_H_
8 #define SEGGER_SEGGER_SYSVIEW_CONF_H_
9 
10 #include <stdint.h>
11 
12 #define SEGGER_SYSVIEW_GET_TIMESTAMP	sysview_get_timestamp
13 #define SEGGER_SYSVIEW_GET_INTERRUPT_ID sysview_get_interrupt
14 
15 uint32_t sysview_get_timestamp(void);
16 uint32_t sysview_get_interrupt(void);
17 
18 #define SEGGER_SYSVIEW_RTT_BUFFER_SIZE	CONFIG_SEGGER_SYSVIEW_RTT_BUFFER_SIZE
19 #define SEGGER_SYSVIEW_POST_MORTEM_MODE CONFIG_SEGGER_SYSVIEW_POST_MORTEM_MODE
20 #define SEGGER_SYSVIEW_RTT_CHANNEL	CONFIG_SEGGER_SYSVIEW_RTT_CHANNEL
21 
22 #if defined(CONFIG_SEGGER_SYSVIEW_SECTION_DTCM)
23 #define SEGGER_SYSVIEW_SECTION ".dtcm_data"
24 #endif
25 
26 extern unsigned int zephyr_rtt_irq_lock(void);
27 extern void zephyr_rtt_irq_unlock(unsigned int key);
28 
29 /* Lock SystemView (nestable) */
30 #define SEGGER_SYSVIEW_LOCK()                                                                      \
31 	{                                                                                          \
32 		unsigned int __sysview_irq_key = zephyr_rtt_irq_lock()
33 
34 /* Unlock SystemView (nestable) */
35 #define SEGGER_SYSVIEW_UNLOCK()                                                                    \
36 		zephyr_rtt_irq_unlock(__sysview_irq_key);                                          \
37 	}
38 
39 #endif /* SEGGER_SEGGER_SYSVIEW_CONF_H_ */
40