Received: from [140.186.70.92] (port=46042 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzRQW-0004mE-H9 for qemu-devel@nongnu.org; Sat, 25 Sep 2010 05:52:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzRQV-0003qQ-3S for qemu-devel@nongnu.org; Sat, 25 Sep 2010 05:52:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13426) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzRQU-0003qG-TS for qemu-devel@nongnu.org; Sat, 25 Sep 2010 05:52:15 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 2/8] [MIPS] qdev: convert ds1225y nvram to sysbus device References: <1283978392-6313-1-git-send-email-hpoussin@reactos.org> <1283978392-6313-3-git-send-email-hpoussin@reactos.org> Date: Sat, 25 Sep 2010 11:52:12 +0200 In-Reply-To: <1283978392-6313-3-git-send-email-hpoussin@reactos.org> (=?utf-8?Q?=22Herv=C3=A9?= Poussineau"'s message of "Wed, 8 Sep 2010 22:39:46 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Herv=C3=A9?= Poussineau Cc: qemu-devel@nongnu.org Herv=C3=A9 Poussineau writes: > Use it in Jazz emulation > Remove protection stuff, which doesn't belong to this device > Remove ds1225y_init() and ds1225y_set_protection() functions, which are n= ot used anymore > > Signed-off-by: Herv=C3=A9 Poussineau I think this would be easier to review if you split it up some, perhaps cleanup such as DPRINTF(), removal of protection stuff, and qdev conversion. > --- > hw/ds1225y.c | 151 ++++++++++++++++++++++++++++++--------------------= ------ > hw/mips.h | 4 -- > hw/mips_jazz.c | 4 +- > 3 files changed, 83 insertions(+), 76 deletions(-) > > diff --git a/hw/ds1225y.c b/hw/ds1225y.c > index 009d127..046d1ec 100644 > --- a/hw/ds1225y.c > +++ b/hw/ds1225y.c > @@ -22,31 +22,34 @@ > * THE SOFTWARE. > */ >=20=20 > -#include "hw.h" > -#include "mips.h" > -#include "nvram.h" > +#include "sysbus.h" >=20=20 > //#define DEBUG_NVRAM >=20=20 > -typedef struct ds1225y_t > -{ > - uint32_t chip_size; > +#ifdef DEBUG_NVRAM > +#define DPRINTF(fmt, ...) \ > + do { printf("nvram: " fmt , ## __VA_ARGS__); } while (0) > +#else > +#define DPRINTF(fmt, ...) do {} while (0) > +#endif > + > +typedef struct { > + DeviceState qdev; > + int32_t chip_size; You change chip_size from unsigned to signed. Why? > + char* filename; > QEMUFile *file; > uint8_t *contents; > - uint8_t protection; > -} ds1225y_t; > - > +} NvRamState; [...]