1 /* 2 * Copyright (c) 2020 Intel Corporation. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_SUBSYS_DEBUG_GDBSTUB_BACKEND_H_ 8 #define ZEPHYR_SUBSYS_DEBUG_GDBSTUB_BACKEND_H_ 9 10 #include <stdint.h> 11 12 /** 13 * This is an internal header. These API is intended to be used 14 * exclusively by gdbstub. 15 * 16 * A backend has to implement these three functions knowing that they 17 * will be called in an interruption context. 18 */ 19 20 /** 21 * @brief Initialize the gdbstub backend 22 * 23 * This function is called from @c gdb_start to 24 * give the opportunity to the backend initialize properly. 25 * 26 * @retval 0 In case of success 27 * @retval -1 If the backend was not initialized properly 28 */ 29 int z_gdb_backend_init(void); 30 31 /** 32 * @brief Output a character 33 * 34 * @param ch Character to send 35 */ 36 void z_gdb_putchar(unsigned char ch); 37 38 /** 39 * @brief Receive a character 40 * 41 * This function blocks until have a valid 42 * character to return. 43 * 44 * @return A character 45 */ 46 char z_gdb_getchar(void); 47 48 #endif 49