On Mon, Feb 17, 2003 at 08:15:02PM -0500, 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?

They seem to be equivalent, onyle the semantics of the return value
differ. Here is the definition of verify_area in my distribution kernel
sources (linux-2.4.20-gentoo-r1), in include/asm-i386/uaccess.h:

static inline int verify_area(int type, const void * addr, unsigned long size)
{
        return access_ok(type,addr,size) ? 0 : -EFAULT;
}

So perhaps we should converge on one. 

> 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.
> 
> 3. We still need to work out the wrapper/alternative to 
> pci_alloc_consistent() and friends.

I'm still reading Ian texmem-2 proposal and looking to the source code
to get a hold of this.

> 4. As I mentioned before, the interrupt code is not converted, but it's
> currently unused.

My memory is failing: this might still be usefull for Xv, isn't it?

> At any rate, the remainder of the attached patch is trivial additions of
> DRM_ERR, DRM_CURRENTPID, etc. and a couple of whitespace tweaks.

José Fonseca
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


-------------------------------------------------------
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

Reply via email to