Statistics
| Branch: | Revision:

root / target-sh4 / exec.h @ 496eb021

History | View | Annotate | Download (1.4 kB)

1 fdf9b3e8 bellard
/*
2 fdf9b3e8 bellard
 *  SH4 emulation
3 5fafdf24 ths
 *
4 fdf9b3e8 bellard
 *  Copyright (c) 2005 Samuel Tardieu
5 fdf9b3e8 bellard
 *
6 fdf9b3e8 bellard
 * This library is free software; you can redistribute it and/or
7 fdf9b3e8 bellard
 * modify it under the terms of the GNU Lesser General Public
8 fdf9b3e8 bellard
 * License as published by the Free Software Foundation; either
9 fdf9b3e8 bellard
 * version 2 of the License, or (at your option) any later version.
10 fdf9b3e8 bellard
 *
11 fdf9b3e8 bellard
 * This library is distributed in the hope that it will be useful,
12 fdf9b3e8 bellard
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 fdf9b3e8 bellard
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 fdf9b3e8 bellard
 * Lesser General Public License for more details.
15 fdf9b3e8 bellard
 *
16 fdf9b3e8 bellard
 * You should have received a copy of the GNU Lesser General Public
17 8167ee88 Blue Swirl
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 fdf9b3e8 bellard
 */
19 fdf9b3e8 bellard
#ifndef _EXEC_SH4_H
20 fdf9b3e8 bellard
#define _EXEC_SH4_H
21 fdf9b3e8 bellard
22 fdf9b3e8 bellard
#include "config.h"
23 fdf9b3e8 bellard
#include "dyngen-exec.h"
24 fdf9b3e8 bellard
25 fdf9b3e8 bellard
register struct CPUSH4State *env asm(AREG0);
26 eda9b09b bellard
27 fdf9b3e8 bellard
#include "cpu.h"
28 fdf9b3e8 bellard
#include "exec-all.h"
29 fdf9b3e8 bellard
30 6a4955a8 aliguori
static inline int cpu_has_work(CPUState *env)
31 6a4955a8 aliguori
{
32 6a4955a8 aliguori
    return (env->interrupt_request & CPU_INTERRUPT_HARD);
33 6a4955a8 aliguori
}
34 6a4955a8 aliguori
35 d10927f8 ths
static inline int cpu_halted(CPUState *env) {
36 d10927f8 ths
    if (!env->halted)
37 d10927f8 ths
        return 0;
38 6a4955a8 aliguori
    if (cpu_has_work(env)) {
39 d10927f8 ths
        env->halted = 0;
40 833ed386 aurel32
        env->intr_at_halt = 1;
41 d10927f8 ths
        return 0;
42 d10927f8 ths
    }
43 d10927f8 ths
    return EXCP_HALTED;
44 d10927f8 ths
}
45 d10927f8 ths
46 fdf9b3e8 bellard
#ifndef CONFIG_USER_ONLY
47 fdf9b3e8 bellard
#include "softmmu_exec.h"
48 fdf9b3e8 bellard
#endif
49 fdf9b3e8 bellard
50 fdf9b3e8 bellard
static inline void regs_to_env(void)
51 fdf9b3e8 bellard
{
52 fdf9b3e8 bellard
    /* XXXXX */
53 fdf9b3e8 bellard
}
54 fdf9b3e8 bellard
55 fdf9b3e8 bellard
static inline void env_to_regs(void)
56 fdf9b3e8 bellard
{
57 fdf9b3e8 bellard
    /* XXXXX */
58 fdf9b3e8 bellard
}
59 fdf9b3e8 bellard
60 fdf9b3e8 bellard
#endif                                /* _EXEC_SH4_H */