]>
git.proxmox.com Git - qemu.git/blob - target-cris/gdbstub.c
4 * Copyright (c) 2003-2005 Fabrice Bellard
5 * Copyright (c) 2013 SUSE LINUX Products GmbH
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
22 read_register_crisv10(CPUCRISState
*env
, uint8_t *mem_buf
, int n
)
25 GET_REG32(env
->regs
[n
]);
35 GET_REG8(env
->pregs
[n
- 16]);
37 GET_REG8(env
->pregs
[n
- 16]);
40 GET_REG16(env
->pregs
[n
- 16]);
43 GET_REG32(env
->pregs
[n
- 16]);
51 static int cpu_gdb_read_register(CPUCRISState
*env
, uint8_t *mem_buf
, int n
)
55 if (env
->pregs
[PR_VR
] < 32) {
56 return read_register_crisv10(env
, mem_buf
, n
);
59 srs
= env
->pregs
[PR_SRS
];
61 GET_REG32(env
->regs
[n
]);
64 if (n
>= 21 && n
< 32) {
65 GET_REG32(env
->pregs
[n
- 16]);
67 if (n
>= 33 && n
< 49) {
68 GET_REG32(env
->sregs
[srs
][n
- 33]);
72 GET_REG8(env
->pregs
[0]);
74 GET_REG8(env
->pregs
[1]);
76 GET_REG32(env
->pregs
[2]);
80 GET_REG16(env
->pregs
[4]);
88 static int cpu_gdb_write_register(CPUCRISState
*env
, uint8_t *mem_buf
, int n
)
102 if (n
>= 21 && n
< 32) {
103 env
->pregs
[n
- 16] = tmp
;
106 /* FIXME: Should support function regs be writable? */
113 env
->pregs
[PR_PID
] = tmp
;