2 * Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #include "qemu/osdep.h"
19 #include "qemu-common.h"
20 #include "exec/gdbstub.h"
24 int hexagon_gdb_read_register(CPUState
*cs
, GByteArray
*mem_buf
, int n
)
26 HexagonCPU
*cpu
= HEXAGON_CPU(cs
);
27 CPUHexagonState
*env
= &cpu
->env
;
29 if (n
< TOTAL_PER_THREAD_REGS
) {
30 return gdb_get_regl(mem_buf
, env
->gpr
[n
]);
33 g_assert_not_reached();
36 int hexagon_gdb_write_register(CPUState
*cs
, uint8_t *mem_buf
, int n
)
38 HexagonCPU
*cpu
= HEXAGON_CPU(cs
);
39 CPUHexagonState
*env
= &cpu
->env
;
41 if (n
< TOTAL_PER_THREAD_REGS
) {
42 env
->gpr
[n
] = ldtul_p(mem_buf
);
43 return sizeof(target_ulong
);
46 g_assert_not_reached();