Statistics
| Branch: | Revision:

root / target-alpha / exec.h @ 6a80e088

History | View | Annotate | Download (2 kB)

1 4c9649a9 j_mayer
/*
2 4c9649a9 j_mayer
 *  Alpha emulation cpu run-time definitions for qemu.
3 5fafdf24 ths
 *
4 4c9649a9 j_mayer
 *  Copyright (c) 2007 Jocelyn Mayer
5 4c9649a9 j_mayer
 *
6 4c9649a9 j_mayer
 * This library is free software; you can redistribute it and/or
7 4c9649a9 j_mayer
 * modify it under the terms of the GNU Lesser General Public
8 4c9649a9 j_mayer
 * License as published by the Free Software Foundation; either
9 4c9649a9 j_mayer
 * version 2 of the License, or (at your option) any later version.
10 4c9649a9 j_mayer
 *
11 4c9649a9 j_mayer
 * This library is distributed in the hope that it will be useful,
12 4c9649a9 j_mayer
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 4c9649a9 j_mayer
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 4c9649a9 j_mayer
 * Lesser General Public License for more details.
15 4c9649a9 j_mayer
 *
16 4c9649a9 j_mayer
 * 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 4c9649a9 j_mayer
 */
19 4c9649a9 j_mayer
20 4c9649a9 j_mayer
#if !defined (__ALPHA_EXEC_H__)
21 4c9649a9 j_mayer
#define __ALPHA_EXEC_H__
22 4c9649a9 j_mayer
23 4c9649a9 j_mayer
#include "config.h"
24 4c9649a9 j_mayer
25 4c9649a9 j_mayer
#include "dyngen-exec.h"
26 4c9649a9 j_mayer
27 4c9649a9 j_mayer
#define TARGET_LONG_BITS 64
28 4c9649a9 j_mayer
29 4c9649a9 j_mayer
register struct CPUAlphaState *env asm(AREG0);
30 4c9649a9 j_mayer
31 4c9649a9 j_mayer
#define FP_STATUS (env->fp_status)
32 4c9649a9 j_mayer
33 4c9649a9 j_mayer
#include "cpu.h"
34 4c9649a9 j_mayer
#include "exec-all.h"
35 4c9649a9 j_mayer
36 4c9649a9 j_mayer
#if !defined(CONFIG_USER_ONLY)
37 4c9649a9 j_mayer
#include "softmmu_exec.h"
38 4c9649a9 j_mayer
#endif /* !defined(CONFIG_USER_ONLY) */
39 4c9649a9 j_mayer
40 636aa200 Blue Swirl
static inline int cpu_has_work(CPUState *env)
41 6a4955a8 aliguori
{
42 6a80e088 Richard Henderson
    /* Here we are checking to see if the CPU should wake up from HALT.
43 6a80e088 Richard Henderson
       We will have gotten into this state only for WTINT from PALmode.  */
44 6a80e088 Richard Henderson
    /* ??? I'm not sure how the IPL state works with WTINT to keep a CPU
45 6a80e088 Richard Henderson
       asleep even if (some) interrupts have been asserted.  For now, 
46 6a80e088 Richard Henderson
       assume that if a CPU really wants to stay asleep, it will mask
47 6a80e088 Richard Henderson
       interrupts at the chipset level, which will prevent these bits
48 6a80e088 Richard Henderson
       from being set in the first place.  */
49 6a80e088 Richard Henderson
    return env->interrupt_request & (CPU_INTERRUPT_HARD
50 6a80e088 Richard Henderson
                                     | CPU_INTERRUPT_TIMER
51 6a80e088 Richard Henderson
                                     | CPU_INTERRUPT_SMP
52 6a80e088 Richard Henderson
                                     | CPU_INTERRUPT_MCHK);
53 6a4955a8 aliguori
}
54 6a4955a8 aliguori
55 10eb0cc0 Paolo Bonzini
static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
56 10eb0cc0 Paolo Bonzini
{
57 10eb0cc0 Paolo Bonzini
    env->pc = tb->pc;
58 10eb0cc0 Paolo Bonzini
}
59 10eb0cc0 Paolo Bonzini
60 4c9649a9 j_mayer
#endif /* !defined (__ALPHA_EXEC_H__) */