• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  ARM execution defines
3  *
4  *  Copyright (c) 2003 Fabrice Bellard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18  */
19 #include "config.h"
20 #include "dyngen-exec.h"
21 
22 GLOBAL_REGISTER_VARIABLE_DECL struct CPUARMState *env asm(AREG0);
23 
24 #include "cpu.h"
25 #include "exec-all.h"
26 
env_to_regs(void)27 static inline void env_to_regs(void)
28 {
29 }
30 
regs_to_env(void)31 static inline void regs_to_env(void)
32 {
33 }
34 
cpu_has_work(CPUState * env)35 static inline int cpu_has_work(CPUState *env)
36 {
37     return (env->interrupt_request &
38             (CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB));
39 }
40 
cpu_halted(CPUState * env)41 static inline int cpu_halted(CPUState *env) {
42     if (!env->halted)
43         return 0;
44     /* An interrupt wakes the CPU even if the I and F CPSR bits are
45        set.  We use EXITTB to silently wake CPU without causing an
46        actual interrupt.  */
47     if (cpu_has_work(env)) {
48         env->halted = 0;
49         return 0;
50     }
51     return EXCP_HALTED;
52 }
53 
54 #if !defined(CONFIG_USER_ONLY)
55 #include "softmmu_exec.h"
56 #endif
57 
58 void raise_exception(int);
cpu_pc_from_tb(CPUState * env,TranslationBlock * tb)59 static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
60 {
61     env->regs[15] = tb->pc;
62 }
63 
64