On Wed, Dec 08, 2010 at 10:39:43AM +0100, Fabien Chouteau wrote: > On 12/08/2010 09:30 AM, Edgar E. Iglesias wrote: > > On Tue, Dec 07, 2010 at 10:55:33AM +0100, Fabien Chouteau wrote: > >> On 12/06/2010 06:12 PM, Blue Swirl wrote: > >>> On Mon, Dec 6, 2010 at 9:26 AM, Fabien Chouteau<chout...@adacore.com> > >>> wrote: > >>>> +DeviceState *grlib_gptimer_create(target_phys_addr_t base, > >>>> + uint32_t nr_timers, > >>>> + uint32_t freq, > >>>> + qemu_irq *cpu_irqs, > >>>> + int base_irq) > >>> This function belongs to leon3.c. > >> I don't see why. GPTimer is a peripheral and you may want to use it in > >> an other system. > > This might depend a bit on taste, but I agree with Blue that we shouldn't > > clutter the device models with this kind of instantiator helper calls. > > IMO it's better to put them higher up (e.g board code or similar). > > Do you mean like Xilinx devices where the instantiators are in-lined > functions in hw/xilinx.h?
Yes, that's one way. But if you only have a single board you can also just put the function with the board code. Cheers