4 Jun 17:06
Re: Re: [parisc-linux] [PATCH] usb/input/hid-core.c extract() brain damage
Alan Stern <stern <at> rowland.harvard.edu>
2005-06-04 15:06:52 GMT
2005-06-04 15:06:52 GMT
On Sat, 4 Jun 2005, Grant Grundler wrote:
> Yes, Kyle tracked it down to parisc switching from a parisc asm
> definition of get_unaligned() to using the generic ones.
> Ie we moved from avoiding kernel traps to exercising them.
> But 64-bit kernel worked fine with USB.
> And on 32-bit kernels le64() loads degenerate into two 32-bit
> loads. Ie the trap handler is still only dealing with 32-bit
> misaligned accesses like it would with this patch. So I don't
> think the kernel trap support is the problem.
>
> Regardless, the two functions are badly written and could
> be alot clearer.
This is a naive question from someone who doesn't know much about the
various implementations of get_unaligned() and put_unaligned().
In spite of the total overall number of changes required, wouldn't it be
much simpler to have a suite of routines (inlines or macros) like:
get_16, put_16, get_le16, put_le16, get_be16, put_be16
get_32, put_32, get_le32, put_le32, get_be32, put_be32
get_64, put_64, get_le64, put_le64, get_be64, put_be64
in short, {get|put}_{|le|be}{16|32|64}
for native, little-endian, and big-endian unaligned accesses? The generic
definitions are extremely simple and architecture-specific headers could
easily provide optimized versions.
(Continue reading)
RSS Feed