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 "exec/gdbstub.h"
23 int hexagon_gdb_read_register(CPUState
*cs
, GByteArray
*mem_buf
, int n
)
25 HexagonCPU
*cpu
= HEXAGON_CPU(cs
);
26 CPUHexagonState
*env
= &cpu
->env
;
28 if (n
< TOTAL_PER_THREAD_REGS
) {
29 return gdb_get_regl(mem_buf
, env
->gpr
[n
]);
32 g_assert_not_reached();
35 int hexagon_gdb_write_register(CPUState
*cs
, uint8_t *mem_buf
, int n
)
37 HexagonCPU
*cpu
= HEXAGON_CPU(cs
);
38 CPUHexagonState
*env
= &cpu
->env
;
40 if (n
< TOTAL_PER_THREAD_REGS
) {
41 env
->gpr
[n
] = ldtul_p(mem_buf
);
42 return sizeof(target_ulong
);
45 g_assert_not_reached();