> > There's no point passing round both a pic callback and an object when we > > can embed the callback in the object. > > I don't think that adding a callback is bad. It can be useful to use the > device with another CPU or IRQ controller for example.
It means all the device emulation code has got to keep track of three bits of information rather than two, which seems silly when the callback and the object are inherently linked. I can't think of any cases where the callback is not be implied by the object. > In fact, I would like to go further by adding a type such as > "QEMUSignal" which could be used for IRQs or any other I/Os. Then you > can pass it to devices. You can used qemu_signal_set(QEMUSignal *signal, > int level) to set the level and add listeners to get notified on the > changes with something like: qemu_add_signal_cb(QEMUSignal *signal, void > (*cb)(void *opaque), void *opaque). Extending the arm_pic code to work with all targets on my list of things to do. Paul _______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel