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

Re: Attn: David Nusinow, re: glint PCI table and the shell



On Fri, Sep 14, 2007 at 11:42:20AM -0400, Branden Robinson wrote:
> Hi David,
> 
> Saw this on #debian-x:
> 
> 23:26 < gravity> Oh my god... the glint pci id table is insane
> 23:26 < gravity> Manageable I guess, but irritatingly complicated
> 23:29  * KiBi patpats gravity
> 23:38 < gravity> Ok, yeah. This one's going to be a static file. I really
>   don't feel like figuring out how to warp shell in to making something right
>   out of this:
> 23:38 < gravity> #define PCI_VENDOR_TI_CHIP_PERMEDIA2    \ ((PCI_VENDOR_TI
> << 16) | PCI_CHIP_TI_PERMEDIA2)
> 23:38 < gravity> ^ more pain than it's worth for a temporary hack
> 23:39 < gravity> Internally though, that's actually a pretty good way to do
>   things. It'll work well for pci-rework
> 
> You have access to bitwise operations in standard POSIX shell arithmetic.
> 
> $ echo $(( 1 << 5 ))
> 32
> $ echo $(( 1 << 5 | 4 ))
> 36

Heh, that really cool. I had no idea. I ended up shipping a static file
since the driver will eventually export the PCI ID's as symbols that we can
access instead, so I didn't need any fancy scripting. This is good to know
though, thank you!

 - David Nusinow



Reply to: