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

Re: [bluetooth-dev] Re: Porting to ARM



Bill Pringlemeir wrote:

> union something {
>         struct foo{
>                 u32 ogf:6;
>                 u32 ocf:10;
>         },
>         u16 raw;
> }
>
> When reading, the value must be run through a bluetooth swap function.
> Then the other software can use the ogf,ocf as they like.  There is no
> need for bit operations.
>

I don't see how one can use swapping to solve the problem. Perhaps I'm
slow, but could you provide an example of what you mean?

>
> Byte order shouldn't effect anything other than values retrieved from
> devices (network, floppy, USB, etc).  Once the value is in the
> machine, things shouldn't have to be manipulated.
>
> A danger with turning on global structure alignments is that other
> code may rely on a different structure packing (ie some kernel data?).
>

No need to turn it on globally (how would one do that, by the way?). We
only need to pack the structs declared in the Axis stack to be used for
byte stream overlays. In fact, the stack seems to only use them when
writing data to the network, not when reading it in.

>
> hth,
> Bill

--Gordon