Messages in this thread | ![/](/images/icornerl.gif) | | From | (Stephen Lee) | Date | Wed, 6 Mar 1996 16:28:25 -0500 | Subject | Re: Long-standing bugs and typos |
| |
On Mar 6, 2:16pm, "Ulrich Windl" wrote: > > On 6 Mar 96 at 0:56, Stephen Lee wrote: > > > On Mar 5, 9:10pm, Johannes Kroeger wrote: > > > > > > Hello experts, > > > > > > Here is a small collection of bugs and typos that should be fixed before the > > > next stable release. > > > > > Add this typo to your list... > > I'm not sure about this > > > > > This is linux/include/linux/pci.h: > > > > --- pci.h- Wed Mar 6 01:01:45 1996 > > +++ pci.h Wed Mar 6 01:01:53 1996 > > @@ -536,8 +536,8 @@ > > * devices. The slot/function address of each device is encoded > > * in a single byte as follows: > > * > > - * 7:4 = slot > > - * 3:0 = function > > + * 7:3 = slot > > + * 2:0 = function > > */ > > #define PCI_DEVFN(slot,func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) > > I don't have the source here, but I guess the first number is the bit > position while the second number is the length. > > 0x1f makes five bits for me (00011111); that is 7:5 for slot, and 2:3 > for function (if I'm assuming the semantics correctly). 0x07 makes > three bits (00000111).
Even if they are bit:length, they still don't match the code below. I think they are bit numbers, thus 7:3 means bit 7-3 (5 bits) and 2:0 mean bits 2,1,0 (3 bits), matching the code. I think my way is closer to the convention of specifying bits in a word.
Stephen
-- Stephen Lee Internet: sl14@cornell.edu
| ![\](/images/icornerr.gif) |