Line data Source code
1 0 : /* 2 : * Copyright (c) 2022 Intel Corporation 3 : * 4 : * SPDX-License-Identifier: Apache-2.0 5 : */ 6 : 7 : #ifndef ZEPHYR_LOG_BACKEND_ADSP_MTRACE_H_ 8 : #define ZEPHYR_LOG_BACKEND_ADSP_MTRACE_H_ 9 : 10 : #include <stdint.h> 11 : #include <stddef.h> 12 : 13 : /** 14 : *@brief mtracelogger requires a hook for IPC messages 15 : * 16 : * When new log data is added to the SRAM buffer, a IPC message 17 : * should be sent to the host. This hook function pointer allows 18 : * for that. 19 : */ 20 1 : typedef void(*adsp_mtrace_log_hook_t)(size_t written, size_t space_left); 21 : 22 : /** 23 : * @brief Initialize the Intel ADSP mtrace logger 24 : * 25 : * @param hook Function is called after each write to the SRAM buffer 26 : * It is up to the author of the hook to serialize if needed. 27 : */ 28 1 : void adsp_mtrace_log_init(adsp_mtrace_log_hook_t hook); 29 : 30 0 : const struct log_backend *log_backend_adsp_mtrace_get(void); 31 : 32 : #endif /* ZEPHYR_LOG_BACKEND_ADSP_MTRACE_H_ */