Statistics
| Branch: | Revision:

root / target-m68k / exec.h @ f58ae59c

History | View | Annotate | Download (1.3 kB)

1 e6e5906b pbrook
/*
2 e6e5906b pbrook
 *  m68k execution defines
3 5fafdf24 ths
 *
4 e6e5906b pbrook
 *  Copyright (c) 2005-2006 CodeSourcery
5 e6e5906b pbrook
 *  Written by Paul Brook
6 e6e5906b pbrook
 *
7 e6e5906b pbrook
 * This library is free software; you can redistribute it and/or
8 e6e5906b pbrook
 * modify it under the terms of the GNU Lesser General Public
9 e6e5906b pbrook
 * License as published by the Free Software Foundation; either
10 e6e5906b pbrook
 * version 2 of the License, or (at your option) any later version.
11 e6e5906b pbrook
 *
12 e6e5906b pbrook
 * This library is distributed in the hope that it will be useful,
13 e6e5906b pbrook
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 e6e5906b pbrook
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 e6e5906b pbrook
 * General Public License for more details.
16 e6e5906b pbrook
 *
17 e6e5906b pbrook
 * You should have received a copy of the GNU Lesser General Public
18 8167ee88 Blue Swirl
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 e6e5906b pbrook
 */
20 e6e5906b pbrook
#include "dyngen-exec.h"
21 e6e5906b pbrook
22 e6e5906b pbrook
register struct CPUM68KState *env asm(AREG0);
23 e6e5906b pbrook
24 e6e5906b pbrook
#include "cpu.h"
25 e6e5906b pbrook
#include "exec-all.h"
26 e6e5906b pbrook
27 0633879f pbrook
#if !defined(CONFIG_USER_ONLY)
28 0633879f pbrook
#include "softmmu_exec.h"
29 0633879f pbrook
#endif
30 e6e5906b pbrook
31 6a4955a8 aliguori
static inline int cpu_has_work(CPUState *env)
32 6a4955a8 aliguori
{
33 6a4955a8 aliguori
    return (env->interrupt_request & (CPU_INTERRUPT_HARD));
34 6a4955a8 aliguori
}
35 6a4955a8 aliguori
36 bfed01fc ths
static inline int cpu_halted(CPUState *env) {
37 bfed01fc ths
    if (!env->halted)
38 bfed01fc ths
        return 0;
39 6a4955a8 aliguori
    if (cpu_has_work(env)) {
40 bfed01fc ths
        env->halted = 0;
41 bfed01fc ths
        return 0;
42 bfed01fc ths
    }
43 bfed01fc ths
    return EXCP_HALTED;
44 bfed01fc ths
}
45 10eb0cc0 Paolo Bonzini
46 10eb0cc0 Paolo Bonzini
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
47 10eb0cc0 Paolo Bonzini
{
48 10eb0cc0 Paolo Bonzini
    env->pc = tb->pc;
49 10eb0cc0 Paolo Bonzini
}