~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to hw/pl061.c

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-07 06:20:34 UTC
  • mfrom: (1.1.9 upstream)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20090307062034-i3pead4mw653v2el
Tags: 0.10.0-1
[ Aurelien Jarno ]
* New upstream release:
  - Fix fr-be keyboard mapping (closes: bug#514462).
  - Fix stat64 structure on ppc-linux-user (closes: bug#470231).
  - Add a chroot option (closes: bug#415996).
  - Add evdev support (closes: bug#513210).
  - Fix loop on symlinks in user mode (closes: bug#297572).
  - Bump depends on openbios-sparc.
  - Depends on openbios-ppc.
  - Update 12_signal_powerpc_support.patch.
  - Update 21_net_soopts.patch.
  - Drop 44_socklen_t_check.patch (merged upstream).
  - Drop 49_null_check.patch (merged upstream).
  - Update 64_ppc_asm_constraints.patch.
  - Drop security/CVE-2008-0928-fedora.patch (merged upstream).
  - Drop security/CVE-2007-5730.patch (merged upstream).
* patches/80_stable-branch.patch: add patches from stable branch:
  - Fix race condition between signal handler/execution loop (closes:
    bug#474386, bug#501731).
* debian/copyright: update.
* Compile and install .dtb files:
  - debian/control: build-depends on device-tree-compiler.
  - debian/patches/81_compile_dtb.patch: new patch from upstream.
  - debian/rules: compile and install bamboo.dtb and mpc8544.dtb.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
  { 0x00, 0x00, 0x00, 0x00, 0x61, 0x00, 0x18, 0x01, 0x0d, 0xf0, 0x05, 0xb1 };
29
29
 
30
30
typedef struct {
31
 
    uint32_t base;
32
31
    int locked;
33
32
    uint8_t data;
34
33
    uint8_t old_data;
83
82
{
84
83
    pl061_state *s = (pl061_state *)opaque;
85
84
 
86
 
    offset -= s->base;
87
85
    if (offset >= 0xfd0 && offset < 0x1000) {
88
86
        return pl061_id[(offset - 0xfd0) >> 2];
89
87
    }
140
138
    pl061_state *s = (pl061_state *)opaque;
141
139
    uint8_t mask;
142
140
 
143
 
    offset -= s->base;
144
141
    if (offset < 0x400) {
145
142
        mask = (offset >> 2) & s->dir;
146
143
        s->data = (s->data & ~mask) | (value & mask);
240
237
   pl061_write
241
238
};
242
239
 
 
240
static void pl061_save(QEMUFile *f, void *opaque)
 
241
{
 
242
    pl061_state *s = (pl061_state *)opaque;
 
243
 
 
244
    qemu_put_be32(f, s->locked);
 
245
    qemu_put_be32(f, s->data);
 
246
    qemu_put_be32(f, s->old_data);
 
247
    qemu_put_be32(f, s->dir);
 
248
    qemu_put_be32(f, s->isense);
 
249
    qemu_put_be32(f, s->ibe);
 
250
    qemu_put_be32(f, s->iev);
 
251
    qemu_put_be32(f, s->im);
 
252
    qemu_put_be32(f, s->istate);
 
253
    qemu_put_be32(f, s->afsel);
 
254
    qemu_put_be32(f, s->dr2r);
 
255
    qemu_put_be32(f, s->dr4r);
 
256
    qemu_put_be32(f, s->dr8r);
 
257
    qemu_put_be32(f, s->odr);
 
258
    qemu_put_be32(f, s->pur);
 
259
    qemu_put_be32(f, s->pdr);
 
260
    qemu_put_be32(f, s->slr);
 
261
    qemu_put_be32(f, s->den);
 
262
    qemu_put_be32(f, s->cr);
 
263
    qemu_put_be32(f, s->float_high);
 
264
}
 
265
 
 
266
static int pl061_load(QEMUFile *f, void *opaque, int version_id)
 
267
{
 
268
    pl061_state *s = (pl061_state *)opaque;
 
269
    if (version_id != 1)
 
270
        return -EINVAL;
 
271
 
 
272
    s->locked = qemu_get_be32(f);
 
273
    s->data = qemu_get_be32(f);
 
274
    s->old_data = qemu_get_be32(f);
 
275
    s->dir = qemu_get_be32(f);
 
276
    s->isense = qemu_get_be32(f);
 
277
    s->ibe = qemu_get_be32(f);
 
278
    s->iev = qemu_get_be32(f);
 
279
    s->im = qemu_get_be32(f);
 
280
    s->istate = qemu_get_be32(f);
 
281
    s->afsel = qemu_get_be32(f);
 
282
    s->dr2r = qemu_get_be32(f);
 
283
    s->dr4r = qemu_get_be32(f);
 
284
    s->dr8r = qemu_get_be32(f);
 
285
    s->odr = qemu_get_be32(f);
 
286
    s->pur = qemu_get_be32(f);
 
287
    s->pdr = qemu_get_be32(f);
 
288
    s->slr = qemu_get_be32(f);
 
289
    s->den = qemu_get_be32(f);
 
290
    s->cr = qemu_get_be32(f);
 
291
    s->float_high = qemu_get_be32(f);
 
292
 
 
293
    return 0;
 
294
}
 
295
 
243
296
/* Returns an array of inputs.  */
244
297
qemu_irq *pl061_init(uint32_t base, qemu_irq irq, qemu_irq **out)
245
298
{
250
303
    iomemtype = cpu_register_io_memory(0, pl061_readfn,
251
304
                                       pl061_writefn, s);
252
305
    cpu_register_physical_memory(base, 0x00001000, iomemtype);
253
 
    s->base = base;
254
306
    s->irq = irq;
255
307
    pl061_reset(s);
256
308
    if (out)
257
309
        *out = s->out;
258
310
 
259
 
    /* ??? Save/restore.  */
 
311
    register_savevm("pl061_gpio", -1, 1, pl061_save, pl061_load, s);
260
312
    return qemu_allocate_irqs(pl061_set_irq, s, 8);
261
313
}
262