harry
2005-Nov-21 13:18 UTC
[Xen-devel] [PATCH][3/17] USB virt 2.6 split driver---xenidc buffer references
This patch implements the generic code to support local and remote buffer references for the xenidc transport which is used by the USB driver. Local buffer references are used to describe local memory and are converted into remote buffer references for communication with other domains. The other domains use remote buffer references to map the buffers into their local address space for bulk data transfer. Grant references provide a mechanism to share memory on a per-page basis and couple the client to a specific memory sharing mechanism. Remote buffer references provide a memory sharing mechanism on a more convenient whole-buffer basis and are independent of the underlying implementation. Signed-off-by: Harry Butterworth <butterwo@uk.ibm.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Muli Ben-Yehuda
2005-Nov-21 20:31 UTC
Re: [Xen-devel] [PATCH][3/17] USB virt 2.6 split driver---xenidc buffer references
On Mon, Nov 21, 2005 at 01:18:48PM +0000, harry wrote:> +#ifdef MIN > +#undef MIN > +#endif > + > +#define MIN( X, Y ) ( ( (X) < (Y) ) ? (X) : (Y) )Linux has a much better definition.> + memset(buffer, 0, 64);s/64/sizeof(buffer)/? (there are arguments either way)> +xenidc_buffer_type xenidc_local_buffer_reference_register_buffer_concrete_class > + (xenidc_buffer_concrete_class * class, void (*copy_in_or_out) > + (xenidc_buffer_concrete_class * class, > + xenidc_local_buffer_reference * lbr, > + void *buffer, xenidc_buffer_byte_count byte_count, int out), void (*zero) > + (xenidc_buffer_concrete_class * class, > + xenidc_local_buffer_reference * lbr), int (*calculate_rbr_resources) > + (xenidc_buffer_concrete_class * class, > + xenidc_local_buffer_reference * lbr, > + xenidc_address * address, > + xenidc_buffer_resource_list * list), > + xenidc_buffer_concrete_class ** (*create_rbr) > + (xenidc_buffer_concrete_class * class, > + xenidc_local_buffer_reference * lbr, > + xenidc_address * address, > + xenidc_buffer_resource_provider * provider, > + xenidc_remote_buffer_reference * rbr, > + int access_flags), void (*revoke_rbr) > + (xenidc_buffer_concrete_class ** context, xenidc_callback * callback) > + ) {I guess this is one case where typedefs would improve the code ;-)> + if (zero == NULL) { > + zero = xenidc_local_buffer_reference_default_zero; > + }no braces please Cheers, Muli -- Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Harry Butterworth
2005-Nov-21 21:34 UTC
Re: [Xen-devel] [PATCH][3/17] USB virt 2.6 split driver---xenidc buffer references
On Mon, 2005-11-21 at 22:31 +0200, Muli Ben-Yehuda wrote:> On Mon, Nov 21, 2005 at 01:18:48PM +0000, harry wrote: > > > +#ifdef MIN > > +#undef MIN > > +#endif > > + > > +#define MIN( X, Y ) ( ( (X) < (Y) ) ? (X) : (Y) ) > > Linux has a much better definition.So it does. Didn''t manage to find it last time.> > > + memset(buffer, 0, 64); > > s/64/sizeof(buffer)/? (there are arguments either way) > > > +xenidc_buffer_type xenidc_local_buffer_reference_register_buffer_concrete_class > > + (xenidc_buffer_concrete_class * class, void (*copy_in_or_out) > > + (xenidc_buffer_concrete_class * class, > > + xenidc_local_buffer_reference * lbr, > > + void *buffer, xenidc_buffer_byte_count byte_count, int out), void (*zero) > > + (xenidc_buffer_concrete_class * class, > > + xenidc_local_buffer_reference * lbr), int (*calculate_rbr_resources) > > + (xenidc_buffer_concrete_class * class, > > + xenidc_local_buffer_reference * lbr, > > + xenidc_address * address, > > + xenidc_buffer_resource_list * list), > > + xenidc_buffer_concrete_class ** (*create_rbr) > > + (xenidc_buffer_concrete_class * class, > > + xenidc_local_buffer_reference * lbr, > > + xenidc_address * address, > > + xenidc_buffer_resource_provider * provider, > > + xenidc_remote_buffer_reference * rbr, > > + int access_flags), void (*revoke_rbr) > > + (xenidc_buffer_concrete_class ** context, xenidc_callback * callback) > > + ) { > > I guess this is one case where typedefs would improve the code ;-)This looked much neater before Lindent got hold of it.> > > + if (zero == NULL) { > > + zero = xenidc_local_buffer_reference_default_zero; > > + } > > no braces pleaseOK> > Cheers, > Muli-- Harry Butterworth <harry@hebutterworth.freeserve.co.uk> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel