Am 12.11.2013 17:33, schrieb Corey Minyard: > This provides the base infrastructure to tie IPMI low-level > interfaces into a PC ISA bus. > > Signed-off-by: Corey Minyard <cminy...@mvista.com> [...] > diff --git a/hw/ipmi/isa_ipmi.c b/hw/ipmi/isa_ipmi.c > new file mode 100644 > index 0000000..0242a41 > --- /dev/null > +++ b/hw/ipmi/isa_ipmi.c > @@ -0,0 +1,148 @@ > +/* > + * QEMU ISA IPMI emulation > + * > + * Copyright (c) 2012 Corey Minyard, MontaVista Software, LLC > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > copy > + * of this software and associated documentation files (the "Software"), to > deal > + * in the Software without restriction, including without limitation the > rights > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > + * copies of the Software, and to permit persons to whom the Software is > + * furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice shall be included in > + * all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > + * THE SOFTWARE. > + */ > +#include "hw/hw.h" > +#include "hw/isa/isa.h" > +#include "hw/i386/pc.h" > +#include "qemu/timer.h" > +#include "sysemu/char.h" > +#include "sysemu/sysemu.h" > +#include "ipmi.h" > + > +/* This is the type the user specifies on the -device command line */ > +#define TYPE_ISA_IPMI "isa-ipmi" > +#define ISA_IPMI(obj) OBJECT_CHECK(ISAIPMIDevice, (obj), \ > + TYPE_ISA_IPMI) > +typedef struct ISAIPMIDevice { > + ISADevice dev; > + char *interface; > + uint32_t iobase; > + uint32_t isairq; > + uint8_t slave_addr; > + CharDriverState *chr; > + IPMIInterface *intf; > +} ISAIPMIDevice; > + > +static void ipmi_isa_realizefn(DeviceState *dev, Error **errp) > +{ > + ISADevice *isadev = ISA_DEVICE(dev); > + ISAIPMIDevice *isa = ISA_IPMI(dev); > + char typename[20]; > + Object *intfobj; > + IPMIInterface *intf; > + Object *bmcobj; > + IPMIBmc *bmc; > + int rc; > + > + if (!isa->interface) { > + isa->interface = g_strdup("kcs"); > + } > + > + if (isa->chr) { > + bmcobj = object_new(TYPE_IPMI_BMC_EXTERN); > + } else { > + bmcobj = object_new(TYPE_IPMI_BMC_SIMULATOR); > + } [snip]
This depends on types registered in patches 09 and 10. Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg