~fboudra/qemu-linaro/new-upstream-release-1.2.0-2012.09-0ubuntu1

« back to all changes in this revision

Viewing changes to target-arm/op_helper.c

  • Committer: Fathi Boudra
  • Author(s): Fathi Boudra
  • Date: 2012-08-21 06:47:11 UTC
  • mfrom: (0.1.16)
  • Revision ID: fathi.boudra@linaro.org-20120821064711-7yxmubp2v8a44xce
Tags: 1.1.50-2012.08-0ubuntu1
* New upstream release.
  - support emulated systems with more than 2G of memory. (LP: #1030588)
* Drop powerpc-missing-include.patch - merged upstream.
* Update debian/control: 
  - drop perl build dependency.
  - add libfdt-dev build dependency.
* Update debian/qemu-keymaps.install file.
* Update debian/rules:
  - update QEMU_CPU for ARM architecture: armv4l -> armv7l.
  - update conf_audio_drv: default to PulseAudio since PA is the default on
    Ubuntu.
  - enable KVM on ARM architecture.
  - enable flat device tree support (--enable-fdt). (LP: #1030594)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#define SIGNBIT (uint32_t)0x80000000
24
24
#define SIGNBIT64 ((uint64_t)1 << 63)
25
25
 
26
 
#if !defined(CONFIG_USER_ONLY)
27
26
static void raise_exception(int tt)
28
27
{
29
28
    env->exception_index = tt;
30
29
    cpu_loop_exit(env);
31
30
}
32
 
#endif
33
31
 
34
32
uint32_t HELPER(neon_tbl)(uint32_t ireg, uint32_t def,
35
33
                          uint32_t rn, uint32_t maxindex)
75
73
   NULL, it means that the function was called in C code (i.e. not
76
74
   from generated code or from helper.c) */
77
75
/* XXX: fix it to restore all registers */
78
 
void tlb_fill(CPUState *env1, target_ulong addr, int is_write, int mmu_idx,
79
 
              void *retaddr)
 
76
void tlb_fill(CPUARMState *env1, target_ulong addr, int is_write, int mmu_idx,
 
77
              uintptr_t retaddr)
80
78
{
81
79
    TranslationBlock *tb;
82
 
    CPUState *saved_env;
83
 
    unsigned long pc;
 
80
    CPUARMState *saved_env;
84
81
    int ret;
85
82
 
86
83
    saved_env = env;
89
86
    if (unlikely(ret)) {
90
87
        if (retaddr) {
91
88
            /* now we have a real cpu fault */
92
 
            pc = (unsigned long)retaddr;
93
 
            tb = tb_find_pc(pc);
 
89
            tb = tb_find_pc(retaddr);
94
90
            if (tb) {
95
91
                /* the PC is inside the translated code. It means that we have
96
92
                   a virtual CPU fault */
97
 
                cpu_restore_state(tb, env, pc);
 
93
                cpu_restore_state(tb, env, retaddr);
98
94
            }
99
95
        }
100
96
        raise_exception(env->exception_index);
101
97
    }
102
98
    env = saved_env;
103
99
}
104
 
 
105
 
void HELPER(set_cp)(CPUState *env, uint32_t insn, uint32_t val)
106
 
{
107
 
    int cp_num = (insn >> 8) & 0xf;
108
 
    int cp_info = (insn >> 5) & 7;
109
 
    int src = (insn >> 16) & 0xf;
110
 
    int operand = insn & 0xf;
111
 
    
112
 
    if (env->cp[cp_num].cp_write)
113
 
        env->cp[cp_num].cp_write(env->cp[cp_num].opaque,
114
 
                                 cp_info, src, operand, val, GETPC());
115
 
        }
116
 
 
117
 
uint32_t HELPER(get_cp)(CPUState *env, uint32_t insn)
118
 
{
119
 
    int cp_num = (insn >> 8) & 0xf;
120
 
    int cp_info = (insn >> 5) & 7;
121
 
    int dest = (insn >> 16) & 0xf;
122
 
    int operand = insn & 0xf;
123
 
    
124
 
    if (env->cp[cp_num].cp_read)
125
 
        return env->cp[cp_num].cp_read(env->cp[cp_num].opaque,
126
 
                                       cp_info, dest, operand, GETPC());
127
 
        return 0;
128
 
}
129
 
 
130
 
#else
131
 
 
132
 
void HELPER(set_cp)(CPUState *env, uint32_t insn, uint32_t val)
133
 
{
134
 
    int op1 = (insn >> 8) & 0xf;
135
 
    cpu_abort(env, "cp%i insn %08x\n", op1, insn);
136
 
    return;
137
 
}
138
 
 
139
 
uint32_t HELPER(get_cp)(CPUState *env, uint32_t insn)
140
 
{
141
 
    int op1 = (insn >> 8) & 0xf;
142
 
    cpu_abort(env, "cp%i insn %08x\n", op1, insn);
143
 
    return 0;
144
 
}
145
 
 
146
100
#endif
147
101
 
148
 
/* FIXME: Pass an axplicit pointer to QF to CPUState, and move saturating
 
102
/* FIXME: Pass an axplicit pointer to QF to CPUARMState, and move saturating
149
103
   instructions into helper.c  */
150
104
uint32_t HELPER(add_setq)(uint32_t a, uint32_t b)
151
105
{
331
285
    }
332
286
}
333
287
 
 
288
void HELPER(set_cp_reg)(CPUARMState *env, void *rip, uint32_t value)
 
289
{
 
290
    const ARMCPRegInfo *ri = rip;
 
291
    int excp = ri->writefn(env, ri, value);
 
292
    if (excp) {
 
293
        raise_exception(excp);
 
294
    }
 
295
}
 
296
 
 
297
uint32_t HELPER(get_cp_reg)(CPUARMState *env, void *rip)
 
298
{
 
299
    const ARMCPRegInfo *ri = rip;
 
300
    uint64_t value;
 
301
    int excp = ri->readfn(env, ri, &value);
 
302
    if (excp) {
 
303
        raise_exception(excp);
 
304
    }
 
305
    return value;
 
306
}
 
307
 
 
308
void HELPER(set_cp_reg64)(CPUARMState *env, void *rip, uint64_t value)
 
309
{
 
310
    const ARMCPRegInfo *ri = rip;
 
311
    int excp = ri->writefn(env, ri, value);
 
312
    if (excp) {
 
313
        raise_exception(excp);
 
314
    }
 
315
}
 
316
 
 
317
uint64_t HELPER(get_cp_reg64)(CPUARMState *env, void *rip)
 
318
{
 
319
    const ARMCPRegInfo *ri = rip;
 
320
    uint64_t value;
 
321
    int excp = ri->readfn(env, ri, &value);
 
322
    if (excp) {
 
323
        raise_exception(excp);
 
324
    }
 
325
    return value;
 
326
}
 
327
 
334
328
/* ??? Flag setting arithmetic is awkward because we need to do comparisons.
335
329
   The only way to do that in TCG is a conditional branch, which clobbers
336
330
   all our temporaries.  For now implement these as helper functions.  */