Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Aug 2008 16:47:05 +0100
From:      Dieter <freebsd@sopwith.solgatos.com>
To:        Sean Bruno <sbruno@miralink.com>
Cc:        Scott Long <scottl@freebsd.org>, freebsd-firewire@freebsd.org
Subject:   Re: This is where I'm going with fwcontrol 
Message-ID:  <200808112347.XAA02248@sopwith.solgatos.com>
In-Reply-To: Your message of "Sat, 09 Aug 2008 13:12:28 PDT." <489DFA2C.4080407@miralink.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
[ I suggested changing priority_budget from int to long, but
then realized that this only fixes it on LP64, not on ILP32. ]

>> I suspect that gcc will still complain on ILP32 machines.

> I implemented your fix for priority_budget, i.e. I should have been 
> paying attention to the conditional test and the assignment from strtol()!

What arch are you compiling this on?  Does gcc not complain on
a ILP32 machine?  If the intended legal range is 0-4294967295,
a 32 bit signed integer isn't going to work.  On ILP32, (long)0xffffffff
has a value of -1, assuming 2's complement.

Actually, strtol returns long, so the largest positive number it
can return is 0x7fffffff = 2147483647.  If we need 0-4294967295
perhaps use strtoll() which returns long long.

-------------

On the fwcontrol man page, should

     -i pri_req
             Set the PRIORITY_BUDGET register on all supported nodes.

be

     -b pri_req
             Set the PRIORITY_BUDGET register on all supported nodes.

?

For the benefit of end users who are not firewire wizards, it would
be nice for the man page to include the range of legal values and
what they mean.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808112347.XAA02248>