HI Jano, Ján Veselý wrote: > after the recent changes to ddf_dev and ddf_fun I found this code in > driver.h header: > > /** XXX Only to transition USB */ > #ifdef _DDF_DATA_IMPLANT > extern void ddf_fun_data_implant(ddf_fun_t *, void *); > #endif > > Does it mean that in the future only heap allocated function data will > be supported? DDF tries to make the life of a driver simpler by managing the lifetime of the device and function soft state (driver-specific data structure). DDF counts references to the device/function and frees the device/function node and the associated driver-specific data structure when the reference count drops to zero.
This means the driver only needs to put a simple mutex into the soft state structure for synchronization, possibly a boolean to mark the device as torn down, and it's ready to go. (Otherwise the driver would probably have to do some reference counting itself). Since the framework frees the memory, you also call the framework to allocate it - always from the heap. > I hope not. Why not? Is there any particular case where this is a problem? Regards, Jiri _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/cgi-bin/listinfo/helenos-devel
