Statistics
| Branch: | Revision:

root / target-microblaze / exec.h @ a88790a1

History | View | Annotate | Download (1.4 kB)

1 4acb54ba Edgar E. Iglesias
/*
2 4acb54ba Edgar E. Iglesias
 *  Microblaze execution defines
3 4acb54ba Edgar E. Iglesias
 *
4 4acb54ba Edgar E. Iglesias
 *  Copyright (c) 2009 Edgar E. Iglesias
5 4acb54ba Edgar E. Iglesias
 *
6 4acb54ba Edgar E. Iglesias
 * This library is free software; you can redistribute it and/or
7 4acb54ba Edgar E. Iglesias
 * modify it under the terms of the GNU Lesser General Public
8 4acb54ba Edgar E. Iglesias
 * License as published by the Free Software Foundation; either
9 4acb54ba Edgar E. Iglesias
 * version 2 of the License, or (at your option) any later version.
10 4acb54ba Edgar E. Iglesias
 *
11 4acb54ba Edgar E. Iglesias
 * This library is distributed in the hope that it will be useful,
12 4acb54ba Edgar E. Iglesias
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 4acb54ba Edgar E. Iglesias
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 4acb54ba Edgar E. Iglesias
 * General Public License for more details.
15 4acb54ba Edgar E. Iglesias
 *
16 4acb54ba Edgar E. Iglesias
 * 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 4acb54ba Edgar E. Iglesias
 */
19 4acb54ba Edgar E. Iglesias
#include "dyngen-exec.h"
20 4acb54ba Edgar E. Iglesias
21 4acb54ba Edgar E. Iglesias
register struct CPUMBState *env asm(AREG0);
22 4acb54ba Edgar E. Iglesias
23 4acb54ba Edgar E. Iglesias
#include "cpu.h"
24 4acb54ba Edgar E. Iglesias
#include "exec-all.h"
25 4acb54ba Edgar E. Iglesias
26 4acb54ba Edgar E. Iglesias
#if !defined(CONFIG_USER_ONLY)
27 4acb54ba Edgar E. Iglesias
#include "softmmu_exec.h"
28 4acb54ba Edgar E. Iglesias
#endif
29 4acb54ba Edgar E. Iglesias
30 4acb54ba Edgar E. Iglesias
static inline int cpu_has_work(CPUState *env)
31 4acb54ba Edgar E. Iglesias
{
32 4acb54ba Edgar E. Iglesias
    return (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI));
33 4acb54ba Edgar E. Iglesias
}
34 4acb54ba Edgar E. Iglesias
35 4acb54ba Edgar E. Iglesias
static inline int cpu_halted(CPUState *env) {
36 4acb54ba Edgar E. Iglesias
        if (!env->halted)
37 4acb54ba Edgar E. Iglesias
                return 0;
38 4acb54ba Edgar E. Iglesias
39 4acb54ba Edgar E. Iglesias
        /* IRQ, NMI and GURU execeptions wakes us up.  */
40 4acb54ba Edgar E. Iglesias
        if (env->interrupt_request
41 4acb54ba Edgar E. Iglesias
            & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI)) {
42 4acb54ba Edgar E. Iglesias
                env->halted = 0;
43 4acb54ba Edgar E. Iglesias
                return 0;
44 4acb54ba Edgar E. Iglesias
        }
45 4acb54ba Edgar E. Iglesias
        return EXCP_HALTED;
46 4acb54ba Edgar E. Iglesias
}
47 10eb0cc0 Paolo Bonzini
48 10eb0cc0 Paolo Bonzini
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
49 10eb0cc0 Paolo Bonzini
{
50 10eb0cc0 Paolo Bonzini
    env->sregs[SR_PC] = tb->pc;
51 10eb0cc0 Paolo Bonzini
}