Chuck Ebbert wrote: > Chris Lesiak reported that changes to i386's __memcpy() broke his device > because it can't handle byte moves and the new code uses them for > all trailing bytes when the length is not divisible by four. The old > code tried to use a 16-bit move and/or a byte move as needed. > > H. Peter Anvin: > "There are only a few semantics that make sense: fixed 8, 16, 32, or 64 > bits, plus "optimal"; the latter to be used for anything that doesn't > require a specific transfer size. Logically, an unqualified > "memcpy_to/fromio" should be the optimal size (as few transfers as > possible)" > > So add back the old code as __minimal_memcpy and have IO transfers > use that. > I was thinking some more about that, and I suspect the "right" way to do this looks something like the attached code. Note that it assymetric, and that it's probably too long to inline. I haven't tested this yet, and I probably won't have time to do so this evening. -hpa