tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: Updated drm code




this change lets drm work on amd64 where it wants to have mmap
work on offsets that are an unsigned value and end up triggering
a < 0 test inside uvm_device.c.  it's kind of a hack but it seems
cleaner than any other change i've seen proposed.

any objections to this?


.mrg.


Index: uvm/uvm_device.c
===================================================================
RCS file: /cvsroot/src/sys/uvm/uvm_device.c,v
retrieving revision 1.55
diff -p -r1.55 uvm_device.c
*** uvm/uvm_device.c    17 Dec 2008 20:51:39 -0000      1.55
--- uvm/uvm_device.c    19 Jun 2009 05:10:40 -0000
*************** udv_attach(void *arg, vm_prot_t accesspr
*** 143,149 ****
         * Negative offsets on the object are not allowed.
         */
  
!       if (off != UVM_UNKNOWN_OFFSET && off < 0)
                return(NULL);
  
        /*
--- 143,150 ----
         * Negative offsets on the object are not allowed.
         */
  
!       if ((cdev->d_flag & D_NEGOFFSAFE) != 0 &&
!           off != UVM_UNKNOWN_OFFSET && off < 0)
                return(NULL);
  
        /*
Index: sys/conf.h
===================================================================
RCS file: /cvsroot/src/sys/sys/conf.h,v
retrieving revision 1.134
diff -p -r1.134 conf.h
*** sys/conf.h  2 Feb 2009 14:00:27 -0000       1.134
--- sys/conf.h  19 Jun 2009 05:10:40 -0000
*************** struct vnode;
*** 61,66 ****
--- 61,67 ----
  #define       D_TTY           0x0003
  #define       D_TYPEMASK      0x00ff
  #define       D_MPSAFE        0x0100
+ #define       D_NEGOFFSAFE    0x0200
  
  /*
   * Block device switch table
Index: external/bsd/drm/dist/bsd-core/drm_drv.c
===================================================================
RCS file: /cvsroot/src/sys/external/bsd/drm/dist/bsd-core/drm_drv.c,v
retrieving revision 1.12
diff -p -r1.12 drm_drv.c
*** external/bsd/drm/dist/bsd-core/drm_drv.c    19 Jun 2009 03:50:03 -0000      
1.12
--- external/bsd/drm/dist/bsd-core/drm_drv.c    19 Jun 2009 05:10:40 -0000
*************** struct cdevsw drm_cdevsw = {
*** 311,317 ****
        drm_poll,
        drm_mmap,
        nokqfilter,
!       D_TTY
  };
  
  int drm_refcnt = 0;
--- 311,317 ----
        drm_poll,
        drm_mmap,
        nokqfilter,
!       D_TTY | D_NEGOFFSAFE
  };
  
  int drm_refcnt = 0;


Home | Main Index | Thread Index | Old Index