Statistics
| Branch: | Revision:

root / target-s390x / exec.h @ 49a945a3

History | View | Annotate | Download (1.3 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 10ec5117 Alexander Graf
 * License along with this library; if not, write to the Free Software
18 10ec5117 Alexander Graf
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
19 10ec5117 Alexander Graf
 */
20 10ec5117 Alexander Graf
21 10ec5117 Alexander Graf
#include "dyngen-exec.h"
22 10ec5117 Alexander Graf
23 10ec5117 Alexander Graf
register struct CPUS390XState *env asm(AREG0);
24 10ec5117 Alexander Graf
25 10c339a0 Alexander Graf
#include "config.h"
26 10ec5117 Alexander Graf
#include "cpu.h"
27 10ec5117 Alexander Graf
#include "exec-all.h"
28 10ec5117 Alexander Graf
29 10c339a0 Alexander Graf
#if !defined(CONFIG_USER_ONLY)
30 10c339a0 Alexander Graf
#include "softmmu_exec.h"
31 10c339a0 Alexander Graf
#endif /* !defined(CONFIG_USER_ONLY) */
32 10c339a0 Alexander Graf
33 10ec5117 Alexander Graf
static inline int cpu_has_work(CPUState *env)
34 10ec5117 Alexander Graf
{
35 10ec5117 Alexander Graf
    return env->interrupt_request & CPU_INTERRUPT_HARD; // guess
36 10ec5117 Alexander Graf
}
37 10ec5117 Alexander Graf
38 10ec5117 Alexander Graf
static inline int cpu_halted(CPUState *env)
39 10ec5117 Alexander Graf
{
40 10ec5117 Alexander Graf
    if (!env->halted) {
41 10ec5117 Alexander Graf
       return 0;
42 10ec5117 Alexander Graf
    }
43 10ec5117 Alexander Graf
    if (cpu_has_work(env)) {
44 10ec5117 Alexander Graf
        env->halted = 0;
45 10ec5117 Alexander Graf
        return 0;
46 10ec5117 Alexander Graf
    }
47 10ec5117 Alexander Graf
    return EXCP_HALTED;
48 10ec5117 Alexander Graf
}