+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
/***************************************************************************
* Copyright (C) 2011 by Broadcom Corporation *
* Evan Hunter - ehunter@broadcom.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef OPENOCD_RTOS_RTOS_H
#include "server/server.h"
#include "target/target.h"
-#include <jim-nvp.h>
+#include <helper/jim-nvp.h>
typedef int64_t threadid_t;
typedef int64_t symbol_address_t;
* just use stacking->stack_registers_size * stack_growth_direction
* to calculate adjustment.
*/
- int64_t (*calculate_process_stack)(struct target *target,
+ target_addr_t (*calculate_process_stack)(struct target *target,
const uint8_t *stack_data,
const struct rtos_register_stacking *stacking,
- int64_t stack_ptr);
+ target_addr_t stack_ptr);
const struct stack_register_offset *register_offsets;
+ /* Optional field for targets which may have to implement their own stack read function.
+ * Because stack format can be weird or stack data needed to be edited before passing to the gdb.
+ */
+ int (*read_stack)(struct target *target,
+ int64_t stack_ptr,
+ const struct rtos_register_stacking *stacking,
+ uint8_t *stack_data);
};
#define GDB_THREAD_PACKET_NOT_CONSUMED (-40)
struct rtos_reg **reg_list,
int *num_regs);
int gdb_thread_packet(struct connection *connection, char const *packet, int packet_size);
+int rtos_thread_packet(struct connection *connection, const char *packet, int packet_size);
int rtos_get_gdb_reg(struct connection *connection, int reg_num);
int rtos_get_gdb_reg_list(struct connection *connection);
int rtos_update_threads(struct target *target);
int rtos_write_buffer(struct target *target, target_addr_t address,
uint32_t size, const uint8_t *buffer);
+extern const struct rtos_type chibios_rtos;
+extern const struct rtos_type chromium_ec_rtos;
+extern const struct rtos_type ecos_rtos;
+extern const struct rtos_type embkernel_rtos;
+extern const struct rtos_type freertos_rtos;
+extern const struct rtos_type hwthread_rtos;
+extern const struct rtos_type linux_rtos;
+extern const struct rtos_type mqx_rtos;
+extern const struct rtos_type nuttx_rtos;
+extern const struct rtos_type riot_rtos;
+extern const struct rtos_type rtkernel_rtos;
+extern const struct rtos_type threadx_rtos;
+extern const struct rtos_type ucos_iii_rtos;
+extern const struct rtos_type zephyr_rtos;
+
#endif /* OPENOCD_RTOS_RTOS_H */