On Mon, 2003-02-17 at 17:15, Leif Delgass wrote: > As I was doing some minor cleanups in the mach64 drm in the new branch, I > made some additional search and replace conversions of the mach64 DRM to > the os independence macros (I couldn't restrain myself ;) ). However, I > want to share what I've done so far and get some feedback, since there are > a couple of issues here: > > 1. We are currently using access_ok() to check the vertex buffers > submitted by the client before copying them to (what will be) private > kernel buffers. There was only a macro in drm_os_linux.h for > DRM_VERIFYAREA_READ(), so I added DRM_ACCESSOK_READ(). I don't really > know the details of what the difference is between verify_area() and > access_ok() (Jose added that code based on a suggestion from Linus, I > think), but I believe access_ok() is intended as a security check, which > is the reason for the copy. It seems that this all maps to the same thing > for *BSD at the moment -- i.e. the unchecked macros aren't implemented > differently from the checked ones, right?
Yeah, there's no unchecked versions for FreeBSD that I can find, and if it's in the middle of a loop it might be a pretty significant hit on cpu. > 2. The Mach64 driver makes heavy use of the list struct and macros from > linux/list.h. I moved the define for list_for_each_safe() (needed for > older 2.4 Linux kernels) from mach64_drv.h to drmP.h, since that has > already been added in XFree86 CVS (I think the i8x0 drm uses it now also). > I also removed the include of linux/list.h from the mach64 driver, since > it already gets included (indirectly?) through the drm headers. However, > it looks like an analogue of linux/list.h might need to be added to the > BSD drm headers. The only wrinkle there is that it also uses > linux/prefetch.h. I was wondering if we would want to bring in a stripped-down verion of BSD sys/queue.h. We could just have a subset of the tailq macros and add another macro to it for the foreach_safe. > 3. We still need to work out the wrapper/alternative to > pci_alloc_consistent() and friends. I'll get to work on this once we've got the lists issue cleared up. I think I understand the busdma stuff pretty decently at this point. > At any rate, the remainder of the attached patch is trivial additions of > DRM_ERR, DRM_CURRENTPID, etc. and a couple of whitespace tweaks. Looks good to me. -- Eric Anholt [EMAIL PROTECTED] http://people.freebsd.org/~anholt/ [EMAIL PROTECTED] ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel