Statistics
| Branch: | Revision:

root / target-s390x / exec.h @ a88790a1

History | View | Annotate | Download (1.4 kB)

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