From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf1m1-0001kB-IR for qemu-devel@nongnu.org; Wed, 22 May 2013 01:39:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf1lw-0001nH-Me for qemu-devel@nongnu.org; Wed, 22 May 2013 01:39:41 -0400 Received: from [222.73.24.84] (port=48317 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf1lw-0001n4-2T for qemu-devel@nongnu.org; Wed, 22 May 2013 01:39:36 -0400 From: li guang In-Reply-To: <20130522052854.GB12536@valinux.co.jp> References: <1369194397-608-1-git-send-email-lig.fnst@cn.fujitsu.com> <1369194397-608-3-git-send-email-lig.fnst@cn.fujitsu.com> <20130522052854.GB12536@valinux.co.jp> Date: Wed, 22 May 2013 13:37:41 +0800 Message-ID: <1369201061.5142.154.camel@liguang.fnst.cn.fujitsu.com> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PATCH 2/4] acpi/gpe: expand bits of gpe register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: Anthony Liguori , Stefan Berger , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Bruce Rogers , Joel Schopp , Gerd Hoffmann , Paolo Bonzini , Andreas =?ISO-8859-1?Q?F=E4rber?= =E5=9C=A8 2013-05-22=E4=B8=89=E7=9A=84 14:28 +0900=EF=BC=8CIsaku Yamahata= =E5=86=99=E9=81=93=EF=BC=9A > Why? > And it breaks pointer operation like the fact is I can't guess why gpe->sts is defined uint8_t=20 but the real hardware is 32-bit width. I expand it to 32 because the future usage for me will=20 access bit beyond 8. of course, I can keep it, but I don't if I can violate the bit usage indication of this register. >=20 > > cur =3D ar->gpe.sts + addr; >=20 > thanks, >=20 > On Wed, May 22, 2013 at 11:46:35AM +0800, liguang wrote: > > Signed-off-by: liguang > > --- > > hw/acpi/core.c | 8 ++++---- > > hw/acpi/ich9.c | 2 +- > > hw/acpi/piix4.c | 2 +- > > include/hw/acpi/acpi.h | 4 ++-- > > 4 files changed, 8 insertions(+), 8 deletions(-) > >=20 > > diff --git a/hw/acpi/core.c b/hw/acpi/core.c > > index 42eeace..38ddeb8 100644 > > --- a/hw/acpi/core.c > > +++ b/hw/acpi/core.c > > @@ -575,9 +575,9 @@ void acpi_gpe_reset(ACPIREGS *ar) > > memset(ar->gpe.en, 0, ar->gpe.len / 2); > > } > > =20 > > -static uint8_t *acpi_gpe_ioport_get_ptr(ACPIREGS *ar, uint32_t addr) > > +static uint32_t *acpi_gpe_ioport_get_ptr(ACPIREGS *ar, uint32_t addr) > > { > > - uint8_t *cur =3D NULL; > > + uint32_t *cur =3D NULL; > > =20 > > if (addr < ar->gpe.len / 2) { > > cur =3D ar->gpe.sts + addr; > > @@ -592,7 +592,7 @@ static uint8_t *acpi_gpe_ioport_get_ptr(ACPIREGS *a= r, uint32_t addr) > > =20 > > void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val) > > { > > - uint8_t *cur; > > + uint32_t *cur; > > =20 > > cur =3D acpi_gpe_ioport_get_ptr(ar, addr); > > if (addr < ar->gpe.len / 2) { > > @@ -608,7 +608,7 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t = addr, uint32_t val) > > =20 > > uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr) > > { > > - uint8_t *cur; > > + uint32_t *cur; > > uint32_t val; > > =20 > > cur =3D acpi_gpe_ioport_get_ptr(ar, addr); > > diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c > > index 4a17f32..582dbec 100644 > > --- a/hw/acpi/ich9.c > > +++ b/hw/acpi/ich9.c > > @@ -153,7 +153,7 @@ static int ich9_pm_post_load(void *opaque, int vers= ion_id) > > .info =3D &vmstate_info_uint8, = \ > > .size =3D sizeof(uint8_t), = \ > > .flags =3D VMS_ARRAY | VMS_POINTER, = \ > > - .offset =3D vmstate_offset_pointer(_state, _field, uint8_t), = \ > > + .offset =3D vmstate_offset_pointer(_state, _field, uint32_t),= \ > > } > > =20 > > const VMStateDescription vmstate_ich9_pm =3D { > > diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c > > index c4af1cc..3a7b669 100644 > > --- a/hw/acpi/piix4.c > > +++ b/hw/acpi/piix4.c > > @@ -205,7 +205,7 @@ static int vmstate_acpi_post_load(void *opaque, int= version_id) > > .info =3D &vmstate_info_uint16, = \ > > .size =3D sizeof(uint16_t), = \ > > .flags =3D VMS_SINGLE | VMS_POINTER, = \ > > - .offset =3D vmstate_offset_pointer(_state, _field, uint8_t), = \ > > + .offset =3D vmstate_offset_pointer(_state, _field, uint32_t),= \ > > } > > =20 > > static const VMStateDescription vmstate_gpe =3D { > > diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h > > index 635be7b..deca3ce 100644 > > --- a/include/hw/acpi/acpi.h > > +++ b/include/hw/acpi/acpi.h > > @@ -112,8 +112,8 @@ struct ACPIPM1CNT { > > struct ACPIGPE { > > uint8_t len; > > =20 > > - uint8_t *sts; > > - uint8_t *en; > > + uint32_t *sts; > > + uint32_t *en; > > }; > > =20 > > struct ACPIREGS { > > --=20 > > 1.7.2.5 > >=20 >=20