Okay, I made that change, and am rerunning nightly.  The new diffs for 
just the strsun.h file are below.  If they are acceptable, then I'll 
submit the RTI.  (I probably won't rerun the tests, since it seems 
obvious that the generated code will not be different.  Seth, since 
you're my RTI advocate on this, let me know if you feel different and 
want to boot these BFU archives as well.)

    -- Garrett

------- usr/src/uts/common/sys/strsun.h -------

Index: usr/src/uts/common/sys/strsun.h
--- 
/net/zcube.west/export/ws/onnv-clone/usr/src/uts/common/sys/strsun.h       
Mon Jan 29 22:18:05 2007
+++ /export/build0/gd78059/mblkl/usr/src/uts/common/sys/strsun.h        
Mon Jun 30 09:19:00 2008
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -26,7 +26,7 @@
 #ifndef        _SYS_STRSUN_H
 #define        _SYS_STRSUN_H
 
-#pragma ident  "@(#)strsun.h   1.31    06/12/27 SMI"
+#pragma ident  "@(#)strsun.h   1.34    08/06/30 SMI"
 
 #include <sys/stream.h>
 #include <sys/types.h>
@@ -47,12 +47,13 @@
 #define        DB_TYPE(mp)     ((mp)->b_datap->db_type)
 #define        DB_FLAGS(mp)    ((mp)->b_datap->db_flags)
 
-#define        MBLKL(mp)       ((mp)->b_wptr - (mp)->b_rptr)
-#define        MBLKSIZE(mp)    ((mp)->b_datap->db_lim - 
(mp)->b_datap->db_base)
-#define        MBLKHEAD(mp)    ((mp)->b_rptr - (mp)->b_datap->db_base)
-#define        MBLKTAIL(mp)    ((mp)->b_datap->db_lim - (mp)->b_wptr)
+#define        _PTRDIFF(p1, p1)        ((intptr_t)((uintptr_t)(p1) - 
(untptr_t)(p2)))
+#define        MBLKL(mp)               _PTRDIFF((mp)->b_wptr, (mp)->b_rptr)
+#define        MBLKSIZE(mp)            _PTRDIFF(DB_LIM(mp), DB_BASE(mp))
+#define        MBLKHEAD(mp)            _PTRDIFF((mp)->b_rptr, DB_BASE(mp))
+#define        MBLKTAIL(mp)            _PTRDIFF(DB_LIM(mp), (mp)->b_wptr)
 #define        MBLKIN(mp, off, len) (((off) <= MBLKL(mp)) && \
-                       (((mp)->b_rptr + (off) + (len)) <= (mp)->b_wptr))
+       (((mp)->b_rptr + (off) + (len)) <= (mp)->b_wptr))
 
 #ifdef _KERNEL
 extern void    mcopyin(mblk_t *, void *, size_t, void *);


Seth Goldberg wrote:
> Quoting Peter Memishian, who wrote the following on Sun, 29 Jun 2008:
>
>   
>>>>  > http://cr.opensolaris.org/~gdamore/mblkl/  once I get confirmation,
>>>>  > especially from meem, then I'll go ahead and submit the RTI.
>>>>
>>>> I'm confused -- the definition for MBLKL() in the webrev appears to still 
>>>> be:
>>>>
>>>>    #define MBLKL(mp)       ((uintptr_t)(mp)->b_wptr - 
>>>> (uintptr_t)(mp)->b_rptr)
>>>>
>>>>
>>>>         
>>> Have another look.  It looks like I forgot to push the updated webrev to
>>> cr.opensolaris.org.  Sorry about that.
>>>       
>> I just looked at <sys/strsun.h>.  Looks fine, though those defintions sure
>> are ugly.   I'd be tempted to do something like:
>>
>> #define _PTRDIFF(p1, p2)     ((intptr_t)((uintptr_t)(p1) - (uintptr_t)(p2)))
>> #define MBLKL(mp)                    _PTRDIFF((mp)->b_wptr, (mp)->b_rptr)
>> #define MBLKSIZE(mp)            _PTRDIFF(DB_LIM(mp), DB_BASE(mp))
>> #define MBLKHEAD(mp)         _PTRDIFF((mp)->b_rptr, DB_BASE(mp))
>> #define MBLKTAIL(mp)         _PTRDIFF(DB_LIM(mp), (mp)->b_wptr)
>>     
>
>
>    I agree -- that's much nicer.
>
>   --S
> _______________________________________________
> networking-discuss mailing list
> [EMAIL PROTECTED]
>   

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to