[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] run time memory trap question
Hi Julien,
What I'm thinking about for ARM - is to use linked list for MMIO handlers + API to register / unregister handler. xen/arch/arm/io.c: 25 static const struct mmio_handler *const mmio_handlers[] = 26 { 27 &vgic_distr_mmio_handler, 28 &vuart_mmio_handler, 29 };
This can be changed to list. New API will add / remove entries. VGIC and VUART will call something like mmio_register_handler(&vgic_distr_mmio_handle) during corresponding initcall. Than the only change which is required for existing int handle_mmio(mmio_info_t *info) function - is to enumerate list, instead of array 32 int handle_mmio(mmio_info_t *info) 33 {
34 struct vcpu *v = current; 35 int i; 36 37 for ( i = 0; i < MMIO_HANDLER_NR; i++ ) --> *list_for_each* 38 if ( mmio_handlers[i]->check_handler(v, info->gpa) )
39 return info->dabt.write ? 40 mmio_handlers[i]->write_handler(v, info) : 41 mmio_handlers[i]->read_handler(v, info); 42
43 return 0; 44 } Something like this. Regards, Andrii
Andrii Tseglytskyi | Embedded Dev GlobalLogic www.globallogic.com _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |