openocd: src/target: replace the GPL-2.0-or-later license tag
[fw/openocd] / src / target / target_request.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /***************************************************************************
4  *   Copyright (C) 2007 by Dominic Rath                                    *
5  *   Dominic.Rath@gmx.de                                                   *
6  *                                                                         *
7  *   Copyright (C) 2007,2008 Ã˜yvind Harboe                                 *
8  *   oyvind.harboe@zylin.com                                               *
9  *                                                                         *
10  *   Copyright (C) 2008 by Spencer Oliver                                  *
11  *   spen@spen-soft.co.uk                                                  *
12  ***************************************************************************/
13
14 #ifndef OPENOCD_TARGET_TARGET_REQUEST_H
15 #define OPENOCD_TARGET_TARGET_REQUEST_H
16
17 struct target;
18 struct command_context;
19
20 typedef enum target_req_cmd {
21         TARGET_REQ_TRACEMSG,
22         TARGET_REQ_DEBUGMSG,
23         TARGET_REQ_DEBUGCHAR,
24 /*      TARGET_REQ_SEMIHOSTING, */
25 } target_req_cmd_t;
26
27 struct debug_msg_receiver {
28         struct command_context *cmd_ctx;
29         struct debug_msg_receiver *next;
30 };
31
32 int target_request(struct target *target, uint32_t request);
33 int delete_debug_msg_receiver(struct command_context *cmd_ctx,
34                 struct target *target);
35 int target_request_register_commands(struct command_context *cmd_ctx);
36 /**
37  * Read and clear the flag as to whether we got a message.
38  *
39  * This is used to implement the back-off algorithm on
40  * sleeping in idle mode.
41  */
42 bool target_got_message(void);
43
44 #endif /* OPENOCD_TARGET_TARGET_REQUEST_H */