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

« back to all changes in this revision

Viewing changes to hw/nand.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:
106
106
# include "nand.c"
107
107
 
108
108
/* Information based on Linux drivers/mtd/nand/nand_ids.c */
109
 
struct nand_info_s {
 
109
static const struct nand_info_s {
110
110
    int size;
111
111
    int width;
112
112
    int page_shift;
319
319
    return 0;
320
320
}
321
321
 
322
 
static int nand_iid = 0;
323
 
 
324
322
/*
325
323
 * Chip inputs are CLE, ALE, CE, WP, GND and eight I/O pins.  Chip
326
324
 * outputs are R/B and eight I/O pins.
450
448
        cpu_abort(cpu_single_env, "%s: Unsupported NAND chip ID.\n",
451
449
                        __FUNCTION__);
452
450
    }
 
451
 
 
452
    s = (struct nand_flash_s *) qemu_mallocz(sizeof(struct nand_flash_s));
453
453
    index = drive_get_index(IF_MTD, 0, 0);
454
 
    if (index == -1) {
455
 
        cpu_abort(cpu_single_env, "%s: missing MTD device\n",
456
 
                        __FUNCTION__);
457
 
    }
458
 
 
459
 
    s = (struct nand_flash_s *) qemu_mallocz(sizeof(struct nand_flash_s));
460
 
    s->bdrv = drives_table[index].bdrv;
 
454
    if (index != -1)
 
455
        s->bdrv = drives_table[index].bdrv;
461
456
    s->manf_id = manf_id;
462
457
    s->chip_id = chip_id;
463
458
    s->size = nand_flash_ids[s->chip_id].size << 20;
497
492
    if (pagesize)
498
493
        s->storage = (uint8_t *) memset(qemu_malloc(s->pages * pagesize),
499
494
                        0xff, s->pages * pagesize);
 
495
    /* Give s->ioaddr a sane value in case we save state before it
 
496
       is used.  */
 
497
    s->ioaddr = s->io;
500
498
 
501
 
    register_savevm("nand", nand_iid ++, 0, nand_save, nand_load, s);
 
499
    register_savevm("nand", -1, 0, nand_save, nand_load, s);
502
500
 
503
501
    return s;
504
502
}