From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT5JC-0006oW-0b for qemu-devel@nongnu.org; Fri, 19 Apr 2013 03:00:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UT5J7-00027n-4r for qemu-devel@nongnu.org; Fri, 19 Apr 2013 03:00:33 -0400 Received: from [222.73.24.84] (port=21443 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT5J6-00025T-Jd for qemu-devel@nongnu.org; Fri, 19 Apr 2013 03:00:29 -0400 Date: Fri, 19 Apr 2013 14:50:51 +0800 From: Hu Tao Message-ID: <20130419065051.GI11385@localhost.localdomain> References: <41b83b75f11879953c8951654321b4ce5a4e2132.1366250561.git.hutao@cn.fujitsu.com> <87ppxsgplb.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 In-Reply-To: <87ppxsgplb.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v19 4/7] pvpanic: pass configurable ioport to seabios List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Peter Maydell , Gleb Natapov , "Michael S. Tsirkin" , Jan Kiszka , qemu-devel , Luiz Capitulino , Blue Swirl , Orit Wasserman , Juan Quintela , Alexander Graf , Christian Borntraeger , Andrew Jones , Alex Williamson , Sasha Levin , Stefan Hajnoczi , KAMEZAWA Hiroyuki , Anthony Liguori , Marcelo Tosatti , Paolo Bonzini On Thu, Apr 18, 2013 at 11:22:56AM +0200, Markus Armbruster wrote: > Hu Tao writes: >=20 > > This lets seabios patch the corresponding SSDT entry. > > > > Signed-off-by: Hu Tao > > --- > > hw/misc/pvpanic.c | 14 ++++++++++++++ > > hw/nvram/fw=5Fcfg.c | 8 +++++++- > > include/hw/nvram/fw=5Fcfg.h | 2 ++ > > 3 files changed, 23 insertions(+), 1 deletion(-) > > > > diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c > > index c3adcdf..23599a3 100644 > > --- a/hw/misc/pvpanic.c > > +++ b/hw/misc/pvpanic.c > > @@ -18,6 +18,8 @@ > > #include > > #include > > =20 > > +#include "hw/nvram/fw=5Fcfg.h" > > + > > /* The bit of supported pv event */ > > #define PVPANIC=5FF=5FPANICKED 0 > > =20 > > @@ -86,10 +88,22 @@ static const MemoryRegionOps pvpanic=5Fops =3D { > > static int pvpanic=5Fisa=5Finitfn(ISADevice *dev) > > { > > PVPanicState *s =3D ISA=5FPVPANIC=5FDEVICE(dev); > > + static bool port=5Fconfigured; > > + void *fw=5Fcfg; > > =20 > > memory=5Fregion=5Finit=5Fio(&s->io, &pvpanic=5Fops, s, "pvpanic", = 1); > > isa=5Fregister=5Fioport(dev, &s->io, s->ioport); > > =20 > > + if (!port=5Fconfigured) { > > + fw=5Fcfg =3D object=5Fresolve=5Fpath("/machine/fw=5Fcfg", NULL= ); > > + if (fw=5Fcfg) { > > + fw=5Fcfg=5Fadd=5Ffile(fw=5Fcfg, "etc/pvpanic-port", > > + g=5Fmemdup(&s->ioport, sizeof(s->ioport)), > > + sizeof(s->ioport)); > > + port=5Fconfigured =3D true; > > + } > > + } > > + > > return 0; > > } > > =20 > > diff --git a/hw/nvram/fw=5Fcfg.c b/hw/nvram/fw=5Fcfg.c > > index 97bba87..1a7e49c 100644 > > --- a/hw/nvram/fw=5Fcfg.c > > +++ b/hw/nvram/fw=5Fcfg.c > > @@ -489,11 +489,17 @@ FWCfgState *fw=5Fcfg=5Finit(uint32=5Ft ctl=5Fport= , uint32=5Ft data=5Fport, > > dev =3D qdev=5Fcreate(NULL, "fw=5Fcfg"); > > qdev=5Fprop=5Fset=5Fuint32(dev, "ctl=5Fiobase", ctl=5Fport); > > qdev=5Fprop=5Fset=5Fuint32(dev, "data=5Fiobase", data=5Fport); > > - qdev=5Finit=5Fnofail(dev); > > d =3D SYS=5FBUS=5FDEVICE(dev); > > =20 > > s =3D DO=5FUPCAST(FWCfgState, busdev.qdev, dev); > > =20 > > + if (!object=5Fresolve=5Fpath("/machine/fw=5Fcfg", NULL)) { > > + object=5Fproperty=5Fadd=5Fchild(qdev=5Fget=5Fmachine(), "fw=5F= cfg", OBJECT(s), > > + NULL); > > + } > > + > > + qdev=5Finit=5Fnofail(dev); > > + > > if (ctl=5Faddr) { > > sysbus=5Fmmio=5Fmap(d, 0, ctl=5Faddr); > > } > > diff --git a/include/hw/nvram/fw=5Fcfg.h b/include/hw/nvram/fw=5Fcfg.h > > index 05c8df1..07cc941 100644 > > --- a/include/hw/nvram/fw=5Fcfg.h > > +++ b/include/hw/nvram/fw=5Fcfg.h > > @@ -1,6 +1,8 @@ > > #ifndef FW=5FCFG=5FH > > #define FW=5FCFG=5FH > > =20 > > +#include "exec/hwaddr.h" > > + > > #define FW=5FCFG=5FSIGNATURE 0x00 > > #define FW=5FCFG=5FID 0x01 > > #define FW=5FCFG=5FUUID 0x02 >=20 > Why is the include necessary? Withou it gcc gives error like this: In file included from hw/misc/pvpanic.c:21:0: qemu/include/hw/nvram/fw=5Fcfg.h:68:25: error: unknown type name =E2=80=98h= waddr=E2=80=99 qemu/include/hw/nvram/fw=5Fcfg.h:68:42: error: unknown type name =E2=80=98h= waddr=E2=80=99 =