]>
git.proxmox.com Git - mirror_qemu.git/blob - linux-user/hexagon/cpu_loop.c
108d755ce0b4d5b04ab0b940538766b93e48cb14
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 * Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program 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
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <http://www.gnu.org/licenses/>.
21 #include "qemu/osdep.h"
22 #include "qemu-common.h"
24 #include "user-internals.h"
25 #include "cpu_loop-common.h"
26 #include "signal-common.h"
29 void cpu_loop(CPUHexagonState
*env
)
31 CPUState
*cs
= env_cpu(env
);
33 target_ulong syscallnum
;
38 trapnr
= cpu_exec(cs
);
40 process_queued_cpu_work(cs
);
44 /* just indicate that signals should be handled asap */
47 syscallnum
= env
->gpr
[6];
48 env
->gpr
[HEX_REG_PC
] += 4;
58 if (ret
== -QEMU_ERESTARTSYS
) {
59 env
->gpr
[HEX_REG_PC
] -= 4;
60 } else if (ret
!= -TARGET_QEMU_ESIGRETURN
) {
65 cpu_exec_step_atomic(cs
);
68 EXCP_DUMP(env
, "\nqemu: unhandled CPU exception %#x - aborting\n",
72 process_pending_signals(env
);
76 void target_cpu_copy_regs(CPUArchState
*env
, struct target_pt_regs
*regs
)
78 env
->gpr
[HEX_REG_PC
] = regs
->sepc
;
79 env
->gpr
[HEX_REG_SP
] = regs
->sp
;
80 env
->gpr
[HEX_REG_USR
] = 0x56000;