openocd: src/rtos: replace the GPL-2.0-or-later license tag
[fw/openocd] / src / rtos / rtos.h
index 20f7de775b48a96f7d3c383ebda1550fc05f8816..ace57514af5044dbd80ce5f590e53ac53a7b982c 100644 (file)
@@ -1,19 +1,8 @@
+/* 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
@@ -21,7 +10,7 @@
 
 #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;
@@ -82,6 +71,13 @@ struct rtos_type {
        int (*clean)(struct target *target);
        char * (*ps_command)(struct target *target);
        int (*set_reg)(struct rtos *rtos, uint32_t reg_num, uint8_t *reg_value);
+       /* Implement these if different threads in the RTOS can see memory
+        * differently (for instance because address translation might be different
+        * for each thread). */
+       int (*read_buffer)(struct rtos *rtos, target_addr_t address, uint32_t size,
+                       uint8_t *buffer);
+       int (*write_buffer)(struct rtos *rtos, target_addr_t address, uint32_t size,
+                       const uint8_t *buffer);
 };
 
 struct stack_register_offset {
@@ -101,10 +97,10 @@ struct rtos_register_stacking {
         * 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;
 };
 
@@ -127,5 +123,9 @@ void rtos_free_threadlist(struct rtos *rtos);
 int rtos_smp_init(struct target *target);
 /*  function for handling symbol access */
 int rtos_qsymbol(struct connection *connection, char const *packet, int packet_size);
+int rtos_read_buffer(struct target *target, target_addr_t address,
+               uint32_t size, uint8_t *buffer);
+int rtos_write_buffer(struct target *target, target_addr_t address,
+               uint32_t size, const uint8_t *buffer);
 
 #endif /* OPENOCD_RTOS_RTOS_H */