Johannes Engel wrote: > Thomas Hellström wrote: >> Johannes, >> >> If the patch works, it looks correct to me. >> However, you need to make sure (using defines) that the code will >> compile also on kernels that don't have the .fault method. >> >> /Thomas > Hi Thomas, > > thanks for reviewing and suggesting. :) > I created a new variable DRM_HAS_FAULT which is defined for kernels from > 2.6.23 and decides about using .fault or .nopfn. > I attach a corrected version.
Wow, there are a lot ifdefs in the code. You could remove most of them if you do something like: #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)) #define DRM_HAS_FAULT #define DRM_FAULT_SIGBUS VM_FAULT_SIGBUS #else #define DRM_FAULT_SIGBUS NOPFN_SIGBUS #endif and then use DRM_FAULT_SIGBUS in the code below. Also, why don't you take these two ifdefs together? +#ifdef DRM_HAS_FAULT + unsigned long address = (unsigned long)vmf->virtual_address; +#endif int err; unsigned long bus_base; unsigned long bus_offset; unsigned long bus_size; +#ifdef DRM_HAS_FAULT + int ret = VM_FAULT_NOPAGE; +#else unsigned long ret = NOPFN_REFAULT; +#endif tom ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel