Steven Kauffmann wrote: > Hi > > When looking at the rtdm examples tut01-skeleton en tut02-skeleton, I have a > question about the context_size in the rtdm_device struct. > > In tut01-skeleton-drv.c, the context_size = sizeof(buffer_t), in the other > example context_size = 0. Both drivers uses the > rtdm_safe_copy_to_user/rtdm_safe_copy_from_user functions to write/read data > from buffer_t(kernel space) to user_space. So I don't understand why the > context_size in tut02 is different than in tut01. Or is the context_size > only important if we open the driver several times from one or more > user_space programs?
The context size is important in case you want to attach some data to each opened instance of a device. Hmm, but this is something neither tut01 nor tut02 deals with optimally. tut02 cannot use a context-based buffer, because it uses two device instances (opened by two instances of the user space program) to transfer the data. But tut01 could use some global buffer as well without loosing a feature. Philippe (trem), could you rework tut01 and make it use a global buffer instead? Then some tut03 would be nice to explain what per context, per device, and global data means. I've seen confusion about this fairly often, so a dedicated tutorial would be great. Thanks, Jan
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
